Skip to content

fix(bots): name signed-out servers and wait for fresh connector state - #45929

Merged
AmethystLiang merged 6 commits into
mainfrom
AmethystLiang/fix-issue-45278
Nov 20, 2026
Merged

AmethystLiang merged 6 commits into
mainfrom
AmethystLiang/fix-issue-45278

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A bot running on a headless server needs that server signed in to Orca Cloud before Slack, GitHub, Linear or webhooks can reach it. The bot's messages now name the server and point to orca auth login there or Sign in on in its Connectors tab. Chat cards wait for fresh host reads before saying the bot can continue.

Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1441 $\color{#cf222e}{\Huge{\mathbf{−}}}$​50 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1391
Prod 33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1010 $\color{#cf222e}{\Huge{\mathbf{−}}}$​276 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​734

What Changed

  • Carry the headless server's hostname through bot connector offers, trigger options, event-rule refusals, webhook setup and failed result delivery. Signed-out and rejected sign-ins give the owner the server's own sign-in steps, including --switch when needed.
  • Require a verified, reachable server, a completed account read and a fresh successful connector read before showing Signed in / Continue. Reads from before a reconnect cannot establish readiness.
  • Wait for this computer's connector read after sign-in before automatically replying to the bot. Any sign-in change during that read invalidates the reply, including signing out and back into the same account.
  • Show why server sign-in cannot start: an older server, an unread account, a build without Cloud sign-in, or unavailable credential storage. Keep setup failures routed to the account that actually failed.
  • Keep sign-in reasons and paused notices current when the interface language changes, even while the same offer stays open.
  • Document the server's existing orca auth login and orca auth status commands.

Relative to #45727, setup dialogs retain its distinction between this computer's account and the server's account. This change also checks fresh account and connector state after a card has been answered, uses a Paused status pill with the host notice, and keeps the Orca Cloud wording in sign-in messages.

Why

Desktop sign-in does not sign in a paired server. Reusing the server's existing sign-in flow makes that distinction actionable; checking current host state prevents a previous successful connection from making the card look ready after it stops working.

Linked Issue

Fixes #45278

Visual Proof

The local sign-in lines keep their appearance: the same 640 px Slack-event and webhook fixtures are byte-identical before and after, in light and dark themes. The changed readiness behavior is covered by the account-switch and reconnect tests.

Slack-event line, before:

Slack-event sign-in line before

Slack-event line, after:

Slack-event sign-in line after

Webhook line, before:

Webhook sign-in line before

Webhook line, after:

Webhook sign-in line after

Testing

  • All 293 affected tests pass across 28 files, split into CLI/shared (55), main-process (133) and renderer (105) batches with at most two workers.
  • All 42 connector-card tests pass with React Compiler enabled. The four new cases keep the same offer while the translator changes; replacing the reactive inputs with the stable module translator makes all four fail with the previous language still displayed.
  • The account-switch regression remains covered: an in-flight sign-in change cannot reuse an earlier account’s successful link read for the automatic reply decision.
  • ORCA_BACKGROUND_LAUNCH=1 ORCA_REACT_COMPILER=1 timeout 900 pnpm check:changed --base=c0473a170198 --maxWorkers=2 passes all 41 selected checks, including formatting, lint, four typecheck targets, affected tests and repository ratchets.
  • The existing eight headless component captures cover the local Slack-event and webhook sign-in lines at 640 px in light and dark themes, with no page errors. The before/after captures are byte-identical.
  • Executed locally on macOS. No live paired-server sign-in or Windows session was exercised in this validation.

Performance by reasoning

Freshness maps update in constant time per host read; notifying subscribers scales with the mounted views. Opening a sign-in card and completing a sign-in request fresh reads through the existing refresh path, which coalesces requests per host and limits concurrent paired reads to four. The sign-in watcher unsubscribes after the read and synchronous reply decision, including failure paths. Passing the translator changes render dependencies and adds no host reads. No polling loop, additional process or periodic timer is introduced.

Risk

Level: Medium. The main risk is a sign-in card staying unavailable when a host read fails or a paired server is too old. Those states retain the host's explanation or recovery action instead of claiming readiness. The optional hostname field remains compatible with older peers. No persisted-data migration or platform-specific command launching is added; the existing host sign-in and credential-storage paths remain in use. Reverting the change restores the previous messages and readiness checks.

Notes

Follow-ups #45338, #45339, #45340, #45341 and #45342 remain deferred with owner approval.

Agent skill upstream boundary

  • This change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments or documentation.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change adds host identity and Orca Cloud sign-in status to runtime, CLI, connector, and renderer flows. Headless-server messages include server-specific login instructions. Connector actions check both signed-out and needs-sign-in states. Renderer sign-in offers account for host verification, account state, connector status, and fresh host reads. Host read tracking ignores stale responses after disconnects and stream recovery. The remote-server guide and auth notes document sign-in steps.

Severity of issue fixed: Medium

Merge Risk: Low · up to 3e904

The sign-in and read-freshness changes look sound. Remaining gaps are minor: some connected cards can show Connected without explaining a down link, and one Chinese string still uses the old wording. These can be fixed before or shortly after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: bot connector setup now names a signed-out headless server, and readiness waits for fresh connector state. It is specific and matches the changeset and objectives. It …
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #45278), Visual Proof with before/after images, Testing with validation steps, Risk with a lev…
Linked Issues check Passed The only directly linked issue, #45278, is closed and completed. Under the assessment rules, it supplies background only. No active directly linked targets remain, so no linked-issue coding requiremen…
Out of Scope Changes check Passed With no active linked-issue requirements, scope was judged against the current PR description. The described intent covers server-named sign-in messages, host-specific sign-in instructions, fresh conn…
Full details: Title check

Explanation

The title names the main change: bot connector setup now names a signed-out headless server, and readiness waits for fresh connector state. It is specific and matches the changeset and objectives. It is slightly long but clear.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #45278), Visual Proof with before/after images, Testing with validation steps, Risk with a level and revert path, AI Disclosure, and the upstream boundary checkbox. The Testing checklist boxes are unchecked even though testing is described, and the template's Review and Notes sections are partly filled. The Testing section also reports macOS only. These are minor gaps. The Performance section is an extra section not in the template.

Full details: Linked Issues check

Explanation

The only directly linked issue, #45278, is closed and completed. Under the assessment rules, it supplies background only. No active directly linked targets remain, so no linked-issue coding requirements apply. The PR description's objectives and the raw summary were not treated as issue requirements.

Full details: Out of Scope Changes check

Explanation

With no active linked-issue requirements, scope was judged against the current PR description. The described intent covers server-named sign-in messages, host-specific sign-in instructions, fresh connector and account read gating, sign-in and paused notice copy, and documentation of existing orca auth commands. The raw summary's changed files map to that intent: CLI and shared trigger-option and connector-offer text, main-process bot run results and connector-act refusals, runtime bots.list hostname reporting, webhook sign-in reporting, renderer link-read freshness and sign-in offer components, locale strings, related tests, and the remote-servers guide. The optional hostname field and the freshness tracking support the stated readiness behavior. No change was found that is unconnected to the stated purpose. This conclusion relies on the AI-generated summary and the PR description; no focused repository inspection was made, so the per-file mapping is not independently verified against the diff.

  • 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.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Additional comments: 1

src/renderer/src/components/native-chat/NativeChatConnectorOfferCard.test.tsx: 1

63-69: Trivial · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Make the sign-in race tests wait for a specific read.

The mock runs whileReading for every refresh, but the card can start a read from both its effect and its sign-in callback. Waiting one timer turn does not identify which read observed the auth change or prove that the automatic reply path finished.

Use a deferred result for the targeted request. Wait for that request to start, apply the auth change, then complete the request before checking chat.send. Keep the successful no-change case as a control.

Review info

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: 74a239d9-cd7d-47e4-8e64-d39da40a6bac
Commits

Reviewing files that changed from the base of the PR and between 6e3c83a and 3e904be.

Files selected for processing: 46

  • docs/site/content/docs/remote-servers.mdx
  • src/cli/automations/automation-event-trigger-spec.test.ts
  • src/cli/automations/automation-event-trigger-spec.ts
  • src/cli/automations/automation-event-triggers-cli.ts
  • src/cli/bots/bot.ts
  • src/cli/specs/auth.ts
  • src/main/bots/bot-run-results.test.ts
  • src/main/bots/bot-run-results.ts
  • src/main/bots/orca-sign-in-server.ts
  • src/main/runtime/rpc/methods/bots-connector-offer.ts
  • src/main/runtime/rpc/methods/bots-google-setup.ts
  • src/main/runtime/rpc/methods/bots.test.ts
  • src/main/runtime/rpc/methods/bots.ts
  • src/main/runtime/rpc/methods/connector-act.test.ts
  • src/main/runtime/rpc/methods/connector-act.ts
  • src/main/runtime/workspaces/persisted-surfaces/webhook-operations.ts
  • src/main/webhooks/automation-webhook-saves.ts
  • src/main/webhooks/webhook-host-service.ts
  • src/renderer/src/components/bots/BotConnectorsHostNotice.test.tsx
  • src/renderer/src/components/bots/BotConnectorsHostNotice.tsx
  • src/renderer/src/components/bots/BotHostSignInButton.tsx
  • src/renderer/src/components/bots/bot-host-copy.ts
  • src/renderer/src/components/bots/bot-host-sign-in-from-here.tsx
  • src/renderer/src/components/bots/github/BotGitHubSetupDialog.server-sign-in.test.tsx
  • src/renderer/src/components/bots/github/bot-github-copy.ts
  • src/renderer/src/components/bots/linear/bot-linear-copy.ts
  • src/renderer/src/components/bots/orca-cloud-signed-out.ts
  • src/renderer/src/components/bots/slack/BotSlackCard.test.tsx
  • src/renderer/src/components/bots/slack/BotSlackSetupDialog.paired.test.tsx
  • src/renderer/src/components/bots/slack/bot-slack-copy.ts
  • src/renderer/src/components/native-chat/NativeChatConnectorOfferCard.test.tsx
  • src/renderer/src/components/native-chat/NativeChatConnectorOfferCard.tsx
  • src/renderer/src/components/native-chat/NativeChatSignInOffer.tsx
  • src/renderer/src/hooks/ipc-events/runtime-events/runtime-client-ipc-bridge.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/bot-host-link-read.ts
  • src/renderer/src/lib/bot-host-listing.test.ts
  • src/renderer/src/lib/bot-host-listing.ts
  • src/renderer/src/lib/bot-host-orca-account.ts
  • src/renderer/src/lib/bot-host-refresh.ts
  • src/shared/bot-event-sources.test.ts
  • src/shared/bot-event-sources.ts
  • src/shared/bots/bot-connector-offer.test.ts
  • src/shared/bots/bot-connector-offer.ts
  • src/shared/bots/host-orca-sign-in.test.ts
  • src/shared/bots/host-orca-sign-in.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

return translate('bots.slack.errors.notInstalled', 'Add this bot to Slack first.')
case 'signed_out':
return translate('bots.slack.errors.signedOut', 'Sign in to Orca to connect Slack.')
return translate('bots.slack.errors.signedOut', 'Sign in to Orca Cloud to connect Slack.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Update the Chinese bots.slack.errors.signedOut entry to name Orca Cloud.

The English catalog now says "Sign in to Orca Cloud to connect Slack." The Chinese catalog still has the key bots.slack.errors.signedOut set to 登录 Orca 以连接 Slack。, which names Orca, not Orca Cloud. Chinese-language users therefore see the old wording for this signed_out error. Change the Chinese value to name Orca Cloud, following the English wording.

const noticed = state !== null && state.kind !== 'update-needed'
const linkDown = connector !== undefined && connector !== 'ok'
const pause =
host === null ? undefined : noticed ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Do not hide a down server link when the host label is null.

ServerOffer skips the pause whenever useBotHostLabel returns null. The hook returns null for every server bot in a paired web window (isPairedWebClientWindow()), so the gate is not limited to loading or recovery. In that window, a server bot whose connector is not 'ok', such as refused, gets no pause. OfferCard then shows Connected with no explanation. The same gate also hides the server's sign-in notice in that window.

A connected source whose server link is down must not read as connected. Change the pause logic so that the label does not decide whether the link-down state or notice is shown. Confirm that BotConnectorsHostNotice and the not-reaching line render without a host label before removing the gate.

Comment on lines +219 to +221
needsSignIn ? (
<OrcaCloudSignInLine text={orcaCloudSignInReason(props.offer.source)} />
) : undefined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Show a link-down pause on connected desktop source cards.

When this computer is signed in and its connector reads refused or unreachable, the connected card for any source still shows Connected. Nothing on the card says that events cannot reach the bot. LocalOffer pauses only for signed-out and needs-sign-in, and OfferCard does not read link state. The server card and the desktop sign-in card already explain these states. The connected desktop card does not.

This gap predates this PR. The base OfferCard pauses only for signed-out.

Keep the sign-in action for signed-out and needs-sign-in. Add a separate link-down pause for refused and unreachable. That pause should not offer a sign-in action. Keep Connected when the link reads ok. The existing notReaching text can serve as the pause copy.

@AmethystLiang
AmethystLiang merged commit b4a1c7e into main Nov 20, 2026
70 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Signed-out messages on a headless Orca server don't point to orca auth login, so bot connectors look connected but never wake

1 participant