Skip to content

refactor(server): make title prompts plaintext - #5368

Merged
t3dotgg merged 1 commit into
mainfrom
refactor/plaintext-title-prompts
Aug 4, 2026
Merged

refactor(server): make title prompts plaintext#5368
t3dotgg merged 1 commit into
mainfrom
refactor/plaintext-title-prompts

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 4, 2026

Copy link
Copy Markdown
Member

The initial and regeneration title prompts became difficult to read and tune after being assembled from conditional arrays.

This makes both prompts explicit plaintext templates, leaves a reminder to keep their shared editorial rules aligned, and reduces the shared message builder to the branch-name behavior it actually supports. Generated prompt content and runtime behavior are unchanged.

Testing

  • vp test run apps/server/src/textGeneration/TextGenerationPrompts.test.ts (19 tests passed)
  • vp fmt apps/server/src/textGeneration/TextGenerationPrompts.ts --write
  • git diff --check

The server-wide local typecheck remains blocked by existing Effect and dependency diagnostics in unrelated files; the changed file reports no diagnostic.

Made with GPT-5.6 Sol (low reasoning) through the Codex harness in T3 Code.


Note

Low Risk
Prompt-only refactor with existing tests passing; no API or provider wiring changes beyond how strings are assembled.

Overview
Thread title generation no longer builds prompts from nested conditional arrays via buildPromptFromMessage. Initial and regeneration flows now use dedicated plaintext templates (INITIAL_THREAD_TITLE_PROMPT, regenerateThreadTitlePrompt), with a comment to keep shared editorial rules aligned between them.

The shared buildPromptFromMessage helper is trimmed to what branch-name generation still needs: fixed "Rules:" / "User message:" labels and no optional guidance, custom rule labels, or tail sections. preserveMessageEnd and attachment/policy suffix assembly move to thread-title-only helpers (threadTitlePromptSuffix, direct string composition in buildThreadTitlePrompt).

Intended prompt text and runtime behavior stay the same; this is structure and readability for tuning titles.

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

Note

Rewrite thread title prompts as plaintext in buildThreadTitlePrompt

  • Replaces the generic buildPromptFromMessage-based title prompts with dedicated plaintext prompt strings for initial and regeneration modes.
  • Adds INITIAL_THREAD_TITLE_PROMPT (fixed editorial instructions) and regenerateThreadTitlePrompt (references the previous title with structured guidance) in TextGenerationPrompts.ts.
  • Regeneration mode now uses tail-preserving truncation via preserveMessageEnd so the most recent content is retained; initial mode uses start-based truncation via limitSection.
  • Strips guidance, rulesLabel, afterRules, messageLabel, and preserveMessageEnd from PromptFromMessageInput, making buildPromptFromMessage always emit fixed Rules: and User message: labels.
  • Behavioral Change: title prompts now differ substantially from other prompts — regeneration includes a truncation marker for long threads, and callers can no longer customize labels or guidance sections.

Macroscope summarized 4ef544f.

@coderabbitai

coderabbitai Bot commented Aug 4, 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: 9b45fd13-6842-4b41-98f9-bdae84cb957f

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 vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 4, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 4ef544f

This is a straightforward refactor that converts dynamically-built title prompts into static plaintext constants for improved readability. The prompt content is preserved unchanged, and no runtime behavior is affected.

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

@t3dotgg
t3dotgg merged commit 2fa1fec into main Aug 4, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the refactor/plaintext-title-prompts branch August 4, 2026 22:51
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 5, 2026
## What's Changed
* fix(web): better right panel (new diffs styling) by @maria-rcks in pingdotgg/t3code#5260
* fix(server): keep regenerated titles on topic by @t3dotgg in pingdotgg/t3code#5365
* refactor(server): make title prompts plaintext by @t3dotgg in pingdotgg/t3code#5368
* feat(web): configurable fonts and sizes under Settings → Appearance by @StiensWout in pingdotgg/t3code#5103
* feat(sidebar-v2): bring back thread pinning by @t3dotgg in pingdotgg/t3code#5312
* feat(web): make pairing QR codes actually scannable, with endpoint choice by @t3dotgg in pingdotgg/t3code#5360
* fix(desktop,web): improve in-app browser shortcuts and URL behavior by @t3dotgg in pingdotgg/t3code#4703
* fix(web): prevent legacy model picker layout shift by @FllipEis in pingdotgg/t3code#5349
* fix(server): allow remote updates with database migrations by @t3dotgg in pingdotgg/t3code#5374


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260804.1000...v0.0.32-nightly.20260805.1002

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1002
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot added a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
…ct-titles-63f7

sync: port upstream Effect beta.103, tunnel isolation, renderer OOM guard, and durable titles (pingdotgg#5331pingdotgg#5368)
vortechron pushed a commit to vortechron/void that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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