fix(titles): reject answer-shaped auto-title output (port of oh-my-pi#7306) - #80829
Merged
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 6f362aa — Port from can1357/oh-my-pi#7306: reject answer-shaped auto-t
|
A tiny title model that ignores the 3-7 word titling task and answers the user's first message instead used to have its whole reply stored (truncated at 80 chars) as the session title. Truncating an assistant blob still leaves an assistant blob — generate_title now rejects output over 12 words and returns None, letting maybe_auto_title retry on the next exchange. The 80-char truncation remains for genuine-but-wordy titles that pass the word bound.
teknium1
force-pushed
the
omp-port/title-reject-answer-shaped
branch
from
August 17, 2026 02:54
034f543 to
6f362aa
Compare
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
Auto-generated session titles can no longer be a truncated assistant answer:
generate_titlenow rejects output longer than 12 words and returnsNone, so titling retries on the next exchange instead of storing an answer blob.Port of can1357/oh-my-pi#7306 (their issue #7303): a tiny title model sometimes ignores the 3-7-word titling task and answers the user's first message instead ("I don't have context on a 'registration system' — that's not something I recognize..."). Hermes had the same failure shape — our only guards were first-non-empty-line + an 80-char truncation, so the answer's first sentence became the session title, cut mid-sentence.
Ours vs theirs
maybe_auto_titlealready fires on the first two exchangesWe keep the char-truncation path because a single 100-char token (existing
test_truncates_long_titles) is a degenerate title, not an answer — truncating it is fine; rejecting it would leave real sessions untitled.Changes
agent/title_generator.py:_MAX_TITLE_WORDS = 12+ answer-shape reject ingenerate_titletests/agent/test_title_generator.py: 3 new tests (answer-shaped reject, 13-short-words reject, normal title accepted)Validation
Infographic