Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2316069f-7c08-4416-b0e3-0a7a77763112
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 18
docs/site/content/docs/cli/overview.mdxdocs/site/content/docs/cli/reference.mdxskill-guides/orca-cli.mdsrc/cli/bundled-skill-guides.tssrc/cli/handler-group-manifest.tssrc/cli/handlers/worktree.tssrc/cli/index.test.tssrc/cli/root-help-text-primary.tssrc/cli/root-help-text-secondary.tssrc/cli/specs/core.tssrc/cli/specs/terminal-close.tssrc/main/runtime/orca-runtime-tests/worktree-wake.spec.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/rpc/methods/worktree-sleep-wake-methods.test.tssrc/main/runtime/rpc/methods/worktree-sleep-wake-methods.tssrc/main/runtime/rpc/methods/worktree.tssrc/main/runtime/workspaces/managed-workspace-operations.tssrc/main/runtime/workspaces/workspace-activation.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
@coderabbitai review |
|
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
ca72504 to
de5dfe8
Compare
ELI5
When Agent sleep puts an idle agent to sleep, a script can only bring it back by making Orca show that workspace, which yanks you away from whatever you were looking at. Orca can already wake sleeping agents quietly in the background, but only when a phone asks. This PR lets the CLI ask too:
orca worktree wakewakes them without touching your screen, andorca worktree sleepis the matching Sleep action.What Changed
orca file open … --focusororca terminal switch, and the desktop jumped to that workspace. There was no CLI for Sleep either, although aworktree.sleepRPC existed.orca worktree wake --worktree <selector> [--json]resumes the workspace's slept agents in hidden panes: those a workspace sleep left running, and those Agent sleep hibernated. The desktop keeps showing what it showed. The command returns once the wake is queued, behind any sleep still running. The result'ssleepingAgentWakeisrequested,not-applicable, orunsupported-headless(the slept agents only a desktop window can wake, and headlessorca servehas none).orca worktree sleep --worktree <selector> [--json]runs the workspace Sleep action through the existingworktree.sleepRPC. It returns once the sleep finished, fails when a terminal stop cannot be proven, and prints a warning when a chat stop or the VM suspend could not be confirmed.queueSleepingAgentWake+phoneWakeReport, which main now runs since feat(sidebar): main runs workspace sleep; the window follows (P3b) #31564) moves into a small runtime layer,OrcaRuntimeWithWakeManagedWorktreeinworkspaces/workspace-wake.ts, aswakeSleepingAgents(repo, worktreeId). Mobile activation calls it exactly as before.worktree.wakeRPC (permission: 'workspace',WorktreeSelectorparams) calls the same helper for any caller throughwakeManagedWorktree. It reads the sleeping records of the repo's execution host, so SSH-host workspaces are covered.worktree.sleepis upstream's method, unchanged. It is grouped withworktree.wakeinworktree-sleep-wake-methods.ts(and the CLI handlers inhandlers/worktree-sleep-wake.ts), which keepsrpc/methods/worktree.tsandcli/handlers/worktree.tsunder the line limit.'requested' | 'unsupported-headless' | 'not-applicable'union is namedSleepingAgentWakeReportinshared/workspace-sleep.tsnext tophoneWakeReport.restoreOnTabOpenOnly) still resume only when their tab is opened ([Bug]: Interrupted agent sessions are never auto-hibernated, and manual workspace sleep silently discards them on wake #11598). The help text and docs say so.Why
I drive agents in Orca workspaces from a chat bot. Each task gets a workspace, and follow-ups are sent with
orca terminal send. Every follow-up to a slept agent stole my Orca window.Alternatives I tried or considered:
--focus/terminal switch: these work, but steal the user's view.terminal close --tab(which drops its sleep record), then startclaude --resume <id>withterminal create. This also works without focus, but the caller must know the provider and session id, it replaces the user's tab, and it cannot handle an agent that shares a split tab.worktree.activate: activation also hydrates mobile session surfaces and has mobile-specific semantics. A dedicated wake call is smaller and clearer.Reusing the existing background wake means no new wake logic. The only new surface is who may call it.
Linked Issue
Fixes #30831
Visual Proof
N/A — CLI and RPC only. The desktop view is deliberately left unchanged, and no UI was modified.
Testing
Added:
src/main/runtime/orca-runtime-tests/worktree-wake.spec.ts(run throughorca-runtime.test.ts):requested, the queued wake reachesresumeSleepingAgents,activateWorktreenot calledunsupported-headlessrequestedssh:session partition is readsrc/main/runtime/rpc/methods/worktree-sleep-wake-methods.test.ts:clientKind) reacheswakeManagedWorktree, not activationsrc/cli/index.test.ts:worktree sleep/worktree wakecallworktree.sleep/worktree.wakewith the resolved selector.Ran locally on macOS (arm64), Node 24.22, pnpm 12.14, Bun 1.4.3, rebased on
mainat d667e54:oxlinton the changed files,audit:anti-slop,audit:code-quality:native,check:max-lines-ratchet,check:dead-classes,verify:rpc-params-catalogandverify:bundled-skill-guidespass.pnpm typecheck:nodeandpnpm typecheck:clipass.vitest run src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc src/cli: 7560 passed, 2 failed.sets up an existing folder on a fresh runtime after importing the repo project,keeps existing-folder imports split by runtime host on the same normalized path) fail identically on unmodifiedmain./var→/private/varrealpath inrepository-project-operations.spec.ts.Not run locally: the full
pnpm lintandpnpm test,pnpm build, and a manual run of a built app.AI Disclosure
Implemented with Claude Code using Claude Opus 5.5 (
claude-opus-5-5): investigation, code, tests and this description, with human direction and review.Review
AI review summary:
getRepoExecutionHostId), so SSH-host worktrees are covered.workspacemethod. It is not added to the phone allowlist, since the mobile app keeps using activation.worktree.activatestill gates the wake onclientKind === 'mobile'and returns the samesleepingAgentWakevalues.workspacepermission, the same asworktree.sleep/worktree.activate. No new data is exposed.Agent skill upstream boundary
Notes
worktree.wakeis a new optional RPC. Older hosts reject it as an unknown method; no existing params or results changed.not-deliveredresult is gone: the wake is now queued in main, so whether the window received it is not known when the call returns, and the CLI reports the same values a phone gets.skill-guides/orca-cli.md(and the regeneratedbundled-skill-guides.ts),docs/site/.../cli/reference.mdxandoverview.mdx, the root help, and theterminal closenote all now nameworktree sleep/worktree wake.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — changed-file lint, the related audits and typecheck pass locally; targeted tests pass apart from the two pre-existing macOS path failures above; fullpnpm lint,pnpm testandpnpm buildleft to CI