fix: invalidate provider state when OAuth tokens are refreshed#172
Closed
monotykamary wants to merge 1 commit into
Closed
fix: invalidate provider state when OAuth tokens are refreshed#172monotykamary wants to merge 1 commit into
monotykamary wants to merge 1 commit into
Conversation
Resolves issue where concurrent opencode instances cause "OAuth token has been revoked" errors. When one instance refreshes tokens, other running instances continue using stale cached access tokens, leading to authentication failures. - Add Provider.invalidateState() to clear cached provider state - Call invalidateState() in AuthAnthropic.access() after token refresh - Forces re-initialization with fresh tokens on next API call 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
monotykamary
marked this pull request as draft
June 17, 2025 15:33
Contributor
Author
|
Actually needs a triple check at some point, not sure if this is the best way. |
Member
|
hey appreciate you looking into this but we fixed it a different way - managed to basically add a middleware to the SDK to reuse saved tokens i didn't put it together multiple instances of opencode was making the issue worse - ty for figure that out helped me track down a fix |
andreipromarketing-dev
pushed a commit
to andreipromarketing-dev/opencode
that referenced
this pull request
Apr 7, 2026
…nomalyco#188, anomalyco#172, anomalyco#173) (anomalyco#207) * fix: resolve multiple reported issues (anomalyco#205, anomalyco#182, anomalyco#188, anomalyco#172, anomalyco#173) - fix(observe.sh): replace triple-quote JSON parsing with stdin pipe to prevent ~49% parse failures on payloads with quotes/backslashes/unicode - fix(hooks.json): correct matcher syntax to use simple tool name regexes instead of unsupported logical expressions; move command/path filtering into hook scripts; use exit code 2 for blocking hooks - fix(skills): quote YAML descriptions containing colons in 3 skill files and add missing frontmatter to 2 skill files for Codex CLI compatibility - feat(rules): add paths: filters to all 15 language-specific rule files so they only load when working on matching file types - fix(agents): align model fields with CONTRIBUTING.md recommendations (opus for planner/architect, sonnet for reviewers/workers, haiku for doc-updater) * ci: use AgentShield GitHub Action instead of npx Switch from npx ecc-agentshield to uses: affaan-m/agentshield@v1 for proper GitHub Action demo and marketplace visibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with opencode