Repository navigation
feat(core): tell users how to sign back in to OpenCode Console - #51847
Merged
Merged
Conversation
3 of 6 tasks
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
When an OpenCode Console account can no longer be used, users currently get a generic model error such as "Workspace access denied" or "Invalid credential", with no hint about what to do. This happens when:
SsoRequired), orUnauthorizedfrom Console, orinvalid_granton refresh).Now the user is told what to do, where they first see the problem:
/connect: OpenCode Console and the affected account show "Sign in required →". Enter opens the SSO page, or starts a reconnect when signed out.For SSO the stored credential stays valid, so after signing in in the browser the next prompt works without reconnecting. The last Console config and organization policy are kept while signed out. Only well-formed Console error bodies change anything; HTML pages, 5xx and network errors are ignored as before.
To support this, integrations can report a runtime
statuson a connection ({ status: "needs_auth", message, url? }, same shape as MCP's status) throughctx.integration.connection.status(...). It is kept in memory, attached to connections in the integration API, and available to both plugin APIs, so other integrations can report the same thing.How did you verify your code works?
bun run checkpackages/core/test/plugin/provider-opencode.test.tsfor SSO required (status set, config and policy kept, cleared on recovery), the model error rewrite, non-SSO 403s being ignored, a rejected refresh token, and a Console 401./connectrows.Screenshots / recordings
Checklist