Skip to content

Commit e79cce1

Browse files
ericdalloeca-agent
andcommitted
Use dynamic API URL for Copilot model discovery
The /models endpoint fetch was still using the static config URL, ignoring the dynamic api-url from the token response. This caused 401 errors during initialization for GHE users whose token is scoped to a different API host. Apply the same override pattern used in the chat request path. Relates to #402 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <git@eca.dev>
1 parent bd2feed commit e79cce1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/eca/models.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@
228228
Returns a map of model-id -> model-config map, or nil."
229229
[provider provider-config config db]
230230
(when (contains? native-models-endpoint-providers (:api provider-config))
231-
(let [api-url (llm-util/provider-api-url provider config)
231+
(let [api-url (or (get-in db [:auth provider :api-url])
232+
(llm-util/provider-api-url provider config))
232233
[_ api-key] (llm-util/provider-api-key provider
233234
(get-in db [:auth provider])
234235
config)

0 commit comments

Comments
 (0)