Repository navigation
Conversation
There was a problem hiding this comment.
Looks good. The three new tests fail on the base and pass with this change (43/43 in provider-opencode.test.ts), and the packages/core type check passes. I didn't run it end to end, because that needs Console sending a real expired-key response.
Public API: unchanged. The new error tag stays inside the plugin, and the connection status shape is the same (needs_auth + message).
One small point inline: when inference returns an expired-key 401, the Console config isn't re-checked, so the connection status only picks up the key-replacement message on the next periodic check.
Related: #55675
| Effect.flatMap(Schema.decodeUnknownEffect(ExpiredInference)), | ||
| Effect.option, | ||
| ) | ||
| if (Option.isSome(expired)) return |
There was a problem hiding this comment.
This early return also skips check(). Before, the 401 re-fetched the Console config right away and updated the connection status. Now the status (with the key-replacement message from ApiKeyExpiredError) stays stale until the next 1-minute check. Could this be { yield* check(); return }? That keeps the upstream response and still updates the status straight away.
Issue for this PR
Companion to the Console expired-key response change.
Type of change
What does this PR do?
Keep
api_key_expiredinference responses intact rather than replacing them with a reconnect instruction. Console config reports the server's key-replacement instructions. Saved keys are retained; OAuth refresh and session errors are unchanged.How did you verify your code works?
Provider tests: 43 passing, including key persistence, config expiry, OpenAI-compatible and Google-compatible errors.
bun run checkpasses (existing lint warnings).Screenshots / recordings
Not a UI layout change.
Checklist
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
Added by the opencode bot (AI-generated).
Related: #55675