fix: resume provider setup after successful ByteRover OAuth login#466
Merged
bao-byterover merged 1 commit intocampfirein:mainfrom Apr 21, 2026
Merged
Conversation
After a successful OAuth login, the provider flow always returned the user to the provider selection list, instead of resuming the in-progress ByteRover setup. The login callback succeeded and isAuthorized flipped to true, but the post-login state transition discarded the previously selected provider. Extract a pure derivePostLoginAction helper (mirrors the deriveAppViewMode pattern) that decides the next transition: connect+activate ByteRover when authorized, return to selection with an error otherwise. Wire it into handleLoginComplete so the connect/activate path now runs automatically. Closes campfirein#464
bao-byterover
approved these changes
Apr 21, 2026
Collaborator
bao-byterover
left a comment
There was a problem hiding this comment.
Thanks @AmElmo , will merge and ship in next release.
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
Fixes #464.
After a successful ByteRover OAuth login, the provider flow always returned the user to the provider selection list, instead of resuming the in-progress ByteRover setup. The OAuth callback succeeded and
isAuthorizedflipped totrue, but the post-login state transition discarded the previously selected provider — so the user had to re-select ByteRover from the list to actually finish setup.This PR makes the CLI auto-continue with the connect/activate flow once login succeeds, matching the standard pattern in
gh auth login,vercel login,supabase login, etc.Approach
derivePostLoginAction(src/tui/features/provider/utils/derive-post-login-action.ts) — discriminated-union return type encoding the three transitions (connect ByteRover, return to selection with error, return to selection). Mirrors the existingderiveAppViewModepattern in the onboarding feature.derive-app-view-mode.test.ts.provider-flow.tsx—handleLoginCompletenow delegates to the helper and runs the sameconnect → setActive → onCompletesequence used inhandleSelectfor fresh ByteRover connections.The duplicated connect/activate sequence between
handleSelectandhandleLoginCompleteis intentional in this PR — kept the diff narrow. Happy to extract a shared helper if you'd prefer.Test plan
npm run lint— 0 errors (1 pre-existing warning onprovider-flow.tsxcomplexity, unchanged by this diff)npm run typecheck— cleannpm run build— cleannpm test— 6424 passing, 0 failing (incl. 5 new tests forderivePostLoginAction)Closes #464