Repository navigation
Conversation
… agent A tab title that names another agent only in task text (free-text evidence) no longer replaces a known launch/completed-hook identity. Only anchored or vendor-marker titles can reclaim a reused pane. The tab bar now calls the tested resolveTabAgentFromSignals instead of a drifted local copy, which also brings the OMP/Pi (stablyai#15713) and stale sleeping-session (stablyai#21714) fixes to the tab icon. Part of stablyai#26513 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UBp6T3vnmFFtQXXSyqTYhK
… identity A "⠋ Codex" title names Codex only in free text, so it no longer reclaims a completed claude identity. Update the pi-identity expectation to match, and drop comments that repeated the regression test's own fixture names. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe signal resolver now requires strong title evidence before a differing, incompatible title can reclaim a pane. The hook imports the resolver helpers from a shared module. Tests cover mention-only and anchored Codex titles, including how they affect existing Claude identities. Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The change is mergeable after normal checks; the identified mixed-title icon mismatch predates this PR. 🚥 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 have @brennanb2025 review it to see if this is what he has in mind |
ELI5
Claude Code names its terminal after the conversation. If the conversation is about Codex, the tab used to show the Codex icon even though Claude Code was running. Now the tab keeps the Claude icon, because a name that only shows up in the topic text is not a reliable sign of which agent is running.
What Changed
Before: in a Claude Code pane titled
◑ Tab title showing Codex instead of Claude Code, the tab bar showed the Codex icon whenever no live hook or foreground-process signal was present (between turns, before a hook reaches the renderer, remote panes).After: the same pane keeps the Claude icon. A genuine identity title (for example
Task - codex) still reclaims a reused pane.Mechanism:
resolveTabAgentFromSignalsonly lets a title replace a known identity (finished hook or launch record) whencollectAgentTitleEvidencereportsanchoredorvendor-marker. A name that appears only in free text no longer counts (src/renderer/src/lib/tab-agent-from-signals.ts). The check runs last in the condition, so it only costs anything when the other reuse conditions already hold.resolveTabAgentFromSignalsandresolveLaunchedAgentExitEvidenceinuse-tab-agent.ts. I deleted it, so the tab bar now calls the same tested function as the tests andopen-tab-occupant-agent. That copy had drifted: it never received the OMP/Pi fix (fix(agents): keep OMP identity and forward ask/approval events #15713), the stale sleeping-session fix after/exit(fix(terminal): clear stale agent identity after shell exit #21714), or the Git Bash prompt-title handling (fix(sidebar): an agent's row stays while it runs, whatever its tab title #23948).use-tab-agent-pi-identity.test.tsexpected a finished Claude pane whose title became⠋ Codexto flip tocodex. That title names Codex only in free text, so it now keepsclaude(see Notes).Why
The issue's principle is that the title is decoration: it may fill an empty slot or replace a stale signal only with strong evidence, and a name in task text never overrides anything. Removing the duplicate first means the fix lands in the function the tab bar really uses, instead of fixing only the tested copy.
PRs 2-4 of the plan (one title parser, one ranking, host-owned identity) are larger refactors with their own corpus and wire-compatibility checks. I kept them out so this one stays small and reviewable.
Linked Issue
Part of #26513 (PR 1 of the proposed plan)
Visual Proof
No screenshot captured. The tab icon is driven by
resolveTabAgentFromSignals, and the new pure-function tests reproduce the bug (red, three cases returncodex) and show the fix (green,claude). Before/after tab-bar screenshots can be attached here by the author if reviewers want them.Testing
Run on Windows.
bunwas not installed, so I usedpnpm test:node, which runs the same Vitest suites on Node.New regression tests (
src/renderer/src/lib/tab-agent-title-free-text-override.test.ts), before the fix:After the fix: all 8 pass. Other checks:
src/renderer/src/lib/results are in the Notes section.Full
pnpm lintandpnpm build, every step covered except where noted:The full
pnpm testdid not finish in a reasonable time on this machine; the unrelated Windows failures it printed are in files this PR does not touch. CI will cover these.AI Disclosure
Claude Code was used. Claude Opus 5.5 did the investigation, orchestration and review. Claude Sonnet 5.5 did the implementation and tests. Claude Haiku 5.5 did the initial issue triage and the follow-up test-expectation commit. I reviewed the changes.
Author
GitHub: @ryuki12
X (Twitter): https://x.com/nocode_teraji
Review
src/renderer/src/lib); no shared/host/main changes.collectAgentTitleEvidenceis called per resolve but short-circuited behind the other reuse conditions, so it only runs when a title names a different agent than the known owner.Agent skill upstream boundary
Notes
use-tab-agent-pi-identity.test.ts(renamed to "keeps the completed identity over a free-text Codex title on mount") used to expect a finished Claude pane reused by a hookless Codex titled⠋ Codexto switch tocodex.collectAgentTitleEvidence('⠋ Codex')isfree-text-only, so under the issue's principle it no longer replaces a known identity. Codex's foreground process (local) or its hook still switches the icon. Bare-name titles like this are the gap the issue assigns to PR 2.Fix Codex bug - grokthe evidence isanchoredforgrokbut the older parser answerscodex, so a reuse override would still pickcodex. Unifying the parsers (PR 2) removes this mismatch.siblingHookAgent: 'claude'the focused slot is empty, so the title still fills it (codex). That is the empty-slot rule, which this PR does not change. I left it out of the tests instead of weakening the rule. It fits PR 2/3.src/renderer/src/lib/results: the only failure, before and after this change, ispalette-match-performance(a timing budget that varies by machine). All 14 tab-agent test files (155 tests) pass. The decision-table test (tab-agent-identity-decision-table.test.ts) passes with its disagreement counts unchanged.getAgentLabelordering, the✳/./*handling,resolveCanonicalPaneAgentIdentity,uncoveredFallback, and host identity publishing (PR 2-4).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code