Skip to content

fix(title): handle duplicate auto-generated session titles gracefully - #50544

Closed
alloevil wants to merge 1 commit into
NousResearch:mainfrom
alloevil:fix/title-collision-auto-title
Closed

fix(title): handle duplicate auto-generated session titles gracefully#50544
alloevil wants to merge 1 commit into
NousResearch:mainfrom
alloevil:fix/title-collision-auto-title

Conversation

@alloevil

Copy link
Copy Markdown
Contributor

Summary

Changes

In agent/title_generator.pyauto_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

  • Verified that get_next_title_in_lineage() is already tested in the existing test suite
  • The fix is minimal and follows the exact approach suggested in the issue

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
@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 duplicate This issue or pull request already exists labels Jun 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #26389 — both fix #50537 with the identical mechanism: catch the ValueError title collision in auto_title_session() and retry via get_next_title_in_lineage(). #26389 (open) is the earliest version of this fix.

Related: #26471 (same-mechanism sibling, adds a test), #50538 (broader cron-title reliability PR that also closes #50537).

@alloevil alloevil closed this Jun 22, 2026
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 duplicate This issue or pull request already exists 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.

fix(title): duplicate auto-generated session titles cause unhandled ValueError

2 participants