Repository navigation
feat(cli): read and message agent chats with orca chat list/read/send - #33115
YangNuoCheng wants to merge 9 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
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:
3f8bb6ad-5764-4e21-a4f9-bee9fd2dac14
Files selected for processing: 11-
docs/site/content/docs/cli/reference.mdxskill-guides/orca-cli.mdsrc/cli/bundled-skill-guides.tssrc/cli/chat-sessions.tssrc/cli/handler-group-manifest.tssrc/cli/handlers/chat.test.tssrc/cli/handlers/chat.tssrc/cli/root-help-text-primary.tssrc/cli/specs/chat.tssrc/cli/specs/index.tssrc/main/startup/cli-command-names.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.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Page backward when filtering leaves the requested limit unfilled. · chat.ts:67
src/cli/handlers/chat.ts:67
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPage backward when filtering leaves the requested limit unfilled.
For
orca chat read --limit 100, the handler fetches only the newest 200 journal rows. If more than 100 of those rows are provider status frames, turn markers, or other omitted rows, the command returns fewer than 100 entries even when older readable entries exist. The history page exposeshasOlderand an older cursor, but this handler never uses them.Suggested fix
const result = await client.call<HistoryResult>('agentSession.history', { sessionId: session, direction: 'tail', limit: Math.min(limit * HISTORY_ROWS_PER_ENTRY, MAX_HISTORY_ROWS) }) + let page = result.result.page + let entries = chatTranscript(page.items) + while (entries.length < limit && page.hasOlder && page.window.oldest) { + const cursor = page.window.oldest + const older = await client.call<HistoryResult>('agentSession.history', { + sessionId: session, + direction: 'before', + cursor, + limit: MAX_HISTORY_ROWS + }) + const olderPage = older.result.page + if ( + olderPage.window.oldest?.epoch === cursor.epoch && + olderPage.window.oldest?.sequence === cursor.sequence + ) { + break + } + entries = [...chatTranscript(olderPage.items), ...entries] + page = olderPage + } printResult( { ...result, - result: { session, entries: chatTranscript(result.result.page.items).slice(-limit) } + result: { session, entries: entries.slice(-limit) } },

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:
5cad02cc-95f6-426c-9c19-4781577a5b98
Files selected for processing: 3-
skill-guides/orca-cli.mdsrc/cli/bundled-skill-guides.tssrc/cli/handlers/chat.ts
Files skipped from review as they are similar to previous changes: 2-
- skill-guides/orca-cli.md
- src/cli/handlers/chat.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.
-
|
Addressed in 096ae84: |
|
Fixed in 096ae84: |
There was a problem hiding this comment.
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:
3034c6c0-6243-462e-9aeb-51154753e82c
Files selected for processing: 2-
src/cli/handlers/chat.test.tssrc/cli/handlers/chat.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.
-
|
Thanks for the catch — fixed in 9e66b4b.
|
|
Hi maintainers, gentle ping on this one. I have been using |
|
Pushed a merge of current Verified on a clean checkout of the branch ( |
# Conflicts: # skill-guides/orca-cli.md # src/cli/bundled-skill-guides.ts
|
Thanks. I am leaving the docstring-coverage warning unchanged: |
|
Cross-linking #37407 — opened as an umbrella issue for super-agent workflows, where this external monitor/control surface is the entry point. |
|
Thanks for this, @YangNuoCheng. It had fallen behind main and needed rebasing, so we carried it over in #40836 with your commit kept as the first one. It also adds |
Carried over from #33115 (squashed onto current main; conflicts with chat rename resolved).
…read/send/wait (#40836) * feat(cli): read and message agent chats with orca chat list/read/send Carried over from #33115 (squashed onto current main; conflicts with chat rename resolved). * feat(cli): wait for a chat to settle, read text from stdin, refuse paired hosts chat send --wait and chat wait poll the history's working flag until the chat is idle or waits on a question, keeping a queued message pending until it runs. chat read is one history fetch and returns a cursor. Unattached and paired-host refusals say what they mean. * fix(cli): settle a held queued message, skip subagent rows, resolve chat list --worktree * fix(cli): show chat errors, keep waiting through queue handoffs, return the whole settled turn * fix(cli): settle any queued message the host will not send, show grouped questions and only answerable prompts * test(cli): drive chat tests through a real client and fake timers * fix(cli): describe chat --session, --wait and --state in command help * fix(cli): report chat wait in chat list's states, reject unknown --state, flag truncated reads * docs(cli): say chat wait settles on the chat's own turn; no truncated flag on held * fix(cli): chat rename help asks for a session id, not a handle --------- Co-authored-by: YangNuoCheng <[email protected]>
|
Closing in favour of #40836, which is merged now. It carries your commit with you as the author, plus a trim and |
ELI5
Managing coding agents by voice through another assistant (Grok Bot, Muse, and similar personal agents on the same machine) is becoming a normal way to work: you ask from your phone what your agents are doing and tell them what to do next. Orca's chat agents, the default, cannot be reached this way today. This PR adds the missing CLI surface so any local assistant can read and message them.
Orca agents usually run as chats. Scripts and other assistants could read and type into terminal agents with
orca terminal, but had no way to read a chat or send it a message. This addsorca chat list,orca chat readandorca chat send.What Changed
Before:
orca worktree psshowed that a chat wasworkingand its last reply, and nothing more; the CLI had no way to read the conversation or message it.After:
Mechanism (CLI only, no host changes):
chat listprojects the top-level chat rows ofworktree.ps(session, workspace, agent, state, title, last reply). Terminal agents and subagents are left out.chat readcallsagentSession.history(tail) and returns messages, tool calls, and approvals/questions, marking ones stillpending. Provider status frames and turn markers are dropped;--limitcounts the entries shown, so the read fetches more journal rows than it displays.chat sendreads the chat's fence fromagentSession.history, then sends through the sharedstructuredAgentSessionMessageSendMutation/structuredAgentSessionSendBodywith an id fromcreateStructuredAgentSessionOperationId, the same path the mobile client uses. It addsdelivery: 'queue-if-active'only when the host advertisesagent-session.queued-messages.v1, so a working agent gets the message after its turn instead of mid-turn. A host refusal is raised as an error with the host's code; it is never reported as sent.--sessionaccepts the session id fromchat list, the handleagent launchreturns, or a pane key.CLI_COMMAND_NAMES, the CLI reference docs, and the bundledorca-cliguide (regenerated). The guide also tells an outside assistant relaying for a user to confirm an instruction with the user beforechat send.Why
Voice is handled by assistants that already do it well (Grok Bot's voice mode, for example), so Orca does not need to build or maintain speech, a phone client, or spoken summaries. Three CLI commands over existing RPC methods are enough for any of them to drive Orca. Fixes the use case in the linked issue: the user talks by voice (from a phone) to a personal assistant agent running on the same machine, such as Grok Bot or a similar assistant, which reports what the Orca agents are doing and relays the user's instructions to them. Most agents are chats. The runtime already exposes
agentSession.historyandagentSession.sendwithworkspacepermission, so this only adds the CLI surface and reuses the shared envelope and fingerprint code instead of re-implementing it. Approvals and cancel are left for a follow-up to keep this change small.Linked Issue
Fixes #33114
Visual Proof
N/A: CLI-only change with no UI. Output against a running Orca 1.4.238 desktop host:
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
src/cli/handlers/chat.test.ts(9 tests): selector parsing;listexcludes terminal agents and subagents and filters by state;readkeeps messages, tools and pending approvals and drops status frames, and returns the newest N entries;sendproduces params that pass the host's ownSendParamsschema with the fence it read, usesqueue-if-activeonly when advertised, raises a host refusal as an error, and rejects empty text before any call.Manual on macOS against Orca 1.4.238:
list,readandsendon a live Codex chat; the chat replied to each sent message, including a send while idle and through an external assistant driving the CLI.pnpm lint,pnpm tc,pnpm verify:bundled-skill-guidesandpnpm build:electron-vitepass. Vitest oversrc/cli,src/main/startupandsrc/shared: 18853 passed; one run had a single failure ingit-branch-cleanup-real-git.test.ts(real git, unrelated), which passes 7/7 when rerun alone.Linux, Windows and SSH not tested manually. The commands are platform-neutral RPC calls; for a paired host,
--environment/--pairing-coderoute the same calls.AI Disclosure
Implemented with an AI coding agent (Claude, claude-opus-5-5) under my direction; I reviewed the change and ran the manual tests.
Review
Agent skill upstream boundary
Notes
Security: no new RPC methods or permissions;
chat senduses the existingworkspace-permissionagentSession.sendwith its fence and fingerprint checks. Backwards compatibility: hosts without the message queue receive an ordinary send; a host without a history fence is refused withincompatible_runtimebefore sending. Performance: oneworktree.pscall forlist, two calls forsend.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)