Repository navigation
fix(sidebar): attribute spinner-only pane titles to the launched agent - #9647
AmethystLiang merged 2 commits into
Conversation
A braille-spinner terminal title proves activity but carries no agent identity, so the title-derived sidebar row resolver dropped it. Agents without working status hooks — Codex over SSH (stablyai#8711) — only ever emit spinner+cwd titles, so their worktrees showed no agent row at all while Claude (hook-backed) rows appeared. Fall back to the tab's launch identity (tab.launchAgent) for spinner-only titles, mirroring the precedence the hook-row path already uses. Explicit title identity still wins, Claude-specific prefixes (✳ / '. ' / '* ') are unaffected, and panes without launch metadata keep the existing no-row behavior.
8e2059b to
1adc8e0
Compare
📝 WalkthroughWalkthroughUpdated title-derived sidebar agent rows to fall back to the launched agent when runtime titles contain only a spinner. Explicit identities in runtime titles continue to take precedence. Added tests covering fallback attribution, explicit identity handling, and spinner-only titles without an available identity. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
|
thanks for the PR! will review it soon |
…ane residual Adds a regression test asserting a spinner-only title with no tab launch identity produces no row, pinning the `launchAgent ?? null` gate that the two existing tests do not exercise. Expands the fallback comment to record why it is spinner-gated (vs the hook path's unconditional launchAgent fallback) and the split-pane braille-title residual. Co-authored-by: Orca <[email protected]>
AmethystLiang
left a comment
There was a problem hiding this comment.
Reviewed via multi-agent code review. Correct, well-scoped fix that makes the title-derived sidebar path consistent with the hook path's existing launchAgent fallback. Added a guard test (spinner-only + no launchAgent -> no row) and comments recording the spinner-gating rationale and split-pane residual. Tests/lint/typecheck green.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts (1)
146-159: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winTreat
unknownas an unresolved title identity.
resolveTitleDerivedAgentTypeexplicitly returns'unknown'for unmapped labels, but the nullish check treats that string as resolved. Consequently, spinner-only titles may never fall back totab.launchAgent, and titles without launch metadata can still produce a generic row. Use a resolved-type check that excludes'unknown'for bothagentTypeandrowLabel.Suggested fix
const titleAgentType = isClaudeAgentsTitle ? 'claude' : resolveTitleDerivedAgentType(title, label) + const hasResolvedTitleAgentType = titleAgentType !== null && titleAgentType !== 'unknown' const agentType = - titleAgentType ?? (containsBrailleSpinner(title) ? (args.tab.launchAgent ?? null) : null) + (hasResolvedTitleAgentType ? titleAgentType : null) ?? + (containsBrailleSpinner(title) ? (args.tab.launchAgent ?? null) : null) if (!agentType) { return null } - const rowLabel = titleAgentType ? label : formatAgentTypeLabel(agentType) + const rowLabel = hasResolvedTitleAgentType ? label : formatAgentTypeLabel(agentType)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b510ca15-5ed2-4bdd-aeb9-eb20ea72845e
📒 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
The workspace status dot only trusted a title-derived `working`/`permission`
when the title itself named a provider, or when a spinner glyph was paired
with `tab.launchAgent`. Claude Code's busy OSC title is a status frame plus
its own generated session summary, and that summary names Claude only by
accident — so `◐ Claude status missing from to-do workspaces` spun the dot
while `◐ Orca automatic session title renaming`, the identical pane one turn
later, fell through to the quiet emerald `active` dot, the same glyph as
`done`. `tab.launchAgent` could not rescue it: it is cleared when an agent
exits and persists as `null`, so a long-lived pane, a restored session, or a
`claude` typed into a plain terminal has no launch identity at all.
`orca worktree ps` and mobile already report `working` for those panes — they
run `detectAgentStatusFromTitle` with no attribution gate — so the desktop
sidebar was the only surface calling a busy Claude idle.
Feed the gate the process-table identity Orca already keeps. The
`paneForegroundAgentByPaneKey` slice exists for exactly this case ("covers
agents that emit neither hooks nor titles"), is read at OSC 133 command
boundaries and when a pane's PTY becomes visible, and is pane-scoped, so it
survives a restart and does not let one pane brand its sibling in a split.
When a pane's foreground process is a recognized agent, ownership is settled
and the title only has to carry the activity.
The `stablyai#9647` guard still holds: a spinner in a pane with no agent process and
no launch identity cannot spin the dot, and a dead PTY still reads inactive.
The tab-bar dot runs the same resolver and gets the same fix.
Co-authored-by: Claude Opus 5 <[email protected]>
stablyai#9647) * fix(sidebar): attribute spinner-only pane titles to the launched agent A braille-spinner terminal title proves activity but carries no agent identity, so the title-derived sidebar row resolver dropped it. Agents without working status hooks — Codex over SSH (stablyai#8711) — only ever emit spinner+cwd titles, so their worktrees showed no agent row at all while Claude (hook-backed) rows appeared. Fall back to the tab's launch identity (tab.launchAgent) for spinner-only titles, mirroring the precedence the hook-row path already uses. Explicit title identity still wins, Claude-specific prefixes (✳ / '. ' / '* ') are unaffected, and panes without launch metadata keep the existing no-row behavior. * test(sidebar): pin spinner fallback no-launchAgent gate; note split-pane residual Adds a regression test asserting a spinner-only title with no tab launch identity produces no row, pinning the `launchAgent ?? null` gate that the two existing tests do not exercise. Expands the fallback comment to record why it is spinner-gated (vs the hook path's unconditional launchAgent fallback) and the split-pane braille-title residual. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Jinjing <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
Fixes #9646.
On SSH hosts, a worktree with a working Codex session showed no sidebar agent activity row at all, while Claude worktrees on the same host showed theirs. All three identity signals fail for Codex over SSH: its OSC titles are spinner + cwd with no agent name, its status hooks are dead remotely (#8711), and the foreground-process fallback only scans the local process table.
The title-derived sidebar fallback (
worktree-title-derived-agent-rows.ts) classified the spinner title as working but then dropped the row, becauseresolveTitleDerivedAgentTypecorrectly refuses to attribute a bare braille spinner to Claude (CLAUDE_AGENT_TOKEN_REgate). The tab already knows who it launched —tab.launchAgentis stamped by the agent launcher andworktree create --agent, and survives the remote path — but this was the one sidebar path that never consulted it.Fix: when the title resolver yields no identity and the title carries a braille spinner, fall back to
tab.launchAgentfor the row's agent type (and label it withformatAgentTypeLabel). This mirrors the precedence the hook-row path (resolveRowAgentTypeinworktree-agent-rows.ts) already gives launch identity.Scope guards, all preserved by existing tests:
⠋ Codexstays Codex regardless oflaunchAgent).✳/". "/"* ") contain no braille spinner, so they are not rescued — "does not turn generic Codex-launched task titles into Claude Code rows" stays green.seenPaneKeys; once Codex status hooks are dead in SSH worktrees — CODEX_HOME is injected only by the local PTY provider, whileorca agent hooks statusstill reportscodex: installed#8711 lands, the authoritative hook path simply covers these panes first.Screenshots
Verified live: dev build connected to an SSH host, workspace created with
worktree create --agent codex, Codex mid-task. Renderer state at capture time:tab.launchAgent === 'codex',agentStatusByPaneKeyempty (no hooks, #8711), pane title⠸ <repo-name>(no identity token).Counter-check observed in the same session: when Codex went idle (title back to the bare repo name, no spinner), the row disappeared — idle panes without identity keep the existing no-row behavior.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildNew tests in
worktree-title-derived-agent-rows.test.ts:⠼ demo-repo→ exactly one row['codex', 'working', 'Codex', '⠼ demo-repo']. Confirmed red before the fix (no row) and green after.⠋ Codextitle stays a Codex row (pins the precedence).Full suite: 30,679 tests pass.
AI Review Report
Reviewed by Claude (Fable 5, author).
launchAgent: 'codex'on the tab, an emptyagentStatusByPaneKey, and a spinner-only pane title — exactly the state the row builder drops today.launchAgentis tab-scoped, so a second split pane in an agent-launched tab whose process emits a braille-spinner title would be attributed to the launched agent. This mirrors the existing tab-scoped use oflaunchAgentin the hook-row path; spinner-titled non-agent processes are rare (most CLIs don't set OSC titles).codexin a plain terminal have nolaunchAgent; their identity lives in pane-connection-localcommandInferredAgent, which the sidebar cannot reach today. That belongs to the pane-owner-resolver slice deliberately deferred inpane-agent-evidence.ts.Security Audit
No new input handling, IPC, auth, command execution, or path handling. The change reads two existing renderer-state fields (
tab.launchAgent, the already-scraped pane title) to pick a display label and icon. No secrets or logging affected.Notes
orca agent hooks statusstill reportscodex: installed#8711 (assigned) remains the root-cause fix for the hooks signal and will bring full status detail (current tool, task text). This change only stops the sidebar from being completely blind in the meantime, and yields to hook rows the moment they exist.cannot_repro): remote panes where the only signal is an anonymous spinner title.