diff options
| author | Adam Malczewski <[email protected]> | 2026-05-27 20:05:06 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-05-27 20:05:06 +0900 |
| commit | 9ac04b96801ef254f46d77d3314ae36a1ad79aed (patch) | |
| tree | b9e95cb28aade64162b29cb55d34a3c3286a419e /packages/api | |
| parent | 1e3f67ea0223fb77bfc8e2a0add7ba16e5fa1f1a (diff) | |
| download | dispatch-9ac04b96801ef254f46d77d3314ae36a1ad79aed.tar.gz dispatch-9ac04b96801ef254f46d77d3314ae36a1ad79aed.zip | |
fix(api): apply correct model+baseURL when API key env var is missing, preventing silent fallback to OpenCode Go endpoint
Diffstat (limited to 'packages/api')
| -rw-r--r-- | packages/api/src/agent-manager.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/api/src/agent-manager.ts b/packages/api/src/agent-manager.ts index 0f06683..6e03adb 100644 --- a/packages/api/src/agent-manager.ts +++ b/packages/api/src/agent-manager.ts @@ -611,6 +611,13 @@ export class AgentManager { console.warn( `dispatch: env var "${key.env}" not set for key "${key.id}", falling back to env vars`, ); + // Apply the correct model + baseURL even when the key + // is unavailable so the request at least targets the + // right endpoint and produces a diagnosable auth error + // instead of silently routing to the default OpenCode Go + // endpoint (which may serve a different model). + baseURL = key.base_url; + model = effectiveModelId; tabAgent.keyId = effectiveKeyId; tabAgent.modelId = effectiveModelId; useOverride = true; |
