fix(agent): auto-deduplicate session titles on collision - #26389
Closed
02356abc wants to merge 2 commits into
Closed
fix(agent): auto-deduplicate session titles on collision#2638902356abc wants to merge 2 commits into
02356abc wants to merge 2 commits into
Conversation
7 tasks
The auto-title generator silently failed when the LLM produced a title that was already in use by another session, because SessionDB enforces a uniqueness constraint on session titles. Example: - User starts session A with \"Who are you?\" → title \"Hermes Agent Intro\" - User starts session B with \"Who are you?\" → title generation succeeds but set_session_title raises ValueError → session B remains untitled Fix: catch the ValueError in auto_title_session and fall back to get_next_title_in_lineage(), which appends a \"#N\" suffix (e.g. \"Hermes Agent Intro NousResearch#2\"). This aligns with the existing resolve_session_by_title() behaviour that already searches for numbered variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h#26389 Adds AUTHOR_MAP entry so the check-attribution CI step recognises the author of this PR. The noreply address has no numeric prefix and thus is not auto-resolved by the workflow's GitHub-noreply pattern.
02356abc
force-pushed
the
fix/auto-title-dedup
branch
from
May 16, 2026 06:46
8d77d13 to
0167a87
Compare
This was referenced Jun 22, 2026
Contributor
|
Thanks for targeting a real current-main failure: Problems
Suggested changes
Automated hermes-sweeper review. |
Contributor
|
Thanks for the contribution. Closing as a duplicate: #26471 by @JackALaing submitted the same lineage-fallback fix earlier the same day (May 15) with regression tests, and the version that ultimately landed (PR #66058, salvaging #50575) generalizes the retry into a shared helper with broader coverage. The collision → |
14 tasks
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.
What does this PR do?
Fixes a bug where auto-generated session titles silently failed when the
LLM produced a title already in use by another session, leaving the new
session untitled.
Related Issue
No existing issue found. This is a standalone bug fix.
Type of Change
Changes Made
`ValueError` from `set_session_title` when the title collides, and
fall back to `get_next_title_in_lineage()` which appends a `#N`
suffix (e.g. "Hermes Agent Intro Support passing morph snapshot id #2").
Bug Report (Reproduction)
Observed behavior:
`set_session_title` raises `ValueError: Title already in use`
Root cause: `SessionDB` enforces a uniqueness constraint on session
titles (`idx_sessions_title_unique`). The auto-title generator did not
handle collisions, so repeated greetings or identical first exchanges
would silently leave sessions untitled.
Analysis: The codebase already has infrastructure for handling
duplicate titles:
returns the latest one
However, the auto-title path (`auto_title_session`) was not using this
infrastructure — it simply gave up when `set_session_title` failed.
Fix: When a collision is detected, automatically append a `#N`
suffix using the existing `get_next_title_in_lineage()` helper. This
aligns the auto-title behaviour with `resolve_session_by_title()` and
makes the title-unique constraint workable instead of silently broken.
How to Test
Checklist