Repository navigation
fix(sidebar): let an agent row show the provider's own session title - #19936
Conversation
The row resolver never read `aiVaultTitle`, so a terminal agent's tab showed the title from its transcript while its sidebar row showed the scraped live title — two names for one session. Placed at the same rank the tab strip uses.
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The naming change preserves title ownership and existing precedence behavior, with no actionable merge risk identified. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed and covers the change, rationale, testing, review notes, and checklist. However, the required Linked Issue is replaced with “N/A”, and the required build check is not addressed. The Visual Proof section also does not use the required exact ✨ Finishing Touches 💡 1📝 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.
✅ No new issues found.
Reviewed changes
This PR adds the provider's own AI Vault session title (aiVaultTitle) to the agent-row conversation-name resolver, at the same precedence tier the tab strip (resolveUnifiedTabLabel) already uses.
getAgentRowConversationName— insertstab.aiVaultTitle?.title.trim()between the OpenCode live-title check andgeneratedTitle, and addsaiVaultTitleto theConversationNameTabpick.- Tests — three new cases pin the new tier, confirm
customTitle/quickCommandLabelstill outrank it, and cover theauth/logincwd-shaped title that the live-title sanitizer would discard.
I verified the tier placement against resolveUnifiedTabLabel (src/shared/tab-title-resolution.ts:25) — the precedence customTitle → quickCommandLabel → OpenCode live → aiVaultTitle → generatedTitle → sanitized live title matches exactly. Both call sites pass a full TerminalTab, so the tier reaches the sidebar row and the dashboard card alike, and the AiVaultSessionTitle.agent type ('claude' | 'codex') plus the producer-side gate keeps non-Claude/Codex rows unchanged. The new tests pin exact values and genuinely fail if the tier is removed. Clean, additive change.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This incremental delta scopes the provider session title to its owning session, fixing the split-tab case where every pane's row would otherwise show the single tab-owned aiVaultTitle.
getAgentRowConversationName— now takes aproviderSessionIdand returns the title only whenaiVaultTitle.agent === agentTypeandaiVaultTitle.sessionId === providerSessionId, so a sibling pane in a split tab no longer inherits another session's name.- Both call sites —
use-agent-row-conversation-name.tsanddashboard-card-labels.tsthreadentry.providerSession?.idthrough. - Tests — new split-pane scoping cases in the hook test and a new
dashboard-card-labels.test.tspin exact values, including the sibling-pane fallthrough to its own live title; shared tests updated for the new argument.
I verified the === is sound end to end: writeTitle (ai-vault-tab-title-sync.ts:83) stamps aiVaultTitle.sessionId from providerSession.id, so the resolver compares the same field from the same AgentProviderSessionMetadata — no id-space mismatch. The title is produced only when a providerSession.id is proven (registerCandidate), so a row lacking a matching id falls through to its generated/live title, which is the intended behavior. Clean, additive fix.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This delta fixes the one surface the earlier commits missed: the serialized dashboard snapshot. The sidebar hook (useAgentRowConversationName) already re-resolves its liveTab, but buildDashboardSnapshot reads a retained row's tab directly through rowConversationName — and that tab was the frozen ra.tab snapshot, so its aiVaultTitle was always absent there.
buildWorktreeAgentRows— a retained row now resolves its tab ascurrentTabsById.get(ra.tab.id) ?? ra.tab, so a still-live tab refreshes the retained row with the provider title published after retention, while an orphaned tab still falls back to the retained snapshot.markSeenPaneKeyForCurrentTab—currentTabIds: Set<string>renamed tocurrentTabsById: ReadonlyMap<string, TerminalTab>; membership semantics are unchanged, and the map is reused for the retained-row lookup.- Tests — a new snapshot rows-cache case pins that the board surfaces the provider title on a retained row once the tab refreshes, and the sidebar retained-row test now asserts the orphaned-tab fallback keeps
ra.tab.
I verified the fix reaches production paths: setAiVaultTabTitle writes a new tab object and a new tabsByWorktree array, so the rows cache (cached.tabs === tabs) invalidates and retained rows recompute on a title publish. The prior commit's sessionId === providerSessionId guard already protects this new lookup from tab reuse, and resolveRowAgentType is driven by the frozen entry.agentType, so switching to the current tab does not mis-resolve agent type in the normal path. Clean, additive fix that closes the sidebar/snapshot divergence.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Review status: clean on
|


ELI5
Open a Claude or Codex agent in a terminal and look at two places: the tab, and the agent row in the left worktree sidebar. They show different names for the same session.
The tab shows the name the provider itself recorded for that conversation. The sidebar row shows whatever text the terminal happened to be printing, cleaned up by a heuristic. This makes the row read the same name the tab does.
What Changed
One tier, added to the sidebar row's resolver at exactly the rank the tab strip already uses:
getAgentRowConversationNamehad zero references toaiVaultTitle, whileresolveUnifiedTabLabelhas had that tier all along. That is the whole divergence. The data was already on the tab — the row resolver simply never looked at it.Nine production lines: the tier, and
aiVaultTitleadded to theConversationNameTabpick.Why
Two resolvers grew up separately and were never reconciled, so today a terminal Claude agent's tab reads its title out of the transcript while its row reads the scraped OSC title. Same agent, same instant, two strings.
The row's existing fallback also actively discards good names.
conversationNameFromLiveTitlerunsisCwdLikeTitle, which nulls any single token containing a slash — correct for a spinner-plus-cwd title scraped off a pty, wrong for a real session name likeauth/login. Reading the provider's recorded title never reaches that guard, because it is not a scraped title. The sanitizer keeps full authority over live titles, where it belongs.Linked Issue
N/A — falls out of the structured-chat naming work; this is the terminal-agent half of making one name serve every surface.
Visual Proof
Behaviour change is real but text-only and requires a Claude or Codex session whose transcript carries a title. To see it: open a terminal Claude agent, let it run a turn, compare the tab label with that agent's row in the left sidebar. Before: the row shows the spinner-stripped live title (or nothing, if it looks cwd-shaped). After: both read the transcript title.
I have not attached a screenshot because reproducing it needs a real provider session with a recorded title; the behaviour is pinned by tests instead, including the
auth/logincase that is nulled today.Testing
Typecheck:
tc:node,tc:cli,tc:weball clean, run sequentially.Tests: 3 new cases in
agent-row-conversation-name.test.ts(15 total in that file). Full affected suites: 10,729 passed / 0 failed acrosssrc/shared, sidebar and dashboard.Ablation: removing the tier reddens 2 of the 3 new tests; restored, all 15 pass. Guard symbol grepped back after restore.
Platforms: pure string resolution — no paths, shells, processes or platform branches.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Precedence is unchanged above this tier
A manual rename and a quick-command label still outrank the provider title, exactly as on the tab strip. Both are pinned by a test.
Which agents this actually affects
The vault title path is gated to Claude and Codex (
isAiVaultTitleAgent) and additionally requires a proven provider session id. So rows for Cursor, Gemini, Kimi, Cline and the rest are unchanged — they have noaiVaultTitleto read and fall through to today's behaviour. This PR does not widen that gate.Rows with no live tab are unchanged
A row whose tab is not present in this renderer resolves against a synthesised tab that carries no
aiVaultTitle, so it falls through exactly as it does today. Not a regression; simply out of reach until that row has a real tab.Agent skill upstream boundary
Notes
trim()on a path that already performed several.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm testpass locally