fix(dashboard): show full session history safely - #59585
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing a real dashboard history gap. Current main preserves pre-compaction rows as active=0, compacted=1 in hermes_state.py:4070-4079, while the dashboard still loads only active rows through hermes_cli/web_server.py:9987; MessageBubble also assumes string content at web/src/pages/SessionsPage.tsx:298-335.
Problems
- This branch conflicts with current main. Since its July base, commit
0d5549a945d7ba320c14415840058710be0a9d3baddedlimit/offsettoSessionDB.get_messages(hermes_state.py:4095-4127) and pagination metadata to the endpoint (hermes_cli/web_server.py:9972-9995). The salvage must preserve that contract while addinginclude_compacted. - The added tests do not render the changed dashboard path or non-string content. The state layer explicitly returns both list content (
tests/test_hermes_state.py:1076-1106) and dict content (tests/test_hermes_state.py:1109-1116).
Suggested changes
- Compose
include_compactedwith the existing pagination parameters and response shape. - Add a web regression covering the detail route and list/dict message content.
Automated hermes-sweeper review.
| def get_messages( | ||
| self, session_id: str, include_inactive: bool = False | ||
| self, | ||
| session_id: str, |
There was a problem hiding this comment.
Current main has added limit and offset parameters to this method for the session-message pagination contract. During salvage, retain them and make include_compacted compose with pagination rather than replacing that newer signature.
| include_compacted: bool = False, | ||
| include_inactive: bool = False, | ||
| ): | ||
| db = _open_session_db_for_profile(profile) |
There was a problem hiding this comment.
Current main's endpoint now preserves limit/offset, clamps a requested limit to 500, and returns pagination metadata. Carry those fields forward when adding these history flags.
| @@ -186,6 +186,24 @@ interface CompactionSplit { | |||
| remainder: string; | |||
There was a problem hiding this comment.
Please add a browser-side regression for this normalizer through the session-detail route. The storage layer also round-trips dict-shaped content, not only content-part arrays (tests/test_hermes_state.py:1109-1116).
Summary
include_compactedoption for session message retrieval so dashboard history can show durable compaction-archived rows without including rewound/undone rows/sessions/:sessionIdfull-history route and wire session titles/history buttons to it, keeping the play button focused on resume-in-chatRelated issues
Why
The dashboard history view previously loaded only active messages. Older prompts preserved by context compaction are stored as
active=0, compacted=1, so they were missing from history even though they are durable transcript history.Some stored sessions also contain multimodal content arrays. Passing those directly into the Markdown renderer can crash the SPA with
TypeError: ...split is not a function, leaving the session page blank.Tests
python3 -m pytest tests/hermes_cli/test_session_messages_history.py tests/hermes_cli/test_web_server_session_search.py tests/hermes_cli/test_sessions_delete.py -qnpm --prefix web run buildgit diff --checkNote:
npm --prefix web run lintcurrently reports pre-existing repository lint errors outside this change; the build/typecheck path passes.