fix(title): auto-title extraction for tool-heavy first turns — closes #639 (PR #640 integration) - #662
Merged
Conversation
…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>
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.
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.