You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(provider-core): generated thread titles keep the closing quote of a quoted term - #37499
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):
After (the new thread on top, the one from main below it):
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.
… 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>
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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asRename "foo" to "bar, and"Open in" menu ignores FinderasOpen in" menu ignores Finder.sanitizeThreadTitlestrips 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 currentmainbefore changing anything.Verification
vp test run packages/provider-core/src/server/textGenerationUtils.test.ts: the newit.eachfails onmainin 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.apps/server/src/textGeneration/, the provider packages'textGeneration.test.ts,ThreadTitleRegenerationService.test.ts) pass, 148 tests in 13 files, as dovp lintandvp run check:changed upstream/main.vp run dev --no-seed, a throwawaydemorepo, aReplay (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. Onmainthe title came out asRename "foo" to "bar; with the fix, a new thread with the same message came out asRename "foo" to "bar".Before (
main):After (the new thread on top, the one from
mainbelow it):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