mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tui): /resume picker shows telegram/discord/etc sessions
Reported during TUI v2 blitz retest: /resume modal only surfaced tui/cli rows, even though `hermes --tui --resume <id>` with a pasted telegram session id works fine. The handler double-fetched with explicit `source="tui"` and `source="cli"` filters and dropped everything else on the floor. Drop the filter — list_sessions_rich(source=None) already excludes child sessions (subagents, compression continuations) via its default, and users want to resume messenger sessions from inside the TUI. Adds gateway regression coverage.
This commit is contained in:
parent
35a4b093d8
commit
0dfb7b8a0d
2 changed files with 90 additions and 6 deletions
|
|
@ -1231,12 +1231,12 @@ def _(rid, params: dict) -> dict:
|
|||
@method("session.list")
|
||||
def _(rid, params: dict) -> dict:
|
||||
try:
|
||||
db = _get_db()
|
||||
# Show both TUI and CLI sessions — TUI is the successor to the CLI,
|
||||
# so users expect to resume their old CLI sessions here too.
|
||||
tui = db.list_sessions_rich(source="tui", limit=params.get("limit", 20))
|
||||
cli = db.list_sessions_rich(source="cli", limit=params.get("limit", 20))
|
||||
rows = sorted(tui + cli, key=lambda s: s.get("started_at") or 0, reverse=True)[:params.get("limit", 20)]
|
||||
# Show sessions from every adapter — users resume telegram/discord/etc
|
||||
# sessions by pasting the id directly, so the picker should surface them
|
||||
# too. Children (subagents/compression runs) stay filtered out via the
|
||||
# hermes_state default.
|
||||
limit = params.get("limit", 20)
|
||||
rows = _get_db().list_sessions_rich(source=None, limit=limit)
|
||||
return _ok(rid, {"sessions": [
|
||||
{"id": s["id"], "title": s.get("title") or "", "preview": s.get("preview") or "",
|
||||
"started_at": s.get("started_at") or 0, "message_count": s.get("message_count") or 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue