mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(cli): accept session ID prefixes for session actions
Resolve session IDs by exact match or unique prefix for sessions delete/export/rename so IDs copied from Preview Last Active Src ID
──────────────────────────────────────────────────────────────────────────────────────────
Search for GitHub/GitLab source repositories for 11m ago cli 20260315_034720_8e1f
[SYSTEM: The user has invoked the "minecraft-atm 1m ago cli 20260315_034035_57b6
1h ago cron cron_job-1_20260315_
[SYSTEM: The user has invoked the "hermes-agent- 9m ago cli 20260315_014304_652a
4h ago cron cron_job-1_20260314_
[The user attached an image. Here's what it cont 4h ago cli 20260314_233806_c8f3
[SYSTEM: The user has invoked the "google-worksp 1h ago cli 20260314_233301_b04f
Inspect the opencode codebase for how it sends m 4h ago cli 20260314_232543_0601
Inspect the clawdbot codebase for how it sends m 4h ago cli 20260314_232543_8125
4h ago cron cron_job-1_20260314_
Reply with exactly: smoke-ok 4h ago cli 20260314_231730_aac9
4h ago cron cron_job-1_20260314_
[SYSTEM: The user has invoked the "hermes-agent- 4h ago cli 20260314_231111_3586
[SYSTEM: The user has invoked the "hermes-agent- 4h ago cli 20260314_225551_daff
5h ago cron cron_job-1_20260314_
[SYSTEM: The user has invoked the "google-worksp 4h ago cli 20260314_224629_a9c6
k_sze — 10:34 PM Just ran hermes update and I 5h ago cli 20260314_224243_544e
5h ago cron cron_job-1_20260314_
5h ago cron cron_job-1_20260314_
5h ago cron cron_job-1_20260314_ work even when the table view truncates them. Add SessionDB prefix-resolution coverage and a CLI regression test for deleting by listed prefix.
This commit is contained in:
parent
2b8fd9a8e3
commit
621fd80b1e
4 changed files with 126 additions and 6 deletions
|
|
@ -361,6 +361,24 @@ class TestDeleteAndExport:
|
|||
def test_delete_nonexistent(self, db):
|
||||
assert db.delete_session("nope") is False
|
||||
|
||||
def test_resolve_session_id_exact(self, db):
|
||||
db.create_session(session_id="20260315_092437_c9a6ff", source="cli")
|
||||
assert db.resolve_session_id("20260315_092437_c9a6ff") == "20260315_092437_c9a6ff"
|
||||
|
||||
def test_resolve_session_id_unique_prefix(self, db):
|
||||
db.create_session(session_id="20260315_092437_c9a6ff", source="cli")
|
||||
assert db.resolve_session_id("20260315_092437_c9a6") == "20260315_092437_c9a6ff"
|
||||
|
||||
def test_resolve_session_id_ambiguous_prefix_returns_none(self, db):
|
||||
db.create_session(session_id="20260315_092437_c9a6aa", source="cli")
|
||||
db.create_session(session_id="20260315_092437_c9a6bb", source="cli")
|
||||
assert db.resolve_session_id("20260315_092437_c9a6") is None
|
||||
|
||||
def test_resolve_session_id_escapes_like_wildcards(self, db):
|
||||
db.create_session(session_id="20260315_092437_c9a6ff", source="cli")
|
||||
db.create_session(session_id="20260315X092437_c9a6ff", source="cli")
|
||||
assert db.resolve_session_id("20260315_092437") == "20260315_092437_c9a6ff"
|
||||
|
||||
def test_export_session(self, db):
|
||||
db.create_session(session_id="s1", source="cli", model="test")
|
||||
db.append_message("s1", role="user", content="Hello")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue