mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
fix(cli,gateway): surface title errors from /new <name>
The contributor's PR silently swallowed ValueError from SessionDB.set_session_title() with bare except Exception: pass. Users typing /new <title> with an already-in-use title got an untitled session and no feedback. Changes: - cli.py: catch ValueError from both sanitize_title() and set_session_title(); print the error and mark the session untitled in the banner (never echo the rejected title back). - gateway/run.py: append a warning note to the reset reply on title rejection; reflect the accepted title in the header. - Add regression tests for the duplicate-title path in CLI and gateway. Also map exx@example.com -> @exxmen in scripts/release.py.
This commit is contained in:
parent
f720751d79
commit
5b6d413476
5 changed files with 136 additions and 8 deletions
21
cli.py
21
cli.py
|
|
@ -4988,14 +4988,27 @@ class HermesCLI:
|
|||
except Exception:
|
||||
pass
|
||||
if title and self._session_db:
|
||||
from hermes_state import SessionDB
|
||||
try:
|
||||
from hermes_state import SessionDB
|
||||
sanitized = SessionDB.sanitize_title(title)
|
||||
if sanitized:
|
||||
except ValueError as e:
|
||||
_cprint(f" Title rejected: {e}")
|
||||
sanitized = None
|
||||
title = None
|
||||
if sanitized:
|
||||
try:
|
||||
self._session_db.set_session_title(self.session_id, sanitized)
|
||||
self._pending_title = None
|
||||
except Exception:
|
||||
pass
|
||||
title = sanitized
|
||||
except ValueError as e:
|
||||
_cprint(f" {e} — session started untitled.")
|
||||
title = None
|
||||
except Exception:
|
||||
title = None
|
||||
elif title is not None:
|
||||
# sanitize_title returned empty (whitespace-only / unprintable)
|
||||
_cprint(" Title is empty after cleanup — session started untitled.")
|
||||
title = None
|
||||
# Notify memory providers that session_id rotated to a fresh
|
||||
# conversation. reset=True signals providers to flush accumulated
|
||||
# per-session state (_session_turns, _turn_counter, _document_id).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue