Skip to content

fix(cli): report workspace and terminal navigation as requests, not as a changed screen - #52219

Merged
AmethystLiang merged 10 commits into
mainfrom
AmethystLiang/bot-open-claim-truthful
Nov 29, 2026
Merged

AmethystLiang merged 10 commits into
mainfrom
AmethystLiang/bot-open-claim-truthful

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A bot said "I opened the workspace in Orca", but the person's screen did not change. The command it ran printed Activated <workspace>, when all it had done was ask the Orca window on the bot's own computer to switch. Now these commands say what they asked for and where, and bots are told not to claim that a screen changed.

What Changed

orca worktree activate (was Activated <id>). The host now reports hostWindow (requested, unavailable or none), and the CLI prints one of these lines:

  • Asked the Orca window on <computer> to open <id>.
  • No Orca window is open on <computer>; nothing was opened.
  • Could not reach the Orca window on <computer>; nothing was opened.
  • Asked <computer> to open <id>. (an older host that does not report hostWindow)

<computer> is this computer, the environment name, or the paired computer.

orca terminal switch / terminal focus:

  • Before, it printed Focused terminal ... even when the window refused the send.
  • Now it prints Requested focus for terminal <handle>. or Focus request for terminal <handle> was not confirmed.
  • navigated is true only when the window send returned true, or when a live terminal reveal got an answer.

Help, root help and the bundled CLI guide now describe activate and switch as requests rather than switches. They also state that --environment asks the server's window first and asks this machine's desktop app only if the server answers without confirming.

The bot rules gain one line: worktree activate and terminal switch only ask an Orca window; never say you opened something on your owner's screen.

Why

A send only means the request reached that host's window process. It says nothing about the screen a person is looking at, such as a paired client, a phone or Slack. Taking someone to a workspace on their own device needs a different mechanism and is tracked separately. Checked against how comparable products handle this.

Linked Issue

N/A: internal report.

Visual Proof

N/A: CLI output, help and bot prompt text only. The exact strings are listed above.

Testing

I ran these tests with vitest --maxWorkers=1. Each one asserts an outcome, and I checked that each fails when its fix is reverted.

  • worktree-activate.test.ts: the computer named and the outcome branch for every hostWindow outcome, locally and remotely, including a blank ORCA_ENVIRONMENT beside a pairing code.
  • workspace-activation-host-window.test.ts: hostWindow for send results true, false and none, with and without a window, and with no notifier.
  • runtime-window-navigation-outcome.test.ts: the real window notifier through the RPC, covering a sent and a refused workspace request, a headless host, and a refused terminal focus.
  • focus-terminal-send-outcome.test.ts: a focus send that returns true, false or nothing, and a live reveal that is answered or unanswered.

I also ran changed-file lint and format, the bundled skill guide check, and the node and CLI typechecks.

  • I manually tested these changes locally (not checked in a running Orca window, see Risk)
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Performance

None. The only added work runs once per worktree activate or terminal switch call, which a person or agent triggers explicitly.

  • Runtime: activation keeps the boolean its existing send returns. On a failed send it makes one constant-time hasAuthoritativeWindow() lookup. Terminal focus compares the send result it already had.
  • Nothing else: no new I/O, IPC, subscriptions, timers or polling. Nothing scales with the number of workspaces, terminals or paired devices.
  • Bot rules: the preamble gains one short line per bot turn.
  • Basis: this is reasoned from the diff and its callers; no timing was measured.

Risk

Level: Low

  • Changed output: scripts that match Activated or Focused terminal need updating. The JSON output only gains the optional hostWindow field.
  • Undefined send results: a notifier that returns nothing now gives navigated: false. The production window notifier always answers, so this affects only test or third-party notifiers.
  • Refused live terminal reveal: as before, it fails the RPC with no local-desktop fallback.
  • Verification: I have not checked this in a running Orca window; unit and RPC-level tests only.
  • Back out: a plain revert.

AI Disclosure

Review

Agent skill upstream boundary

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

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Cross-platform: string and boolean changes only; the bot rule uses the existing per-platform CLI name.
  • Remote and paired hosts: covered by the computer names and the older-host line.
  • Mobile: paired-client navigation is unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred). Locally I ran targeted tests, changed-file lint and the node and CLI typechecks; CI covers the full suites.

The activation line now says no other screen changes, since a recipe VM can still wake. Help calls activation a request to the host window. The bot rule falls back to the full workspace list for idle, archived and paired-server workspaces, and folds the mechanism into its prohibition. Terminal focus no longer reports navigated when the window refused the send. A test drives the real window notifier through the RPC dispatcher for both commands.
…outcomes

The bot rule now forbids terminal switch beside its terminal focus alias, and the switch help no longer invites it for taking someone to a terminal from a chat. A blank ORCA_ENVIRONMENT beside a pairing code now reads as the paired computer instead of an empty name. A runtime contract test covers every host window outcome for each send result, and activation that does not target the host.
…ent guide

Activation and terminal focus output say the host requested or submitted the change, never that a window received it or switched. terminal switch help and the bundled CLI guide describe host-first navigation with a local desktop fallback only when the server did not show the terminal, and tell agents not to use it to take someone somewhere from a chat. The bot rule no longer promises a lookup that covers every workspace: past the recent list, it asks which computer.
terminal.focus now reports navigated only when the host's focusTerminal send returns true, matching workspace activation, so a notifier that reports nothing is not a confirmed navigation. The CLI line for an unconfirmed focus says the request did not go through and lists the possible reasons instead of calling it superseded or skipped. The hint for a hidden new terminal points at terminal switch as a request.

Tests cover the focus send outcomes, the live terminal reveal answering and refusing, a window with no notifier, the clients and all navigation modes, and a paired caller that names no navigation.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge, with a non-blocking gap in the bot's navigation guidance.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking gap in the bot's navigation guidance.

Findings

  1. P2 Bots lose chat navigation guidance ▶

Summary

This PR reports workspace and terminal navigation as requests rather than completed screen changes.

  • Workspace activation reports what the host window was asked to do.
  • Terminal focus reports navigation only when the window confirms it.
  • Help and bot guidance describe navigation as a request to an Orca window.

Reviews (4) · Last reviewed commit: "Shorten navigation output, help, guide a..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The runtime now reports whether host-window activation and terminal-focus requests were confirmed. The worktree activation CLI formats its output using the reported host-window status and local or remote context. CLI help, skill guides, and bot instructions describe navigation as a request rather than a guaranteed screen change. Tests cover accepted, refused, and unavailable window outcomes.

Merge Risk: Low · up to 13689

Bot guidance now says navigation commands only request a window, but the "take me to" workflow the PR describes is not in the prompt. Bots may attempt navigation without confirming the computer. This is low risk and can be fixed with a small prompt edit or by correcting the PR description.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: CLI workspace and terminal navigation outcomes are reported as requests to a window, not as a changed screen. The changeset matches this: worktree activate and termina…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely and covers the core sections: ELI5, What Changed (with exact CLI output strings before and after), Why, Testing (with named test files and the a…
Full details: Title check

Explanation

The title names the main change: CLI workspace and terminal navigation outcomes are reported as requests to a window, not as a changed screen. The changeset matches this: worktree activate and terminal focus/switch now report request outcomes, with hostWindow status and truthful messages.

Full details: Description check

Explanation

The description follows the repository template closely and covers the core sections: ELI5, What Changed (with exact CLI output strings before and after), Why, Testing (with named test files and the author's checkboxes), Performance (with a concrete one-line justification and reasoning), Risk (level Low, changed output, undefined send results, and a back-out plan), Notes, and Checklist. The Visual Proof section is marked N/A with a reason, which the template allows for CLI-output-only changes. The Linked Issue section is marked N/A: internal report, but the template says outside contributors must link an issue. The author appears to be a maintainer, so the special-case rule applies and this is acceptable. The AI Disclosure section is empty. The template says to leave it blank for stablyai team members, so this is acceptable if the author is internal. The 'pnpm lint, typecheck, test, and build' checklist item is unchecked, but the author explains that targeted checks ran locally and CI covers the full suites. The 'manually tested' box is unchecked and the author explains why.

  • 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: 1

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: e3f02a61-8aec-4c18-be3b-dd3ef4cc7649
Commits

Reviewing files that changed from the base of the PR and between ca2f6c1 and f6aa1d0.

Files selected for processing: 18

  • skill-guides/orca-cli.md
  • src/cli/discovery/root-help-text-primary.ts
  • src/cli/skills/bundled-skill-guides.ts
  • src/cli/specs/core.ts
  • src/cli/terminals/paired-terminal-desktop-reveal.ts
  • src/cli/terminals/terminal-format.ts
  • src/cli/workspaces/worktree-activate.test.ts
  • src/cli/workspaces/worktree-activate.ts
  • src/main/bots/bot-preamble.ts
  • src/main/runtime/client/events/runtime-notifier-contract.ts
  • src/main/runtime/terminal/focus/focus-terminal-send-outcome.test.ts
  • src/main/runtime/terminal/focus/focus-terminal.ts
  • src/main/runtime/terminal/launch/terminal-presentation.ts
  • src/main/runtime/workspaces/startup/runtime-workspace-navigation.ts
  • src/main/runtime/workspaces/startup/workspace-activation-host-window.test.ts
  • src/main/runtime/workspaces/startup/workspace-activation.ts
  • src/main/window/runtime-window-lifecycle.ts
  • src/main/window/runtime-window-navigation-outcome.test.ts

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

Comment thread src/main/bots/bot-preamble.ts Resolved

@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: 2

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: 6fb53dd4-93de-48ed-8746-2fe7f9b79fa1
Commits

Reviewing files that changed from the base of the PR and between f6aa1d0 and 5bc952c.

Files selected for processing: 1

  • src/main/bots/bot-preamble.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.

Comment thread src/main/bots/bot-preamble.ts Resolved
`- Bringing over a bot your owner had in another app (Orca's first message says they made you to take one over, or they ask later): \`${BOT_ORCA_CLI} skills get orca-cli --reference bot-import\` first, every time.`,
`- Projects: \`${BOT_ORCA_CLI} repo list\`. Code work: a worker (see Rules).`,
`- Your owner's workspaces, what each agent there was last asked and said, and which bot each is under: \`${BOT_ORCA_CLI} worktree ps --since 7d\`. To take one over when your owner hands it to you or agrees to your offer, move it under your home and ask its agent where it stands: "Take over a workspace" in \`${BOT_ORCA_CLI} skills get orca-cli --reference bots\`.`,
`- \`${BOT_ORCA_CLI} worktree activate\` and \`${BOT_ORCA_CLI} terminal switch\` only ask an Orca window; never say you opened something on your owner's screen.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Bots lose chat navigation guidance

The shorter rule drops the instruction not to use worktree activate, terminal switch, or terminal focus for “take me to” requests. A bot answering through Slack or mobile can now use these commands even though they target the host window, not the owner's device. Keep the no-navigation rule and the fallback that tells the owner which computer and workspace to open, as described in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is intentional. The rule was cut to the one claim that caused the bug: these commands only ask an Orca window, and the bot must never say it opened something on its owner's screen. Running them is not harmful in itself; claiming that the owner's screen changed was the problem, and the rule still forbids that. Taking someone to a workspace on their own device needs a product mechanism, which is tracked separately rather than solved in prompt text here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That makes sense. I was treating use of the host-window request for a “take me to” request as the issue, but your point is that the harmful behavior was claiming the owner’s screen changed. The revised rule addresses that directly, and navigation on the owner’s device belongs to the separate product mechanism. I’ll withdraw this finding.

@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: 1

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: dfac147a-af3f-431b-a771-3bf052587e42
Commits

Reviewing files that changed from the base of the PR and between 5bc952c and 136895b.

Files selected for processing: 9

  • skill-guides/orca-cli.md
  • src/cli/discovery/root-help-text-primary.ts
  • src/cli/skills/bundled-skill-guides.ts
  • src/cli/specs/core.ts
  • src/cli/terminals/terminal-format.ts
  • src/cli/workspaces/worktree-activate.test.ts
  • src/cli/workspaces/worktree-activate.ts
  • src/main/bots/bot-preamble.ts
  • src/main/runtime/terminal/launch/terminal-presentation.ts
Files skipped from review as they are similar to previous changes: 5

  • src/cli/discovery/root-help-text-primary.ts
  • src/cli/specs/core.ts
  • src/cli/terminals/terminal-format.ts
  • src/cli/workspaces/worktree-activate.ts
  • src/main/runtime/terminal/launch/terminal-presentation.ts

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

Comment thread src/main/bots/bot-preamble.ts Resolved
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.

1 participant