Skip to content

fix(native-chat): name a resumed chat after the conversation it resumes - #28794

Open
erfoon wants to merge 1 commit into
stablyai:mainfrom
erfoon:fix/resumed-native-chat-keeps-title
Open

erfoon wants to merge 1 commit into
stablyai:mainfrom
erfoon:fix/resumed-native-chat-keeps-title

Conversation

@erfoon

@erfoon erfoon commented Oct 14, 2026

Copy link
Copy Markdown

ELI5

When you pick a past Claude or Codex conversation in Session History and choose "Resume in New Native Chat", the new chat should carry that conversation's name. Today it is always called "Claude Chat" (or "Codex Chat"), so several resumed chats look identical. With this change the chat starts with the same name Session History showed for the conversation.

What Changed

Before: a chat opened with "Resume in New Native Chat" (Session History row menu, tab menu, or the terminal header button) is named "Claude Chat" / "Codex Chat" and stays that way. First-message naming (#25724) never fires for it, because its journal already holds the imported history.

After: the chat is named after the conversation's Session History title from the moment it opens, in the tab, the sidebar row and Session History. A manual tab rename still wins.

Mechanism: when a create adopts an existing conversation, resolveStructuredAgentSessionIntent already knows the transcript path. It now looks up that conversation's title with the existing resolveLocalAiVaultSessionTitles and carries it on adopt.conversationName. reserveRequestFor passes it to the reserve request, and agentSessionRecordIdentityFields normalises it and writes it as the new record's conversationName, on both the founding and the reservation path. Everything downstream already reads that field (#25986), and the first-message namer already skips a record that has a name.

The lookup is best-effort. Claude and Codex only (the agents Session History titles). History's <Agent> <id prefix> placeholder is never used as a name. If the lookup fails or times out, the chat opens with the default name, exactly as today.

Why

The name has to be on the host record: a label set by the renderer would be overwritten by the host-published tab title and would not reach the sidebar or Session History.

Alternatives considered:

  • Send the title from the renderer in resumeFrom. The renderer has it, but agentSession.create params are strict, so an older host would reject the new field, and the row title can still be a pending placeholder. Deriving it host-side needs no wire change.
  • Name the chat after it is created, through the namer's publish/retitle path. That works, but it adds a second asynchronous writer and a visible rename flash, for a name that is already known at creation time.

Linked Issue

Fixes #28763

Visual Proof

Before: as described in #28763 (resumed chats all read "Claude Chat").

After: not captured. I could not run the Electron app locally (dependencies installed without native builds), so the behaviour is covered by the host-level tests below instead.

Testing

On macOS, Node 22.22, dependencies installed with --ignore-scripts:

  • vitest run --config config/vitest.config.ts on orca-runtime-structured-agent-session-create-intent.test.ts, structured-agent-session-create-adoption.test.ts and structured-chat-naming.test.ts: 73 passed.
  • With the production change removed, the two naming tests fail (expected undefined to be 'Fix the flaky login test'), so they guard the fix.
  • pnpm tc:node: clean. oxlint and oxfmt --check on the changed files: clean.

New tests:

  • an adopting create stores the source conversation's (normalised) title as the record's conversationName;

  • the create intent carries the title, skips History's placeholder title, and still adopts with no name when the title lookup fails.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Investigation, implementation and tests were done with Claude Code: Claude Opus 5.5 planning and reviewing, with Claude Sonnet 5.5 subagents for code reading, implementation and test runs.

Review

AI review summary:

  • SSH / remote: the title is read on the host that resolves the create intent, which is the host that just found the transcript on its own filesystem (adoption refuses with transcriptNotFound otherwise). So a remote host names the chat from its own transcript.
  • Backwards compatibility: adopt is built host-side and never crosses the wire (the client's attach params have no adopt), so mixed client and host versions are unaffected. The new fields are optional, and existing records are untouched.
  • Idempotency: the name is derived, not requested, so it is not part of the attach fingerprint, and a retried create replays the stored record.
  • Performance: one title lookup per resume through the AI Vault scanner service, normally a cache hit. If the service fails, the chat opens with the default name. A hung service can delay the resume up to the service's existing 15 s interactive deadline.
  • Security: the title passes through the existing normalizeAgentSessionConversationName (control and bidi characters stripped, 200-character cap) before it is stored.
  • Cross-platform: no platform-specific code.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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 (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

"Resume in New Native Chat" opened chats named "Claude Chat" or
"Codex Chat", and first-message naming never fires for them because
their journal already holds the imported history.

When a create adopts an existing conversation, look up the title
Session History shows for it and seed it as the new record's
conversationName. The lookup is best-effort: a failure or History's
placeholder title leaves the chat with the default name, as before.

Fixes stablyai#28763

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 44632796-ea30-4ef6-a30c-984e95977017
📥 Commits

Reviewing files that changed from the base of the PR and between dc146c0 and 92254dc.

📒 Files selected for processing: 7
  • src/main/native-chat/agent-session-wire/structured-agent-session-attach.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-create-adoption.test.ts
  • src/main/runtime/agent-session-record-founding.ts
  • src/main/runtime/agent-session-reservation-admission.ts
  • src/main/runtime/orca-runtime-get-structured-agent-session-create-support.ts
  • src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts
  • src/main/runtime/structured-agent-session-create-adoption.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Adopted session creation now resolves an eligible AI Vault conversation title and passes it through the adoption and reservation requests. Record founding normalizes the name and includes it when the normalized value is non-empty. Tests cover title lookup results, lookup failure, and whitespace normalization.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 92254

The new naming path has no established merge-blocking issue; normal checks remain appropriate before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: naming a resumed native chat after the conversation it resumes.
Description check Passed The description is complete and directly matches the implementation. It explains the user impact, mechanism, rationale, testing, compatibility, and scope. The visual proof section does not use the exa…
Linked Issues check Passed For direct issue #28763, the PR resolves the adopted Claude or Codex conversation title on the host, excludes the generated History placeholder, and carries the title through reserveRequestFor into …
Out of Scope Changes check Passed The changes stay within #28763. Production changes add best-effort title lookup and propagation for adopted native chats. Type updates and normalization support that behavior. The added tests verify t…
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch has not been deployed

No deployments
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.

[Bug]: Resume in New Native Chat names the chat "Claude Chat" instead of the session's title

1 participant