refactor(server): make title prompts plaintext - #5368
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
## 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
…ct-titles-63f7 sync: port upstream Effect beta.103, tunnel isolation, renderer OOM guard, and durable titles (pingdotgg#5331–pingdotgg#5368)
(cherry picked from commit 2fa1fec)
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 --writegit diff --checkThe 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
buildPromptFromMessagehelper is trimmed to what branch-name generation still needs: fixed"Rules:"/"User message:"labels and no optional guidance, custom rule labels, or tail sections.preserveMessageEndand attachment/policy suffix assembly move to thread-title-only helpers (threadTitlePromptSuffix, direct string composition inbuildThreadTitlePrompt).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
buildThreadTitlePromptbuildPromptFromMessage-based title prompts with dedicated plaintext prompt strings for initial and regeneration modes.INITIAL_THREAD_TITLE_PROMPT(fixed editorial instructions) andregenerateThreadTitlePrompt(references the previous title with structured guidance) in TextGenerationPrompts.ts.preserveMessageEndso the most recent content is retained; initial mode uses start-based truncation vialimitSection.guidance,rulesLabel,afterRules,messageLabel, andpreserveMessageEndfromPromptFromMessageInput, makingbuildPromptFromMessagealways emit fixedRules:andUser message:labels.Macroscope summarized 4ef544f.