Skip to content

feat(opencode): auto-reload provider auth state on 401 and add /reauth command#15434

Open
aberglund-cf wants to merge 1 commit intoanomalyco:devfrom
aberglund-cf:feat/reload-auth
Open

feat(opencode): auto-reload provider auth state on 401 and add /reauth command#15434
aberglund-cf wants to merge 1 commit intoanomalyco:devfrom
aberglund-cf:feat/reload-auth

Conversation

@aberglund-cf
Copy link

@aberglund-cf aberglund-cf commented Feb 28, 2026

Issue for this PR

Closes #15433

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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

  • /reload - nice to have but it could be better to not take up space or possibly introduce buggy behavior. I'd like to hear some opinions about that.
  • Should this behavior live behind a config flag?

How did you verify your code works?

  • Added unit tests where feasible
  • Manually exercised login flow by removing token from auth and triggering refresh

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Refresh wellknown auth on 401 Unauthorized

1 participant