Skip to content

[Bug]: Claude session name only follows the thread title at the next turn start (follow-up to #34342) #37173

Closed

Description

@FLPPPPPP

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Summary

Follow-up to #34342. #34775 syncs the T3 thread title to the native Claude session name at the start of a turn. A title change at any other time is not applied until the user sends another message:

# Scenario Expected Actual
1 The generated title replaces the first-prompt seed a few seconds into the first turn The native session gets the generated title The native name stays the 50-character seed for the whole first turn, and forever in a one-turn thread
2 Rename or Regenerate title while a turn is running The native session is renamed right away Nothing is sent; the name changes when the next turn starts
3 Rename or Regenerate title after the last turn The native session is renamed Nothing is sent until another message is sent

The end of a run does not trigger a sync either. #34342 listed "including a live one" and "the generated title replacing the seed" under Expected; the shipped fix covers turn starts only.

Steps to reproduce

  1. Start a new Claude thread with a prompt longer than 50 characters that keeps Claude busy for a minute or more.
  2. Wait for T3's generated title to replace the seed in the sidebar.
  3. Read the native name: the last custom-title entry in ~/.claude/projects/<encoded cwd>/<session id>.jsonl, or claude --resume in the thread's folder. It is still the seed.
  4. Rename the thread in the sidebar while the turn is running. The native name does not change.
  5. Let the turn finish. The native name still does not change.
  6. Send a second message. The native name changes at that moment.

Expected behavior

Every T3 title change reaches the native session when it happens: the generated title replacing the seed, a manual rename, Regenerate title. That includes a session whose turn is running and a session that gets no further turn.

Actual behavior

One thread on 0.1.10-nightly.20261115.4723, times in UTC:

Time Event
10:37:59.867 Thread created with the seed title
10:38:00.168 Claude process launched with the SDK title option = seed
10:38:03.444 Generated title committed (thread.title.regeneration.complete)
10:38:03.716 CLI reports session_title_changed = seed
10:38:42.555 Regenerate title finished (unchanged)
10:39:20.174 Manual rename (thread.metadata.update)
10:38 - 11:03 21 custom-title entries written by the CLI, all the seed
11:03:41.566 Turn 1 result; the native name is still the seed 88 s later
11:05:09.459 Turn 2 requested
11:05:09.582 session_title_changed = the thread title; first agent-name entry

Root cause (main @ 70abb6c)

  • The only rename_session call site is in startTurn: after openQuery, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts:13022-13029 compares appliedSessionTitles with turnInput.appThread.title and sends the rename. steerTurn does not, and nothing runs at turn end.
  • turnInput.appThread is a snapshot taken when the turn start begins (ProviderTurnStartService.ts:422, passed at :1819). At spawn the same snapshot feeds the SDK title option (ClaudeAdapterV2.ts:12682, :2252-2253) and is recorded as applied (:12761-12763).
  • Title changes only update the projection: a rename (Orchestrator.ts:4853) and a generated or regenerated title (:5151) both emit thread.metadata-updated (:5242-5244). ProviderAdapterV2SessionRuntime has no title method, so nothing reaches the adapter.
  • Scenario 1 should affect every new thread: title generation starts alongside the first turn and takes seconds, so the CLI is spawned with the seed and the generated title lands later. In the thread above it landed 270 ms before the post-open comparison, which still compared the stale snapshot (seed against seed).
  • The CLI looks able to take the request during a turn (not tested live). SDKControlRenameSessionRequest "Sets the user-facing title for the current session" with no turn-state condition (sdk.d.ts:5280-5295, SDK 0.3.321). In CLI 2.1.325 rename_session is dispatched from the same control loop as interrupt and its handler has no busy check. T3 already sends control requests to a running turn: provider-session.apply-model-selection (Orchestrator.ts:5275-5313, ClaudeAdapterV2.ts:13989, :12506).

Proposed fix

  1. Add an optional applyThreadTitle to ProviderAdapterV2SessionRuntime, next to applyModelSelection (packages/provider-core/src/server/ProviderAdapter.ts:748-752).
  2. When thread.metadata.update or thread.title.regeneration.complete changes the title, enqueue a provider-session.apply-thread-title effect for the thread's active provider thread, the way Orchestrator.ts:5275-5313 enqueues provider-session.apply-model-selection (EffectWorker.ts:207-214).
  3. Claude adapter:
    • Live query: send renameSession(title) with the existing 10 s timeout. Record the title in appliedSessionTitles on success; forget it on failure so the next turn retries.
    • Process still opening: keep the title as the wanted one and compare against it in startTurn instead of the turn snapshot. This closes the 270 ms race above.
    • No process: leave it to the next turn as today, or call the SDK's exported renameSession(sessionId, title, { dir }) (sdk.d.ts:3382-3388) so a rename with no following turn still reaches claude --resume.
  4. Tests in the ClaudeAdapterV2 session title sync block: a title change during a running turn sends one rename and the next turn sends none; a title that lands between the snapshot and the open is applied by the first turn; a failed live rename is retried at the next turn; a native /rename is not reverted.

Impact

Minor bug or occasional failure

Version or commit

0.1.10-nightly.20261115.4723 (11c425b, contains #34775 and #36879); code checked again at main @ 70abb6c

Environment

Windows 11 Pro, T3 Code (Nightly) desktop app, Claude provider (@anthropic-ai/claude-agent-sdk ^0.3.321 per apps/server/package.json, Claude Code CLI 2.1.325 started through a local launcher set as the Claude binary path), claude-fable-5-2

Logs or stack traces

# Provider log of the thread: everything T3 sent, and the title frames it received.
# The seed and the thread title are replaced by placeholders.
10:38:03.714Z OUT query.open
10:38:03.716Z IN  session_title_changed  "<first 50 characters of the prompt>..."
10:38:03.719Z OUT prompt.offer
11:01:50.476Z OUT subagent.lookup
11:03:41.566Z IN  result (turn 1)
11:05:09.582Z IN  session_title_changed  "<thread title>"
11:05:09.583Z OUT query.rename_session   "<thread title>"
11:05:09.588Z OUT prompt.offer

Related

Workaround

Send any follow-up message, or run /rename <sidebar title> in the thread.


Filed by Claude Code (Claude Fable 5.2), running inside T3 Code at the reporter's request. Reproduced on the reporter's machine.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions