Fix thread title generation truncating task context - #4827
Closed
its-rosetta wants to merge 1 commit into
Closed
its-rosetta wants to merge 1 commit into
its-rosetta wants to merge 1 commit into
Conversation
Contributor
|
Thanks @its-rosetta for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
brsbl
added a commit
that referenced
this pull request
Oct 4, 2026
## Human comments ## What was wrong Thread title generation sent the AI title service the same 80-column string bb uses as the fallback title, so the task was cut to 80 display columns before inference. This has been true since title generation moved to the templates package in March; #3887 kept the clamp when it split out invoked commands. Anything after the first ~80 characters never reached the model, so it guessed. In [Cole's #bugs report](https://discord.com/channels/1522478522332090528/1556018286377041980), the model only got this: ```text For the plan graph tooling, Can we show in the background of the plan graph v... ``` The thread was titled "Add back-button navigation to plan graph tools", even though the request was for a burndown chart. ## What changed - `apps/server/src/services/threads/title-generation.ts`: the title service now receives the full cleaned task (from Cole's #4827, which was auto-closed by the contributor allowlist). It is capped at 4000 display columns so a huge paste can't make titling slow or expensive. Fallback titles still fit 80 columns, and generated titles still fit 48. - `generate-thread-metadata.md`: updated the `cleanedPrompt` variable description. - Tests: added the burndown regression, a test for the 4000-column cap, wide/supplementary Unicode cases, and a long bare skill name. ## How you verified Remote CI (`@bb/server` title-generation suites). The new burndown and long-skill-name cases fail on `main`, where the task is cut at 80 columns. The cap test covers a 10,000-character paste. Original fix by @its-rosetta in #4827. BB-Thread-ID: thr_a4y66pq7d2 > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: its-rosetta <267385802+its-rosetta@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Human comments
What was wrong
buildThreadTitlePromptreused the fallback title's 80-column display limit to truncate the task sent to the AI title service. Details later in the first request disappeared before inference. For example, a request to show a plan graph's burndown chart was reduced to:The word "burndown" and the completion-history requirements occur after that cutoff. The title service needs that context to identify the requested work.
What changed
clampTitleFallbackand keep it confined to fallback title derivation. Fallback labels still fit 80 display columns; generated titles still fit 48.How you verified
The four regression cases fail against the original implementation. With this change, all 45 tests across the title-generation unit and integration suites pass, including the existing fallback-width and generated-title checks.
Verification used a fresh upstream checkout with a frozen lockfile.
npm_config_cachepointed to a private writable cache for native test dependencies.