authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:51:43-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:51:43-07:00
logbc24d98d1630104722abe6a4d839365d24e2aa27
tree4966358b32f0ce444ab99a6e637d834e4890b28d
parentd524eb96936090bd2b8a96449784155ad4af9591
signature Signed by PGP key B5690EEEBB952194

test(server): remove title prompt editorial snapshots (#10063)


1 files changed, 1 insertions(+), 40 deletions(-)

apps/server/src/textGeneration/TextGenerationPrompts.test.ts+1-40
...@@ -146,7 +146,7 @@ describe("buildBranchNamePrompt", () => {...@@ -146,7 +146,7 @@ describe("buildBranchNamePrompt", () => {
146});146});
147147
148describe("buildThreadTitlePrompt", () => {148describe("buildThreadTitlePrompt", () => {
149 it("includes the user message and the title guidance rules", () => {149 it("includes the user message without absent attachment metadata", () => {
150 const result = buildThreadTitlePrompt({150 const result = buildThreadTitlePrompt({
151 message: "Investigate reconnect regressions after session restore",151 message: "Investigate reconnect regressions after session restore",
152 });152 });
...@@ -154,18 +154,6 @@ describe("buildThreadTitlePrompt", () => {...@@ -154,18 +154,6 @@ describe("buildThreadTitlePrompt", () => {
154 expect(result.prompt).toContain("User message:");154 expect(result.prompt).toContain("User message:");
155 expect(result.prompt).toContain("Investigate reconnect regressions after session restore");155 expect(result.prompt).toContain("Investigate reconnect regressions after session restore");
156 expect(result.prompt).not.toContain("Attachment metadata:");156 expect(result.prompt).not.toContain("Attachment metadata:");
157 expect(result.prompt).toContain(
158 "Generate a title that will help the user recognize this T3 Code thread weeks later.",
159 );
160 expect(result.prompt).toContain(
161 "Title the subject and outcome. Discard incidental instructions.",
162 );
163 expect(result.prompt).toContain(
164 "Name the product change, not the mock, plan, report, branch, or PR used to produce it.",
165 );
166 expect(result.prompt).not.toContain(
167 "Title should summarize the user's request, not restate it verbatim.",
168 );
169 });157 });
170158
171 it("includes attachment metadata when attachments are provided", () => {159 it("includes attachment metadata when attachments are provided", () => {
...@@ -188,24 +176,6 @@ describe("buildThreadTitlePrompt", () => {...@@ -188,24 +176,6 @@ describe("buildThreadTitlePrompt", () => {
188 expect(result.prompt).toContain("67890 bytes");176 expect(result.prompt).toContain("67890 bytes");
189 });177 });
190178
191 it.each([
192 { mode: "initial", previousTitle: undefined },
193 { mode: "regeneration", previousTitle: "Open Projects in Desktop App" },
194 ])(
195 "tells the $mode prompt not to title linked PRs from local git history",
196 ({ previousTitle }) => {
197 const result = buildThreadTitlePrompt({
198 message: "$takeover https://github.com/pingdotgg/t3code/pull/8588",
199 ...(previousTitle === undefined ? {} : { previousTitle }),
200 });
201
202 expect(result.prompt).toContain(
203 "Local git history is not evidence of what a linked PR or issue is about.",
204 );
205 expect(result.prompt).toContain('such as "Take Over PR 8588"');
206 },
207 );
208
209 it("regenerates from recent thread contents and identifies the previous title", () => {179 it("regenerates from recent thread contents and identifies the previous title", () => {
210 const result = buildThreadTitlePrompt({180 const result = buildThreadTitlePrompt({
211 message: `USER:\nInvestigate reconnect regressions\n\nASSISTANT:\nThe remaining issue is stale session state`,181 message: `USER:\nInvestigate reconnect regressions\n\nASSISTANT:\nThe remaining issue is stale session state`,
...@@ -216,15 +186,6 @@ describe("buildThreadTitlePrompt", () => {...@@ -216,15 +186,6 @@ describe("buildThreadTitlePrompt", () => {
216 "Regenerate the title for an existing T3 Code thread so the user can recognize it weeks later.",186 "Regenerate the title for an existing T3 Code thread so the user can recognize it weeks later.",
217 );187 );
218 expect(result.prompt).toContain('The previous title was "Investigate reconnect regressions".');188 expect(result.prompt).toContain('The previous title was "Investigate reconnect regressions".');
219 expect(result.prompt).toContain(
220 "Read the USER messages first. Identify the latest explicit durable goal.",
221 );
222 expect(result.prompt).toContain(
223 "Do not promote one assistant finding into the thread subject unless the user adopts it as a new goal.",
224 );
225 expect(result.prompt).toContain(
226 'A subagent-monitoring review that finds a Codex roster bug remains "Review Subagent Monitoring Risks,"',
227 );
228 expect(result.prompt).toContain("Thread contents:");189 expect(result.prompt).toContain("Thread contents:");
229 expect(result.prompt).toContain("The remaining issue is stale session state");190 expect(result.prompt).toContain("The remaining issue is stale session state");
230 });191 });