Skip to content

fix(sidebar): let an agent row show the provider's own session title - #19936

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/agent-row-vault-title
Sep 11, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/agent-row-vault-title

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​172 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​171
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20

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:

customTitle → quickCommandLabel → OpenCode live → [aiVaultTitle] → generatedTitle → sanitized live title

getAgentRowConversationName had zero references to aiVaultTitle, while resolveUnifiedTabLabel has 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 aiVaultTitle added to the ConversationNameTab pick.

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. conversationNameFromLiveTitle runs isCwdLikeTitle, 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 like auth/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/login case that is nulled today.

Testing

  • Typecheck: tc:node, tc:cli, tc:web all 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 across src/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 no aiVaultTitle to 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

  • Not applicable.

Notes

  • Security / cross-platform / SSH / mobile: no new I/O, no paths, no processes. The title is resolved by the execution host that owns the session, unchanged by this PR.
  • Performance: one optional-chain read and a trim() on a path that already performed several.
  • Backwards compatibility: additive tier; no field, wire shape or stored value changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test pass locally

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.
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e19cedbc-a6d7-49b1-9a37-5193d8cd3c9a

📥 Commits

Reviewing files that changed from the base of the PR and between 97391c0 and 98c9167.

📒 Files selected for processing (3)
  • src/renderer/src/components/dashboard/build-dashboard-snapshot.rows-cache.test.ts
  • src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d5d3b479-f7a0-4ee4-af4f-2e24234b6f37

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1ceb4 and 97391c0.

📒 Files selected for processing (6)
  • src/renderer/src/components/dashboard/dashboard-card-labels.test.ts
  • src/renderer/src/components/dashboard/dashboard-card-labels.ts
  • src/renderer/src/components/dashboard/use-agent-row-conversation-name.test.ts
  • src/renderer/src/components/dashboard/use-agent-row-conversation-name.ts
  • src/shared/agent-row-conversation-name.test.ts
  • src/shared/agent-row-conversation-name.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

getAgentRowConversationName now matches AI Vault titles to both the row's agent and provider session. Dashboard label and hook callers pass the provider session ID. Tests cover precedence and split-pane ownership.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 97391

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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 addre… Add a real linked issue using the required Fixes #... format. If no visual proof is provided, write exactly N/A and briefly explain why. State whether pnpm build passed or whether CI will cover it.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: showing the provider session title in an agent row.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 N/A format.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 — inserts tab.aiVaultTitle?.title.trim() between the OpenCode live-title check and generatedTitle, and adds aiVaultTitle to the ConversationNameTab pick.
  • Tests — three new cases pin the new tier, confirm customTitle/quickCommandLabel still outrank it, and cover the auth/login cwd-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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 a providerSessionId and returns the title only when aiVaultTitle.agent === agentType and aiVaultTitle.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.ts and dashboard-card-labels.ts thread entry.providerSession?.id through.
  • Tests — new split-pane scoping cases in the hook test and a new dashboard-card-labels.test.ts pin 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 as currentTabsById.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 to currentTabsById: 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: clean on 98c9167c3fdc47550b3ec9f9a88b4791e8a6ebeb.

  • Fixed the split-pane ownership regression: a provider session title is now accepted only when both the agent and provider-session identities match, so sibling panes retain their own live titles.
  • Fixed retained-row freshness: dashboard/popout snapshots now use the current tab metadata when available, while preserving the captured tab only as the post-removal fallback. This keeps dashboard and sidebar labels in sync after a late provider-title update.
  • Iterative adversarial review and the opening/closing readiness passes found no remaining in-scope P0/P1/P2 issues. The fix stays at the shared resolver/row-construction boundaries, remains O(tabs + rows), and adds no subscriptions, polling, timers, persistence, IPC, or wire changes.
  • Focused validation: 5 files / 63 tests passed; pnpm tc:web passed; changed-code quality passed; pre-commit lint, React Doctor, and formatting passed.
  • Latest-head CI is fully green: static analysis, typecheck, macOS and Windows packaging, all 8 test shards, Verify, and Pullfrog.
  • Manual Electron validation used the intended worktree with a hidden renderer and CDP. I exercised the real Split Terminal Right action, confirmed the matching row showed Provider session title, the sibling row retained Sibling pane live title, and sidebar activation selected the correct tab. Distinct provider-session IDs and pane-local runtime titles were also verified.

split-provider-session-title.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant