Fix auto chat rename for large histories#1746
Open
ruizanthony wants to merge 1 commit into
Open
Conversation
Build chat rename prompts from bounded recent messages instead of serializing full history. Validate model-generated titles and add a local fallback for forced auto rename. Refresh chat state after saving renamed contexts.
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
Fixes automatic chat renaming when chat histories are large or contain structured/tool-call messages.
The previous implementation serialised the full chat history with
history.output_text(), which can become very large and make auto rename slow or fail silently. It could also persist invalid utility-model responses such as JSON/tool-call payloads as chat titles.Changes
history.all_messages()when available.{\"headline\": \"...\"}while rejecting tool-call JSON.Verification
PYTHONPATH=/tmp/a0-pr-auto-chat-rename /a0/venv/bin/python -m py_compile extensions/python/monologue_start/_60_rename_chat.pyheadlinewrappers;