feat(opencode): auto-reload provider auth state on 401 and add /reauth command#15434
feat(opencode): auto-reload provider auth state on 401 and add /reauth command#15434aberglund-cf wants to merge 1 commit intoanomalyco:devfrom
Conversation
0585558 to
865836a
Compare
Provider auth changes (API keys, wellknown tokens) are now picked up without restarting. On 401, the session processor automatically refreshes auth state and retries once. Users can also trigger this manually via /reload (or /refresh). Wellknown auth token refresh is shared between the CLI login flow and the automatic reload path.
9184ba1 to
c846943
Compare
|
I hit a closely related real-world case while debugging : fresh processes could recover after auth/account state changed on disk, but already-open sessions could stay stuck on stale provider state until restart.\n\nI ended up fixing the plugin side with an OpenAI-style pattern very similar to this PR:\n- reload latest provider/account state from disk at request time\n- flush stale in-memory rate-limit/account-failure state\n- retry once before hard-failing on stale / states\n\nUpstream plugin PR for the concrete package-side fix: https://github.com/NoeFabris/opencode-antigravity-auth/pull/539\n\nSo from local repro: this core direction is absolutely the right model for already-open sessions. |
|
I hit a closely related real-world case while debugging I ended up fixing the plugin side with an OpenAI-style pattern very similar to this PR:
Upstream plugin PR for the concrete package-side fix: NoeFabris/opencode-antigravity-auth#539 So from local repro: this core |
Issue for this PR
Closes #15433
Type of change
What does this PR do?
Provider auth changes (API keys, wellknown tokens) are now picked up without restarting. On 401, the session processor automatically refreshes auth state and retries once.
Users can also trigger this manually via /reload (or /refresh). Wellknown auth token refresh is shared between the CLI login flow and the automatic reload path.
Outstanding questions
How did you verify your code works?
Checklist