Skip to content

fix(provider-core): generated thread titles keep the closing quote of a quoted term - #37499

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/thread-title-closing-quote
Nov 16, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/thread-title-closing-quote

Conversation

@tiliakoos

Copy link
Copy Markdown
Contributor

Problem

Generated thread titles lose a quote when the title starts or ends with a quoted term. Models often quote a code or UI term in a title, so Rename "foo" to "bar" shows in the sidebar and header as Rename "foo" to "bar, and "Open in" menu ignores Finder as Open in" menu ignores Finder. sanitizeThreadTitle strips every leading and trailing quote, not just a pair wrapped around the whole title.

Change

The strip is now one regex that unwraps a title only when the same quote opens and closes it and does not appear in between. A title the model wrapped in quotes ("Fix login redirect") still comes out unwrapped, while a quote that belongs to a quoted term stays. This re-lands MarcoDotIO's #31254, which he closed on 2026-11-11 to save review time with the branch left for anyone; his helper loop is reduced to the one regex, and his test table is kept minus two rows that cover the same case, plus one wrapper row with an apostrophe inside.

Scope

A small fix for an obvious bug, so no issue: the sanitizer cuts a character the model returned, and the fix is one line in textGenerationUtils.ts. Found while screening closed pull requests for fixes that were never landed (#31254), and reproduced on current main before changing anything.

Verification

  • vp test run packages/provider-core/src/server/textGenerationUtils.test.ts: the new it.each fails on main in 4 rows (Explain `vp check` , "Open in" menu ignores Finder, Rename "foo" to "bar", "Open in" ignores "Finder", e.g. expected 'Rename "foo" to "bar' to be 'Rename "foo" to "bar"') and passes with the fix. The two wrapper rows ("Fix login redirect", "Fix user's login") pass on both, guarding the existing unwrapping.
  • The text-generation tests that reach the sanitizer (apps/server/src/textGeneration/, the provider packages' textGeneration.test.ts, ThreadTitleRegenerationService.test.ts) pass, 148 tests in 13 files, as do vp lint and vp run check:changed upstream/main.
  • In the real app (vp run dev --no-seed, a throwaway demo repo, a Replay (dev) turn), I added a text generator in Settings → Providers pointing at a local OpenAI-compatible stub that always answers {"title": "Rename \"foo\" to \"bar\""}, and picked it for thread titles. Only the model's reply is canned; the request, decoding, sanitizing and rendering are the app's own. On main the title came out as Rename "foo" to "bar; with the fix, a new thread with the same message came out as Rename "foo" to "bar".

Before (main):

Before: the sidebar and header show Rename "foo" to "bar without the closing quote

After (the new thread on top, the one from main below it):

After: the new thread shows Rename "foo" to "bar" with both quotes, above the earlier one from main

Not checked: a real model producing such a title, since the stub stands in for it. A title wrapped in two layers of quotes ("`x`") now loses only the outer pair, and a wrapped title with the same quote inside ("Rename "foo" to "bar"") is left as it is; no model output like either has been reported.

Claude Opus 5.5 via T3 Code

… a quoted term

The title sanitizer stripped every leading and trailing quote, so a title ending
in a quoted term, like Rename "foo" to "bar", lost its closing quote. Only a
matching quote pair around the whole title is unwrapped now. Re-lands pingdotgg#31254.

Co-authored-by: MarcoDotIO <20867620+MarcoDotIO@users.noreply.github.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 16, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 6702173

Macroscope's review found this PR approvable — Generated thread titles now preserve quotes belonging to quoted terms while still removing a simple enclosing quote pair. The change is limited to title formatting and retains existing fallback and length limits.

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

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6702173 and f3d61ce.

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

No actionable comments were generated in the recent review.

Walkthrough

sanitizeThreadTitle now removes quotes only when a matching pair encloses the full title. Added tests cover surrounding double quotes and quotes embedded within titles.

Changes: Thread title sanitization

Layer / File(s) Summary
Matching quote pair handling
packages/provider-core/src/server/textGenerationUtils.ts, packages/provider-core/src/server/textGenerationUtils.test.ts
sanitizeThreadTitle removes a matching pair of surrounding quotes instead of stripping leading and trailing quote characters independently. Tests cover whole-title double quotes and quotes embedded within titles.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#31254: Changes the same sanitizer behavior and adds tests for matching surrounding quotes and preserved interior quotes.

Suggested reviewers: saphid, juliusmarminge, macroscopeapp

Merge Risk: Minimal · previous review 67021

Generated thread titles now keep the closing quote of a quoted term while whole-title quote wrappers are still removed. The risk is minimal and the change looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: generated thread titles no longer lose the closing quote of a quoted term. It is specific, follows conventional commit form, and matches the raw summary and objectives…
Description check Passed The description follows the template well. It states the problem with examples and expected behavior, explains the one-regex change, gives scope and why no issue is needed, and includes detailed verif…
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: Title check

Explanation

The title names the main change: generated thread titles no longer lose the closing quote of a quoted term. It is specific, follows conventional commit form, and matches the raw summary and objectives, which describe the single-regex unwrapping in sanitizeThreadTitle.

Full details: Description check

Explanation

The description follows the template well. It states the problem with examples and expected behavior, explains the one-regex change, gives scope and why no issue is needed, and includes detailed verification with test names, results, and before/after screenshots. It also names the model and harness. Minor deviation: the Scope section says the fix is a small obvious bug, which the template allows, and the Problem section is clear. The description is complete and specific.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 399ea10 and 6702173.

Files selected for processing: 2

  • packages/provider-core/src/server/textGenerationUtils.test.ts
  • packages/provider-core/src/server/textGenerationUtils.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 16, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Proven with the same real-app scenario on both commits; scenarios:prove exited 0.

Fresh synthetic state, Chromium, 1280×800, light theme. Seed the custom generator configuration, create demo-project, then send three new-thread messages using Replay (dev)/Showcase. The stub returns titles containing a trailing quoted term, a leading quoted term, and a whole-title wrapper. Wait for completion and capture the sidebar and header.

Before: 45dedf2955 After: f3d61ce199
Result Both term quotes are clipped Both term quotes are preserved
Trailing quoted term Before: closing quote missing After: closing quote preserved
Leading quoted term Before: opening quote missing After: opening quote preserved
Whole-title wrapper control Before: wrapper removed After: wrapper still removed

Scenario and stub source.

Title-header recordings, cropped to exclude workspace paths: Before, After.

Not shown:

  • Settings wizard navigation and an independent SQLite read were not repeated; the scenario seeded equivalent generator settings and verified generated titles through the real web client.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 16, 2026
@juliusmarminge
juliusmarminge merged commit f083f26 into pingdotgg:main Nov 16, 2026
50 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 16, 2026
@tiliakoos
tiliakoos deleted the fix/thread-title-closing-quote branch November 16, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants