fix(cli): auth login now asks for api key in handlePluginAuth#21641
Merged
rekram1-node merged 2 commits intoanomalyco:devfrom Apr 13, 2026
Merged
fix(cli): auth login now asks for api key in handlePluginAuth#21641rekram1-node merged 2 commits intoanomalyco:devfrom
rekram1-node merged 2 commits intoanomalyco:devfrom
Conversation
alexyaroshuk
pushed a commit
to alexyaroshuk/opencode
that referenced
this pull request
Apr 13, 2026
…yco#21641) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
mrsimpson
pushed a commit
to mrsimpson/opencode
that referenced
this pull request
Apr 14, 2026
…yco#21641) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
6 tasks
sdeonvacation
pushed a commit
to sdeonvacation/opencode
that referenced
this pull request
Apr 14, 2026
…yco#21641) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
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 #21637
Type of change
What does this PR do?
This PR fixes a plugin-specific CLI auth bug where login could exit early after handlePluginAuth() succeeded, which meant the normal API key prompt never ran.
For providers using plugin auth with an API method, that created inconsistent behavior between the TUI and CLI:
the flow could authorize successfully without collecting or saving the key unless the plugin returned it itself. The change fixes that by explicitly prompting for the API key inside handlePluginAuth() and saving the entered value when authorize() does not provide one.
How did you verify your code works?
Ran it again with my fixes and the now
It prompts for the api key correctly.
Screenshots / recordings
582109BB-9993-438F-8EB9-638F0E4C9CE2.Copy.mov
Checklist