Repository navigation
Send review notes to any running agent of a worktree - #5654
Conversation
…otes menu The "Send notes" menu only reached the focused terminal pane, so a worktree running several agents could receive review notes on just one of them. The menu now lists every running agent of the worktree and routes the send to the one you pick. - Enumerate worktree agents in the dropdown (ReviewNotesSendMenuContent) instead of the single "Active agent session" item, falling back to that item when no agent has reported status yet. - Generalize sendNotesToActiveAgentSession with an explicit note target so a specific pane can be addressed; routing still resolves the worktree's owner host, keeping SSH/remote sends correct. - Surface agents before their first hook event via TerminalTab.launchAgent, gated on a recognized agent title so a still-booting pane is only offered once the runtime would accept the send (avoids "not a recognized agent session"). - Share agentKindForAgentType for telemetry parity; extract resolveRuntimePaneTitleForLeaf and reuse it for the focused-pane hint.
…e targets - notes-send-agent-targets: status-backed + launch-agent enumeration, title gate, per-tab dedup, and missing-pty/non-terminal-leaf skips. - runtime-pane-title-leaf-id: pane-title-to-leaf resolution across leaf and split layouts, including the sparse background-title case. - active-agent-note-send: explicit note target routes to a non-focused pane and reports no-active-terminal when the target is absent from the runtime list. - ReviewNotesSendMenuContent: enumerates agents, sends to the chosen one with the right target, disables working agents, and falls back to the active session.
|
Ready to review this PR? Stage has broken it down into 8 individual chapters for you: Chapters generated by Stage for commit 1d8136f on Jun 18, 2026 6:53pm UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR extends notes-sending to target any running agent session, not just the focused terminal. A new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
@brennanb2025 will review this PR! The tricky part is what if there are many open sessions, can the UI handle it well :-D |
Make sense! However, regarding the general idea of workflow, I believe that in day-to-day work, a developer tends to have a maximum of 3, because one might be working on a task while another is doing an analysis related to that worktree. |
Co-authored-by: Orca <[email protected]>
Brennan validation follow-upVerdict: I ran the brennan-yolo-lite follow-up for the clean review-notes send menu direction: named existing agent sessions plus New agent options only, with no visible What changed after review
Delegated review flow
ValidationElectron was launched from the exact PR worktree on CDP port
Test target: Diff-to-test matrix:
Commands run
Final local sanity before push:
Evidence and cleanupScreenshot evidence was captured locally under ignored
Console/log inspection found 0 console errors. Cleanup completed: demo diff comments cleared, validation PTYs stopped, Playwright closed, and only the Electron process started for validation was stopped; port Residual caveat: the real Codex PTY launched and was idle, but its renderer agent-status hook did not populate automatically in the temp profile. I manually seeded renderer status for that confirmed real Codex PTY so the changed menu could enumerate it; the actual send still used Orca runtime validation and delivered to the real Codex process. |
…unning-agent # Conflicts: # src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
Co-authored-by: Orca <[email protected]>
|
Thanks for this! Appreciate the PR! |
* upstream/main: (220 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # mobile/src/terminal/TerminalWebView.tsx # mobile/src/terminal/terminal-webview-text-zoom.test.ts
* upstream/main: (78 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # mobile/app/h/[hostId]/session/[worktreeId].tsx # mobile/src/terminal/TerminalWebView.tsx # mobile/src/terminal/terminal-webview-html.ts
* upstream/main: (220 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # src/renderer/src/i18n/locales/en.json # src/renderer/src/i18n/locales/es.json # src/renderer/src/i18n/locales/ja.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
* upstream/main: (341 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # src/main/text-generation/commit-message-text-generation.test.ts # src/main/text-generation/commit-message-text-generation.ts
Co-authored-by: Orca <[email protected]> Co-authored-by: brennanb2025 <[email protected]>
Summary
When you review a worktree's diff and write notes, the "Send notes" menu used to reach only the focused terminal pane. So if two or three agents were running in that worktree, the notes went to whichever one happened to be focused, and there was no way to pick a different one.
This change lists every running agent of the worktree in the menu, and the note goes to the one you click. It also shows agents that Orca launched but that haven't reported their first hook event yet, so a freshly opened agent is selectable right away instead of only after you talk to it. That early listing waits for a recognized agent title, which is the same signal the runtime checks before it accepts a send, so a still-booting pane shows up only once the send will actually land instead of failing with "not a recognized agent session" when clicked.
Screenshots
The menu now lists each running agent of the worktree (here, two Claude sessions) above the "New agent" launchers:
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildpnpm typecheckpasses on all three projects. The new tests and the tests for every touched module pass. I could not get a clean fullpnpm lint/pnpm test/pnpm buildon this machine: oxlint runs out of memory locally, and the full suite has pre-existing platform tests (WSL detection on macOS) that fail in this environment and are unrelated to this change. I did run oxlint per changed file and the localization catalog check, both clean. CI should cover the rest.AI Review Report
I reviewed this with a multi-agent pass and a focused diff reviewer. What I had them check: SSH/remote correctness, telemetry parity with the existing sidebar send, marking notes delivered exactly once, and how working or stale agents are treated.
What came out of it:
Cross-platform: this is renderer-only. It adds no keyboard shortcuts, no path handling, and no shell behavior, so macOS, Linux, and Windows are unaffected by anything new here. Remote and SSH worktrees keep working because delivery is routed by the worktree's owner host, not the focused runtime.
Security Audit
Notes are delivered as text through the existing
terminal.sendRPC, with Enter. Before submitting, the runtime confirms the target is a running agent and waits for the TUI to be idle, so notes cannot be pressed into a plain shell or a non-agent process. The renderer-side eligibility check is advisory only; the runtime on the owner host has the final say.No command execution, no new path handling, no secrets, and no new dependencies. The change reuses the existing terminal RPC surface rather than adding IPC. Nothing outstanding.
Notes
Known limitation: an agent you start by hand (typing the CLI in a plain terminal, with no launch marker) and haven't interacted with yet shows up only after its first hook event. Agents Orca launched appear right away.