Repository navigation
fix(workspace): a chat keeps its fallback title when the generator has nothing to name (#3533) - #3635
Merged
Merged
Conversation
…s nothing to name (#3533) An opener with no topic ("yo", "Run sleep 40, then say done.") made the title model describe its own inability, and that sentence was stored as the chat title ("Unable to generate title", "Unclear Initial Contact"). Both title prompts now define the reply for "nothing to title": exactly NONE. `_is_no_title` treats the sentinel and a closed set of failure phrasings as no title; `_generate_thread_title` then returns None, so nothing is stored and the derived first-line title stands. The outcome is recorded as ok, because the generator answered and three greetings in a row must leave the operator health record quiet. `title_source` stays unset, so the existing one retry on the next exchange still runs. Fixes #3533 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks
AndriiPasternak31
approved these changes
Oct 12, 2026
AndriiPasternak31
left a comment
Contributor
There was a problem hiding this comment.
Approving. This fixes #3533 on the path production actually takes (opener-only prompt, reply=""), and the one retry on the next exchange still runs because title_source stays unset.
What I checked:
- Teeth: with the guard in _generate_thread_title disabled, 5 tests go red on the title assertion itself ('NONE' / 'Unclear Initial Contact' / 'Unable to generate title…' stored, and a write landing). Mutating the sentinel check, the regex, the prompt rule or the health outcome each turns at least one test red.
- The four strings in the acceptance criteria, the release-test string "Unable to determine topic", and failure text cut at 60 chars are all dropped.
- Existing title tests (ent473, 2766, 2964, ent79, ent403, 3265, 3114) pass on the PR head and on a merge with current dev. The merge is clean.
- Nothing outside the background title task changes, and the worst case is the first line as the title, which is what we ship today.
Non-blocking, fine after 1.0:
- The open tail on the "unable to … title/topic …" form also drops real titles where the word is the subject, e.g. "Unable to create topic in Kafka" or "Cannot create title page in Word". Harmless (the first line stands), but worth anchoring.
- Paraphrases still get through, e.g. "Unable to determine specific topic", "I'm sorry, I can't generate a title", "Topic unclear", lowercase "none - greeting". The NONE rule should make them rare. If they show up, feeding the retry the exchange rather than the second message alone is the sturdier fix.
- A NONE answer records
ok. Fine for now, but an install whose model says NONE to everything would look healthy. A separate no-topic count would make that visible. - Small: worth adding the release-test case (opener "hellp" → "Unable to determine topic") to the parametrised test. It is caught today.
I haven't re-run the live model check myself; I'm relying on the sample in the PR description for how often the model answers NONE.
11 of 12 tasks
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.
Summary
NONE._is_no_titletreats the sentinel and a closed set of failure phrasings as no title._generate_thread_titlereturnsNone, nothing is stored, the derived first-line title stands, and the existing one retry on the next exchange still runs.okin the generator health record. Three greetings in a row leave the operator alert quiet.Changes
src/backend/client_portal/service.py:NONErule in_TITLE_PROMPTand_TITLE_PROMPT_OPENER,_NO_TITLE_SENTINEL,_NO_TITLE_RE,_is_no_title, one branch in_generate_thread_titletests/unit/test_3533_title_failure_text.py: newdocs/memory/feature-flows/workspace-chat-tabs-and-titles.md: one paragraphTest Plan
cd tests && pytest unit/test_3533_title_failure_text.py unit/test_ent473_chat_titles.py unit/test_ent79_portal_exposure.py: 168 passed. The new file failed 33 of 34 before the fix.NONE: 5 of 5 ("Run sleep 40, then say done.", "yo", "hi", "test", "Do it.")NONE; that chat keeps its first line as title.Run sleep 40, then say done.; tab and sidebar show the message's first line.Known limits
NONEplus punctuation is dropped; the chat keeps its first line.Fixes #3533
🤖 Generated with Claude Code