fix(title): handle duplicate auto-generated session titles gracefully - #50544
Closed
alloevil wants to merge 1 commit into
Closed
fix(title): handle duplicate auto-generated session titles gracefully#50544alloevil wants to merge 1 commit into
alloevil wants to merge 1 commit into
Conversation
When set_session_title() raises ValueError due to a title collision, use get_next_title_in_lineage() to generate a unique variant (e.g. "Debugging Import Errors NousResearch#2") instead of silently dropping the title. Fixes NousResearch#50537
Collaborator
|
Duplicate of #26389 — both fix #50537 with the identical mechanism: catch the Related: #26471 (same-mechanism sibling, adds a test), #50538 (broader cron-title reliability PR that also closes #50537). |
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
set_session_title()raisesValueErrordue to a title collision, useget_next_title_in_lineage()to generate a unique variant (e.g. "Debugging Import Errors Support passing morph snapshot id #2") instead of silently dropping the titletitle_callbackis now called with the final title (whether original or deduplicated)Changes
In
agent/title_generator.py→auto_title_session():Before: All exceptions from
set_session_title()were caught and silently logged as debug, leaving the session with no title.After:
ValueError(title collision) is caught specifically. When it occurs,get_next_title_in_lineage()generates a unique " #N" suffix and retries. Other exceptions are still logged and silently skipped.Tests
get_next_title_in_lineage()is already tested in the existing test suite