Skip to content

feat(web): regenerate thread titles from sidebar - #4810

Open
t3dotgg wants to merge 7 commits into
mainfrom
t3code/regenerate-thread-title
Open

feat(web): regenerate thread titles from sidebar#4810
t3dotgg wants to merge 7 commits into
mainfrom
t3code/regenerate-thread-title

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 29, 2026

Copy link
Copy Markdown
Member

Thread titles can stop reflecting the conversation as work evolves, while Sidebar v2 only supports replacing them manually.

This adds a Regenerate title action that sends recent thread context and the previous title through the configured text-generation model. The server keeps the work off the provider command queue, preserves manual renames made while generation is running, and capability-gates the action for version-skewed environments.

Testing

  • 96 focused contract, prompt, environment, and reactor tests
  • Typechecked contracts, client-runtime, server, and web
  • Targeted lint and formatting checks

Generated by gpt-5.6-sol with the Codex harness in T3 Code.


Note

Medium Risk
Touches orchestration commands/events, projection persistence, and async reactor behavior with race handling; changes are well-tested but span server and web with a new migration.

Overview
Adds Regenerate title for threads whose titles no longer match the conversation, exposed from Sidebar v2 (single and bulk selection) and gated by a new threadTitleRegeneration server capability.

Clients send thread.meta.update with regenerateTitle: true. The decider records pending titleRegeneration state and emits completion via thread.title.regeneration.complete. ProviderCommandReactor handles regeneration on a dedicated async worker (not the provider turn queue): it builds bounded thread context (8k chars, up to four attachments), calls text generation with previousTitle, skips fallback/unchanged titles, and avoids overwriting manual renames made while a run is in flight or queued.

SQLite migration 035 adds projection columns; snapshots and the client reducer surface titleRegeneration so rows can dim, set aria-busy, and time out after 30s if the server never clears pending state.

Reviewed by Cursor Bugbot for commit 88b3bd1. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add thread title regeneration from the sidebar context menu

  • Adds 'Regenerate title' to per-thread and multi-select context menus in SidebarV2.tsx, calling updateThreadMetadata with regenerateTitle: true and showing a disabled 'Regenerating…' label while pending.
  • Introduces server-side title regeneration in ProviderCommandReactor.ts: a thread.meta-updated event with regenerateTitle=true triggers async LLM title generation, then emits a thread.title.regeneration.complete command to update the thread.
  • Adds previousTitle support to buildThreadTitlePrompt across all text generation providers so regeneration prompts reflect prior title context and use tail-preserving truncation on long thread histories.
  • Persists in-flight regeneration state (titleRegenerationRequestId, titleRegenerationStartedAt) via a new DB migration (035_ProjectionThreadTitleRegeneration.ts) and propagates it through the read model to the client.
  • Exposes a threadTitleRegeneration capability flag in the server environment descriptor so clients can gate the UI feature on server support.

Macroscope summarized 88b3bd1.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6525d8d4-8acd-4f14-9453-da1132cb6902

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 29, 2026
@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from 63add75 to 3a36a86 Compare July 29, 2026 03:14
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (thread title regeneration) with database schema changes, new orchestration logic, and UI components. New features introducing new workflows warrant human review regardless of implementation quality.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from 3a36a86 to f5de384 Compare July 29, 2026 03:25
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from f5de384 to a3ba2e0 Compare July 29, 2026 03:36
Comment thread apps/server/src/textGeneration/TextGenerationPrompts.ts
@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from a3ba2e0 to 8316ef2 Compare July 29, 2026 03:47
Comment thread apps/server/src/orchestration/decider.ts
@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from 8316ef2 to ea1c1d9 Compare July 29, 2026 03:54
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
@t3dotgg
t3dotgg force-pushed the t3code/regenerate-thread-title branch from ea1c1d9 to 55673e2 Compare July 29, 2026 04:03
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6a59660. Configure here.

Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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