Skip to content

fix(dashboard): show full session history safely - #59585

Open
proCaj wants to merge 1 commit into
NousResearch:mainfrom
proCaj:fix/dashboard-session-history
Open

fix(dashboard): show full session history safely#59585
proCaj wants to merge 1 commit into
NousResearch:mainfrom
proCaj:fix/dashboard-session-history

Conversation

@proCaj

@proCaj proCaj commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • add an include_compacted option for session message retrieval so dashboard history can show durable compaction-archived rows without including rewound/undone rows
  • add a dedicated /sessions/:sessionId full-history route and wire session titles/history buttons to it, keeping the play button focused on resume-in-chat
  • normalize non-string multimodal message content before rendering so session history does not crash on stored image/tool content arrays

Related 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 -q
  • npm --prefix web run build
  • git diff --check

Note: npm --prefix web run lint currently reports pre-existing repository lint errors outside this change; the build/typecheck path passes.

@alt-glitch alt-glitch added type/bug Something isn't working comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 6, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 0d5549a945d7ba320c14415840058710be0a9d3b added limit/offset to SessionDB.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 adding include_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_compacted with the existing pagination parameters and response shape.
  • Add a web regression covering the detail route and list/dict message content.

Automated hermes-sweeper review.

Comment thread hermes_state.py
def get_messages(
self, session_id: str, include_inactive: bool = False
self,
session_id: str,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread hermes_cli/web_server.py
include_compacted: bool = False,
include_inactive: bool = False,
):
db = _open_session_db_for_profile(profile)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/sessions Session lifecycle, resume, persistence, history labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants