Repository navigation
fix(native-chat): name structured Codex chat tabs from their own session - #17092
brennanb2025 wants to merge 3 commits into
Conversation
Greptile SummaryThe PR extends the existing AI Vault title pipeline to structured Codex chat tabs while preserving client-owned titles across host snapshots.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/runtime/orca-runtime.ts | Projects the current structured-session provider identity into runtime tab snapshots and refreshes it when provider ownership changes. |
| src/main/ai-vault/session-title-file-reader.ts | Falls back to resolving an exact provider transcript when the title cache lacks a transcript path. |
| src/renderer/src/lib/ai-vault-tab-title-requests.ts | Adds host-aware structured-chat requests to the existing AI Vault title collection pipeline. |
| src/renderer/src/runtime/web-session-tabs-sync.ts | Mirrors structured-session identity while preserving client-owned custom and provider titles. |
| src/renderer/src/store/slices/agent-session-tab-ai-vault-title.ts | Adds the unified-tab store update path for structured-session AI Vault titles. |
| src/shared/workspace-session-schema.ts | Persists the optional provider-session identity and resolved title needed for restart restoration. |
Sequence Diagram
sequenceDiagram
participant Codex as Codex session
participant Host as Execution host
participant Client as Renderer
participant Vault as AI Vault title resolver
participant Store as Unified tab store
Codex->>Host: Prove provider thread identity
Host-->>Client: Publish structured tab snapshot
Client->>Vault: Resolve title by host, agent, and thread
Vault-->>Client: Return provider session title
Client->>Store: Set aiVaultTitle
Store-->>Client: Render resolved tab label
Note over Client,Store: customLabel remains higher precedence
Reviews (5): Last reviewed commit: "fix(native-chat): invalidate titles acro..." | Re-trigger Greptile
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughStructured agent-session tabs now publish proven provider session identifiers and refresh snapshots when identities become available or change. Renderer state persists these identifiers, execution hosts, custom labels, and AI Vault titles during tab mirroring. AI Vault synchronization now includes structured tabs and resolves missing transcript paths. Structured tab rendering uses unified title resolution. Tests cover identity propagation, title refreshes, manual labels, persistence, hydration, refresh timing, and session isolation. Merge Risk: ⚪ Minimal · up to The PR makes structured Codex chat tabs follow their provider conversation names while preserving manual names and restored state. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, solution, rationale, acceptance cases, compatibility impact, testing, and linked issue. It does not include the required Visual Proof section with screenshots or videos, and it omits several template headings and checklist items. Full details: Docstring CoverageExplanation Docstring coverage is 13.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 24 files. (2 skipped: 1 unsupported, 1 too large.)
✨ 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 |
Structured app-server chat tabs kept the generic "Codex Chat" label while an equivalent terminal-backed Codex tab picked up the name Codex writes for the thread, so several open chats were indistinguishable. Routes structured chats into the existing AI Vault tab-title pipeline rather than adding a second title source: the host publishes the session's Codex thread id (`RuntimeMobileSessionAgentTab.providerSessionId`, the head of the record's provider-handle chain) as identity only, and the renderer's existing title sync resolves the name against the host that owns the session and writes it to the same `aiVaultTitle` slot terminal Codex tabs use. Precedence, refresh cadence, remote host routing and persistence therefore come from the pipeline unchanged — a manual rename still outranks the provider name, and a generated title still does not. Absence stays unknown: the thread id is omitted until the provider proves one, a late-proven thread reaches clients through a republished snapshot, and the mirror now preserves the client-owned `customLabel` and `aiVaultTitle` it was overwriting on every snapshot, which is what made a rename vanish and would have blinked a named tab back to the generic label.
415d0d2 to
e9db810
Compare
The chat asks the provider for a title and the AI Vault scanner can read it back, but nothing displayed it: the vault title pipeline was terminal-only at both ends. A structured chat is a unified agent-session tab with no TerminalTab behind it, so it produced no title request and could not be written back to. Publish the provider conversation id as a new optional field on the agent-session tab contract, sourced from the head of the record's provider handle chain so a fork is never presented as its origin, and omitted until the provider proves one. Teach the collector to treat a chat as a candidate source under the existing Claude/Codex gate, and the write-back to name the unified row when no terminal tab owns the id. Persist the conversation id so a restored chat keeps its name and can still refresh it. Reuses the mechanism from #17092.
|
Closing: superseded. Structured chats (Claude and Codex) will be named by a user-configurable agent from the Chat settings page, stored on the session record, and shown on the tab, the sidebar row and AI Vault from that one field. That work replaces this approach. |
Fixes STA-5861.
ELI5
Every chat with Codex has a name that Codex itself writes down. Orca's older,
terminal-based Codex tabs already read that name and put it on the tab. The new
structured chat tabs never did — every one of them was just called "Codex Chat".
This teaches the new tabs to read the same name from the same place, instead of
inventing a second way to name a tab.
User-facing before / after
Before — every structured Codex chat tab was called the same generic thing.
With three chats open you could not tell which was which without clicking into
each one. Renaming a tab yourself did not stick: the next update from the host
put the generic name back.
After — each tab carries the name of the conversation it holds, and updates
when Codex renames the thread. If you rename a tab yourself, it stays renamed —
the provider name never overwrites yours.
Which pipeline this reuses
The existing AI Vault tab-title / session-name pipeline, unchanged:
agent identity → collectAiVaultTitleRequests → aiVault.resolveSessionTitles (routed to the host that owns the session) → setAiVaultTabTitle → tab.aiVaultTitle → resolveUnifiedTabLabelThat is the same path a terminal-backed Codex tab takes. The only thing
structured chats were missing was the provider session identity in the renderer,
so this adds that and nothing else:
RuntimeMobileSessionAgentTab.providerSessionId, a new optionalwire field carrying the Codex thread the session writes to (the head of the
record's provider-handle chain, so a fork is never presented as its origin).
It is identity, not a title.
collectAiVaultTitleRequests, andsetAiVaultTabTitlelearns to write theunified chat row (structured chats have no terminal tab to carry the name).
Everything else is inherited: precedence (
customLabel> … >aiVaultTitle>generatedLabel> live label), the 20s-while-missing / 5-min-when-named refreshcadence, execution-host routing for SSH and runtime hosts, and persistence.
Why not publish the resolved title as the tab's
labelinstead? That wouldbe a second title source, and it also loses a rule:
labelsits belowgeneratedLabelinresolveUnifiedTabLabel, so with "Auto-generate tab titles"on, a generated title would outrank the provider's own session name — the
opposite of what a terminal-backed Codex tab does.
What the acceptance cases needed
the mirror now preserves the
aiVaultTitleandcustomLabelit used to discardon every host snapshot, the store write bails when the name is unchanged, and an
unnamed tab shows the existing label rather than an empty one, so nothing blanks
or reflows.
customLabel: nullon every snapshot, which is now preserved.agentSessionProviderSessionIdjoinsaiVaultTitlein the persisted unified-tab schema, so a restored chat shows its name
immediately and can still refresh it.
host \0 agent \0 threadId, so an answer for one thread cannot name another,and a thread with no answer keeps its existing name.
Absence is not a title
The host omits
providerSessionIduntil the provider proves a handle, ratherthan publishing an empty string. A tab with no proven thread stays on its current
name; when the thread is proven the host republishes the snapshot and the name
lands without waiting for a restart.
Cross-platform / SSH
The title is resolved by the execution host that owns the session
(
getExecutionHostIdForWorktree→aiVault.resolveSessionTitleshost routing),so a remote structured chat reads that host's Codex home, not the client's. No
new path handling. The new wire field is Rule 1 (optional): old hosts omit it,
old clients ignore it.
docs/reference/remote-wire-compatibility.mdrecords theaddition and the client-owned-name carve-out, since the cross-version harness
does not cover the session-tab sync channel.
Tests
Ten new tests, one per acceptance case plus the identity edges. All nine that can
fail before the change do fail on
main; each of the 13 gates was ablatedindividually and each reddens at least one test on its own. The one test that is
green before the change is the "publish no identity while unproven" guard — the
field does not exist yet on
main, so it cannot fail there; it is pinned byablation (stamping
?? ''instead of omitting reddens it).Gates
pnpm tcclean (both projects).oxlintclean, no suppressions.node config/scripts/check-changed-code-quality.mjs: 0 new findings across 15files, React Doctor included.
git diff --checkclean. Formatted withnpx oxfmt --writeon changed paths only.