Skip to content

fix(title): auto-title extraction for tool-heavy first turns — closes #639 (PR #640 integration) - #662

Merged
nesquena-hermes merged 6 commits into
masterfrom
integrate/pr-640-title
Apr 18, 2026
Merged

nesquena-hermes merged 6 commits into
masterfrom
integrate/pr-640-title

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Integration branch for PR #640 by @franksong2702, rebased on current master (v0.50.80) with CHANGELOG and version badge updated to v0.50.81.

Original PR: #640
Independent review: @nesquena confirmed fixes in commits a553b2b + a0ca9fe.

Closes #639.

Frank Song and others added 6 commits April 18, 2026 00:25
…nge snippet

The follow-up promised in the PR review thread (treat tool-call rows
as preamble-only when content is empty or meta-reasoning) was not
actually in the pushed code — the "follow-up commit" was a no-op
rebase. The code still did `if m.get('tool_calls'): continue` which
skipped legitimate agentic first-turn plans.

Actual fix: use the existing _looks_invalid_generated_title heuristic
to distinguish preamble-only tool calls from substantive agentic
replies. Tool-call rows are now skipped only when:
  - content is empty, OR
  - content matches a known meta-reasoning pattern
    ("Let me check my memory first.", "The user is asking...", etc.)

Added the two regression tests that were also promised:
  - test_title_snippet_keeps_tool_call_with_substantive_text
  - test_title_snippet_skips_tool_call_preamble_only_rows

All 26 tests in test_sprint41.py pass; full suite 1336 passed, 0 failed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…639 (PR #640)

The auto-title extractor now uses _looks_invalid_generated_title() to distinguish
between tool-call preambles (empty/meta-reasoning content) and substantive agentic
replies. Previously any assistant message with tool_calls was skipped entirely,
causing sessions that open with memory lookups to get no meaningful title.

Also fixes _is_provisional_title() to normalize whitespace before comparing,
so CJK text truncated at 64 chars correctly re-triggers title update flow.

Includes 5 regression tests in tests/test_sprint41.py.

Co-Authored-By: franksong2702 <138988108+franksong2702@users.noreply.github.com>
Co-Authored-By: Nathan Esquenazi <nesquena@gmail.com>
@nesquena-hermes
nesquena-hermes merged commit b1aa1cf into master Apr 18, 2026
3 checks passed
@nesquena-hermes
nesquena-hermes deleted the integrate/pr-640-title branch April 18, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(sessions): auto-title still latches onto non-final assistant preambles in tool-heavy first turns

3 participants