Skip to content

fix(titles): reject answer-shaped auto-title output (port of oh-my-pi#7306) - #80829

Merged
teknium1 merged 1 commit into
mainfrom
omp-port/title-reject-answer-shaped
Aug 17, 2026
Merged

teknium1 merged 1 commit into
mainfrom
omp-port/title-reject-answer-shaped

Conversation

@teknium1

@teknium1 teknium1 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Auto-generated session titles can no longer be a truncated assistant answer: generate_title now rejects output longer than 12 words and returns None, 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

oh-my-pi this port
Bounds >80 chars OR >12 words → reject >12 words → reject; 80-char truncation kept for wordy-but-genuine titles (long identifiers/paths)
On reject defer titling to next user turn same — maybe_auto_title already fires on the first two exchanges

We 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 in generate_title
  • tests/agent/test_title_generator.py: 3 new tests (answer-shaped reject, 13-short-words reject, normal title accepted)

Validation

Before After
Full-sentence answer output stored as title, truncated at 80 chars rejected, title deferred
13 short words stored rejected
"Investigate the title resolver bug" stored stored
tests/agent/test_title_generator.py 15 passed 18 passed

Infographic

title-guard

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 6f362aa — Port from can1357/oh-my-pi#7306: reject answer-shaped auto-t

⚠️ Warnings

CI timings · View report · View job

Wall time 23m20s vs 8m (+191.7%). 11 job(s) slower, 12 faster, 1 unchanged.

  • Python tests / Run tests slice 7/12: -47.0s
  • Python tests / Run tests slice 4/12: -33.0s
  • Python tests / Run tests slice 9/12: +22.0s
  • Python tests / Run tests slice 5/12: -19.0s
  • Python tests / Run tests slice 1/12: +18.0s

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have labels Aug 7, 2026
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
teknium1 force-pushed the omp-port/title-reject-answer-shaped branch from 034f543 to 6f362aa Compare August 17, 2026 02:54
@teknium1
teknium1 merged commit d516783 into main Aug 17, 2026
45 checks passed
@teknium1
teknium1 deleted the omp-port/title-reject-answer-shaped branch August 17, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants