Repository navigation
Conversation
… no agent frame A live agent pane with no hook status has exactly one row source: its terminal title. buildTitleDerivedAgentRow required that title to classify as agent ACTIVITY, so a pane whose owner is known but whose title carries no agent frame produced no row at all -- ownerAgentType was computed and passed in but sat behind the `!status || !label` gate and was unreachable. Codex titles its panes with the worktree name, so on Windows every live Codex pane reads as e.g. "gh-13695" or the neutral "Terminal 1". Those panes are therefore absent from the sidebar and the Agent Dashboard whenever hook status is missing -- which is exactly the state after an app restart or update, so a restored Codex tab vanishes while its PTY stays connected and writable. Fall back to the pane's known owner for both status (idle) and label, the same concession already made for Cursor's status-less native title (#10258), widened from one literal to any known owner. A shell title still wins: it is positive evidence the agent exited and left its shell, so it must not resurrect a row. Ownership stays single-leaf-scoped, so a split cannot brand a sibling pane.
📝 WalkthroughWalkthroughThe change adds owner-based fallback behavior for title-derived Codex rows. Owned panes with non-agent titles now produce idle rows with formatted agent labels. Shell titles, unowned panes, PTY-less panes, and panes owned by other split panes remain excluded. Explicit agent names retain precedence over launch metadata. Regression tests cover these cases. Merge Risk: ⚪ Minimal · up to The change keeps live owned agent panes visible without overriding agent identity derived from an informative title. No actionable merge-blocking risk remains; a minor follow-up could strengthen the precedence test by using a different launch owner. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f8a7854f-9059-4ee4-90d1-86f6d00b1c8e
📒 Files selected for processing (2)
src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.tssrc/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
| it('lets an agent-naming title win over the launch owner', () => { | ||
| const rows = buildWorktreeAgentRows({ | ||
| tabs: [makeTab('tab-1', { title: '\u280b Codex', launchAgent: 'codex' })], | ||
| entries: [], | ||
| retained: [], | ||
| ptyIdsByTabId: { 'tab-1': ['pty-codex'] }, | ||
| terminalLayoutsByTabId: { 'tab-1': makeSingleLayout(LEAF_ID_1) }, | ||
| now: 2000 | ||
| }) | ||
|
|
||
| expect(rows.map((row) => [row.agentType, row.state])).toEqual([['codex', 'working']]) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Test title precedence against a different owner.
Both the title and launchAgent are codex. An owner-first implementation still passes this test. Set launchAgent to a different agent type and retain the expected Codex row.
Proposed test change
- tabs: [makeTab('tab-1', { title: '\u280b Codex', launchAgent: 'codex' })],
+ tabs: [makeTab('tab-1', { title: '\u280b Codex', launchAgent: 'claude' })],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it('lets an agent-naming title win over the launch owner', () => { | |
| const rows = buildWorktreeAgentRows({ | |
| tabs: [makeTab('tab-1', { title: '\u280b Codex', launchAgent: 'codex' })], | |
| entries: [], | |
| retained: [], | |
| ptyIdsByTabId: { 'tab-1': ['pty-codex'] }, | |
| terminalLayoutsByTabId: { 'tab-1': makeSingleLayout(LEAF_ID_1) }, | |
| now: 2000 | |
| }) | |
| expect(rows.map((row) => [row.agentType, row.state])).toEqual([['codex', 'working']]) | |
| it('lets an agent-naming title win over the launch owner', () => { | |
| const rows = buildWorktreeAgentRows({ | |
| tabs: [makeTab('tab-1', { title: '\u280b Codex', launchAgent: 'claude' })], | |
| entries: [], | |
| retained: [], | |
| ptyIdsByTabId: { 'tab-1': ['pty-codex'] }, | |
| terminalLayoutsByTabId: { 'tab-1': makeSingleLayout(LEAF_ID_1) }, | |
| now: 2000 | |
| }) | |
| expect(rows.map((row) => [row.agentType, row.state])).toEqual([['codex', 'working']]) |
ELI5
Orca decides "is this terminal an agent?" mostly by reading the terminal's title. Codex doesn't put its name in the title on Windows — it names the pane after the worktree (
gh-13695), so Orca didn't recognise it. As soon as there was no live hook status to fall back on (right after a restart or an update), those Codex tabs simply disappeared from the sidebar and the Agent Dashboard, even though the process was still running fine. This makes Orca also trust what it already knows: which agent was launched in that pane.What Changed
buildTitleDerivedAgentRowgains an owner fallback. When the pane's title yields no agent activity, but the pane has a known owner (launchAgent) and a live PTY, the row is emitted as an idle row for that owner instead of being dropped.Guards kept deliberately tight — all covered by tests:
isShellProcess, which already handles Windows full-path titles (C:\...\pwsh.exe) and blank titles.launchAgent, no row. This path still never manufactures a row from a plain shell.tabHasLivePtygate is untouched.launchAgentis tab-scoped, soresolveTitleDerivedPaneOwneronly returns an owner for a single-leaf layout; a split pane cannot brand its sibling.No platform branching: this is a correctness fix in shared agent-identity logic, and the guards above mean macOS/Linux behaviour only changes in the same case that was broken there too.
Why
A live agent pane with no hook status has exactly one row source: its terminal title. The gate was:
ownerAgentTypewas already computed and passed into this function, but sat behind that gate and was unreachable. So a pane whose owner Orca knew for certain was still discarded.That matters because Codex's pane title on Windows carries neither an agent name nor a status glyph. Captured live on this box with
orca terminal list --json, then cross-referenced to each tab's persistedlaunchAgent: all 12 live Codex panes had titles likegh-13695,issue-13626-complete,pr-13977-best-review, or the neutralTerminal 1— every one failing the gate. Grok and Claude panes on the same box carried agent-identifying titles (... - grok,claude) and were unaffected. That 1:1 correlation is what the new tests pin.Consequence: whenever hook status is absent for a Codex pane — precisely the state after an app restart or update, before the next hook ping — the pane has no row source at all and drops out of
buildWorktreeAgentRows, which feeds both the sidebar (useWorktreeAgentRows) and the Agent Dashboard (build-dashboard-snapshot). The PTY stays connected and writable the whole time, which is the reported symptom.This is the same concession already made for Cursor's deliberately status-less native title (#10258,
isCursorAgentTitle(title) ? 'idle' : null) — "it still identifies a live pane, so the row reads idle instead of vanishing". This widens it from one hard-coded literal to any known owner.Linked Issue
Fixes #14464
Also expected to address STA-4054 (Codex agents not recognized as agents in Orca or the Agent Dashboard on Windows), which is the same root cause observed without a restart.
Visual Proof
N/A— could not capture. The Orca build on this Windows host is the packaged release with no--remote-debugging-port, so CDP inspection was unavailable, and relaunching it to attach a debugger would have destroyed 33 live PTYs belonging to other in-flight sessions on this box. The behaviour is instead pinned by unit tests asserting the exact row output (agentType,state,prompt,paneKey) for the real captured titles.Testing
Windows 11 Pro (10.0.26200),
win32 x64, platform confirmed at runtime.Evidence gathering:
orca terminal list --jsonon the live host to capture real pane titles.tabIdagainst%APPDATA%\orca\profiles\local-default\orca-data.jsonto read its persistedlaunchAgent.launchAgent: "codex", and that Grok/Claude panes carried agent-identifying titles.Automated:
worktree-title-derived-agent-rows.test.ts— 5 positive (real captured Codex titles) and 5 negative guards (shell titles, unowned pane, dead PTY, split layout, agent-naming title wins).5 failed | 25 passed; the 5 negative guards pass either way, as they should.src/renderer/src/components/sidebar+src/renderer/src/components/dashboard: 294 files, 2646 tests passed.src/renderer/src/runtime,use-tab-agent*,worktree-status-spinner-launch-agent,agent-row-primary-text): 81 files, 857 tests passed.oxlinton both changed files: clean.Not run / known-failing for unrelated reasons:
Full
pnpm typecheckwas deliberately not run (OOM risk on this host, per task constraint). Types touched are narrow:formatAgentTypeLabel(AgentType | null | undefined)andisShellProcess(string).oxfmt --checkflags the changed files, but flags untouched files in the same directory identically — the known Windows CRLF false positive, not introduced here. No formatting was rewritten, to avoid polluting the diff with line-ending churn.check:code-quality:changedfails withEINVAL spawnSync pnpm.cmdon Windows — a pre-existing harness issue; ranoxlintdirectly instead.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
isShellProcessalready normalises Windows full-path/.exetitles and POSIX basenames.isShellProcessstring check per title-derived pane, only on the path that previously returnednull.AI Disclosure
Claude Opus 4.5 (Claude Code), on a Windows host.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — scoped equivalents run locally and green; full typecheck left to CI per the OOM constraint aboveAuthor