Skip to content

fix(server): forked threads get titles from the history they inherit - #24857

Merged
t3dotgg merged 2 commits into
mainfrom
t3/fix-forked-thread-title-context
Oct 25, 2026
Merged

t3dotgg merged 2 commits into
mainfrom
t3/fix-forked-thread-title-context

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Forked threads got vague titles. A fork has no messages of its own, so its first title came from one follow-up message with no context. "ok now do the same for mobile" became "Port Changes to Mobile App".

Title generation now reads the source thread's messages up to the fork point, across forks of forks. It sends them with the source title to the shared title prompt. A new prompt section asks for the inherited subject plus the fork's new direction. All providers use this prompt, for first titles and for regeneration. If the source is gone, the fork falls back to its own messages.

Same fork, real model, two runs each:

Prompt Titles
Before "Apply same change to mobile app", "Port Changes to Mobile App"
After "Mobile App Sidebar Row Re-renders", "Sidebar Row Re-renders in Mobile App"

Proof: a new service test fails on main and passes here, plus the live model comparison above.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

A fork has no messages of its own, so its first title came from one
follow-up message with no context. Title generation now reads the source
history up to the fork point and the shared prompt titles the fork's new
direction against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 25, 2026
Comment thread apps/server/src/orchestration-v2/ThreadTitleRegenerationService.ts
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB −7 B (−0.1%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −7 B (−0.6%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 375da0f · PR result: eab7804 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at eab7804

Macroscope's review found this PR approvable — This is a scoped server bug fix that enriches title generation only for forked threads, while preserving existing non-fork behavior and handling missing source threads. The added regression test verifies the fork-point history selection and excludes rolled-back or later messages.

You can add or adjust custom eligibility rules. Learn more.

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

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between ecb8c98 and eab7804.

Files selected for processing: 2
  • apps/server/src/orchestration-v2/ThreadTitleRegenerationService.test.ts
  • apps/server/src/orchestration-v2/ThreadTitleRegenerationService.ts

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Thread title regeneration now gathers inherited history through a fork’s selected run. It passes the source title and history to title-generation prompts, which identify post-fork content when fork context is present.

Changes: Fork-aware title generation

Layer / File(s) Summary
Prompt context contract and formatting
packages/provider-core/src/server/textGeneration.ts, packages/provider-core/src/server/textGenerationOperations.ts, packages/provider-core/src/server/textGenerationPrompts.ts
Title generation accepts optional fork-source context. Prompts include the source title and history, limited to 8,000 characters, and label content as post-fork when context is present.
Inherited history collection and verification
apps/server/src/orchestration-v2/ThreadTitleRegenerationService.ts, apps/server/src/orchestration-v2/ThreadTitleRegenerationService.test.ts
Regeneration collects user and assistant messages through each fork point, excluding streaming messages and applying the runless-message rule for v1_import history. A test checks that history after the selected fork run and rolled-back history are excluded.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ThreadTitleRegenerationService
  participant OrchestrationV2AppThread
  participant generateThreadTitle
  participant buildThreadTitlePrompt
  ThreadTitleRegenerationService->>OrchestrationV2AppThread: Retrieve history through fork run
  OrchestrationV2AppThread-->>ThreadTitleRegenerationService: Return inherited history and ancestor title
  ThreadTitleRegenerationService->>generateThreadTitle: Pass forkSource
  generateThreadTitle->>buildThreadTitlePrompt: Pass forkSource
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: juliusmarminge, maria-rcks

Merge Risk: Minimal · up to eab78

The reviewed fork-title changes have no identified issue that needs resolution before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the problem, the implementation, and observed verification results. However, it does not use the required Problem, Change, Scope and approval, and Verification sections. It al… Rewrite the description using all required template sections. Add the triaged issue or explicit maintainer approval with a link, identify the focused test and command, and state any checks that were not run.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: improving title generation for forked threads using inherited history.
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 explains the problem, the implementation, and observed verification results. However, it does not use the required Problem, Change, Scope and approval, and Verification sections. It also does not link a triaged issue or maintainer approval, and it omits the test name and command.

Resolution

Rewrite the description using all required template sections. Add the triaged issue or explicit maintainer approval with a link, identify the focused test and command, and state any checks that were not run.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

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

@t3dotgg
t3dotgg merged commit a6aca34 into main Oct 25, 2026
31 of 32 checks passed
@t3dotgg
t3dotgg deleted the t3/fix-forked-thread-title-context branch October 25, 2026 11:57
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 25, 2026
## What's Changed
* fix(mobile): one way to select a page, so split view stops pushing by @juliusmarminge in pingdotgg/t3code#24742
* fix(mobile): Settings pages no longer flicker when switching beside the list by @juliusmarminge in pingdotgg/t3code#24749
* fix(server): use Codex native collaboration modes by @t3dotgg in pingdotgg/t3code#24737
* fix(clients): threads no longer flash in the inbox before they settle by @t3dotgg in pingdotgg/t3code#24760
* fix(mobile): the iPhone compose icon matches the tab icons' size by @juliusmarminge in pingdotgg/t3code#24650
* feat(infra): share Vite task cache with Axiom savings telemetry by @juliusmarminge in pingdotgg/t3code#24693
* fix(mobile): screen lists register with their header, enforced by lint by @juliusmarminge in pingdotgg/t3code#24710
* feat(mobile): search Settings, and keep its sidebar header clean by @juliusmarminge in pingdotgg/t3code#24766
* fix(mobile): threads open with less waiting, and the Threads tab remembers drafts by @juliusmarminge in pingdotgg/t3code#24750
* fix(mobile): reduce diff entry and source highlighting delays by @juliusmarminge in pingdotgg/t3code#24770
* perf(client): skip unchanged shell and config cache writes by @juliusmarminge in pingdotgg/t3code#24266
* fix(mobile): remove perpetual reconnect indicator animation by @juliusmarminge in pingdotgg/t3code#24273
* feat(mobile): close the keyboard from the Duo's side bar by @t3dotgg in pingdotgg/t3code#24696
* fix(mobile): dispatch native toolbar actions to current handlers by @juliusmarminge in pingdotgg/t3code#24271
* fix(server): PR watch wakes say the PR stays linked and watched by @t3dotgg in pingdotgg/t3code#24781
* feat(server): thread tools return a ready t3-thread link by @t3dotgg in pingdotgg/t3code#24784
* fix(server): running task results tell the agent to end its turn by @t3dotgg in pingdotgg/t3code#24782
* fix(server): mobile push no longer says "completed" between runs by @t3dotgg in pingdotgg/t3code#24769
* fix(server): delegated children no longer see pull request watch tools by @t3dotgg in pingdotgg/t3code#24808
* fix(mobile): search stays open after going back from a thread by @t3dotgg in pingdotgg/t3code#24748
* feat(server): request_secret can save a CLI token to a private file by @t3dotgg in pingdotgg/t3code#24809
* fix(server): threads settle right after a shell merge of an unlinked PR by @t3dotgg in pingdotgg/t3code#24830
* fix(server): worktree setup no longer hangs when a shell startup prompt eats the command by @t3dotgg in pingdotgg/t3code#24775
* feat(server): link pull requests agents create from the shell by @t3dotgg in pingdotgg/t3code#24813
* fix(mobile): queue Steer button no longer opens the editor on a near miss by @t3dotgg in pingdotgg/t3code#24832
* fix(usage): Gemini 4 Argon usage from Antigravity now has a price by @t3dotgg in pingdotgg/t3code#24834
* fix(server): publish committed events before writer cancellation by @Yash-Singh1 in pingdotgg/t3code#24836
* fix(web): shared dev servers no longer crash on lazy routes by @t3dotgg in pingdotgg/t3code#24839
* fix(web): chat tables and subagent rows line up by @t3dotgg in pingdotgg/t3code#24835
* perf(shell): cold connects skip older settled threads, 93% of the shell JSON by @t3dotgg in pingdotgg/t3code#24723
* test(server): restart replay tests no longer hang on a leftover checkpoint capture by @t3dotgg in pingdotgg/t3code#24851
* feat(web): Settings and Usage open as large modals over your thread by @t3dotgg in pingdotgg/t3code#24847
* fix(server): forked threads get titles from the history they inherit by @t3dotgg in pingdotgg/t3code#24857
* fix(release): desktop builds pass again after the vite-plus 1.4 upgrade by @t3dotgg in pingdotgg/t3code#24867
* feat(server): cut T3's agent instructions and tool copy by 60% by @t3dotgg in pingdotgg/t3code#24850


**Full Changelog**: pingdotgg/t3code@v0.1.3-nightly.20261025.3655...v0.1.3-nightly.20261025.3669

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.3-nightly.20261025.3669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant