You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(bots): re-authenticate a server that is still signed in - #45488
When a paired server's Orca sign-in lapses but the account is still signed in on that server, the desktop Sign <server> in again starts a normal sign-in. The server refuses it with "This server is already signed in. Use Switch account to change it." From that server's shell, orca auth login --switch succeeds.
Change
startBotHostSignIn sends switchAccount: true when the host's last account read is signed-in. A signed-out host, and a host whose session is reconnect-required, still starts a plain sign-in.
Verification
Renderer unit test src/renderer/src/lib/bot-host-orca-account.test.ts.
Before the change: 1 failed, 2 passed (the still-signed-in case sent switchAccount: false). Start at 20:27:21.
After the change: 3 passed. Start at 20:28:05.
oxfmt on the two changed files finished in 7ms.
Limits
The desktop was not opened against a paired server, so the approval page and the server's stored session were not exercised here. A host whose account status has not been read yet still starts a plain sign-in.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 789bf425-be8d-4dc6-9773-f7f1576ab16f
Commits
Reviewing files that changed from the base of the PR and between 8efe603 and 986dd4b.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
startBotHostSignIn now sets switchAccount based on the cached host account status. The new tests cover signed-in, signed-out, and reconnect-required states, and verify that each sign-in request sets approveInBrowser to true.
Severity of issue fixed: Medium
Merge Risk: Low · previous review 8efe6
Sign-in for a paired server that is still signed in now uses the account-switch path, which fixes the reported refusal. In a narrow case where the cached account status is out of date, the plain sign-in can still be refused. This is the same behavior as before the change, so the risk is low.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a fix that re-authenticates a server whose account is still signed in. It matches the raw summary, which says startBotHostSignIn now sends switchAccount: true for a si…
Description check
The description follows the template well. It covers the problem and the mechanism, which is the switchAccount change for signed-in hosts. It records the before and after test results and the untested…
Linked Issues check
Issue #45339 asks for a supported desktop re-authentication flow when a paired server's Orca sign-in has lapsed but the account is still signed in locally. At the reviewed head, startBotHostSignIn i…
Out of Scope Changes check
The PR changes two files: the startBotHostSignIn function and its doc comment in bot-host-orca-account.ts, and the new renderer test file bot-host-orca-account.test.ts. The code change is limited to…
Full details: Title check
Explanation
The title names the main change: a fix that re-authenticates a server whose account is still signed in. It matches the raw summary, which says startBotHostSignIn now sends switchAccount: true for a signed-in host. The title is specific and concise, and it follows the conventional commit style.
Full details: Description check
Explanation
The description follows the template well. It covers the problem and the mechanism, which is the switchAccount change for signed-in hosts. It records the before and after test results and the untested limits. It links issue #45339 with Fixes #45339. It explains the reason for the change. It does not complete several template sections: ELI5, the user-facing before and after, the Visual Proof section (required for behavior changes, with no before and after media or N/A reason), the Risk level, the Testing checkboxes, and the Review and Agent skill sections. These are gaps, but the core content is present.
Full details: Linked Issues check
Explanation
Issue #45339 asks for a supported desktop re-authentication flow when a paired server's Orca sign-in has lapsed but the account is still signed in locally. At the reviewed head, startBotHostSignIn in src/renderer/src/lib/bot-host-orca-account.ts sets switchAccount = entry.status?.state === 'signed-in' and passes it to orcaAccount.signIn.start with approveInBrowser: true. A signed-in host therefore sends the same switch request that orca auth login --switch sends. Signed-out, reconnect-required, and not-yet-read hosts send switchAccount: false, as the PR states. The renderer unit test in src/renderer/src/lib/bot-host-orca-account.test.ts reports 3 passing after the change, and the PR description reports 1 failing before it. The server-side acceptance of the switch and the approval page were not exercised end to end, so that part rests on the PR's stated behavior and the issue's report of the CLI behavior. No non-coding requirement remains in the linked issue.
Full details: Out of Scope Changes check
Explanation
The PR changes two files: the startBotHostSignIn function and its doc comment in bot-host-orca-account.ts, and the new renderer test file bot-host-orca-account.test.ts. The code change is limited to deriving switchAccount from the cached account status. The test covers the signed-in, signed-out, and reconnect-required cases. The change does not alter other sign-in flow logic, exported declarations, or unrelated modules. Both files connect directly to the issue objective. The diff could not be read through the repository tool because the changed blobs were missing from the checkout, so the scope judgment relies on the head file content and the PR summary.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Read the host's sign-in before choosing the intent.
switchAccount uses the cached status. The notice shows the sign-in button for a cached signed-out or reconnect-required status, and the button stays enabled while a refresh runs. If the server becomes signed in before the next read, the click sends switchAccount: false. The server then refuses it with "This server is already signed in. Use Switch account to change it." The failed view shows that error, and no refresh runs after it.
The intent must reflect a current read of the server's sign-in. Choose the exact approach, such as awaiting refreshBotHostOrcaAccount before the RPC or refreshing after a refusal, from the behavior the product requires.
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
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.
Problem
When a paired server's Orca sign-in lapses but the account is still signed in on that server, the desktop Sign <server> in again starts a normal sign-in. The server refuses it with "This server is already signed in. Use Switch account to change it." From that server's shell,
orca auth login --switchsucceeds.Change
startBotHostSignInsendsswitchAccount: truewhen the host's last account read issigned-in. A signed-out host, and a host whose session isreconnect-required, still starts a plain sign-in.Verification
Renderer unit test
src/renderer/src/lib/bot-host-orca-account.test.ts.Before the change: 1 failed, 2 passed (the still-signed-in case sent
switchAccount: false). Start at 20:27:21.After the change: 3 passed. Start at 20:28:05.
oxfmt on the two changed files finished in 7ms.
Limits
The desktop was not opened against a paired server, so the approval page and the server's stored session were not exercised here. A host whose account status has not been read yet still starts a plain sign-in.
Fixes #45339