Skip to content

fix(desktop): trim session-list payloads - #60436

Closed
sitkarev wants to merge 1 commit into
NousResearch:mainfrom
sitkarev:fix/desktop-session-list-payload
Closed

fix(desktop): trim session-list payloads#60436
sitkarev wants to merge 1 commit into
NousResearch:mainfrom
sitkarev:fix/desktop-session-list-payload

Conversation

@sitkarev

@sitkarev sitkarev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • trim heavy internal system_prompt / model_config fields from /api/sessions and /api/profiles/sessions list payloads
  • keep detailed session APIs unchanged; the Desktop sidebar only needs list metadata
  • add regression coverage so large cached prompts are not serialized in session-list responses

Why

On a real Desktop profile with many long-running/compressed sessions, each sidebar refresh returned full cached prompts for ~50 rows. That made responses multi-megabyte, pegged the single hermes serve backend at ~100% CPU, and caused /api/status / navigation to time out.

Observed locally before the fix:

  • Desktop backend wedged at ~100% CPU / ~1.4GB RSS
  • /api/status timed out
  • session-list payload was ~2.2MB for 50 rows, mostly cached prompts

After the fix on the same profile:

  • /api/status: 200 in ~0.09s
  • authenticated /api/sessions?limit=50&offset=0&min_messages=1&archived=exclude&order=recent: ~64KB in ~0.26s
  • no system_prompt / model_config fields in list rows

Tests

  • uv run python -m pytest tests/hermes_cli/test_web_server.py -k 'sessions and (heavy_internal_prompt_fields or tags_default_profile or forwards_min_messages or order_recent)' -q
  • uv run python -m py_compile hermes_cli/web_server.py tests/hermes_cli/test_web_server.py

@alt-glitch alt-glitch added type/perf Performance improvement or optimization P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 7, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing in favor of #60883 (merged) — it covers this PR's field-trim (via #43653's strip + #47437's SQL-level compact_rows projection, so the blob is never even read off disk) plus messages pagination. Your diagnosis of the multi-megabyte sidebar refreshes is credited. Verified against main @ 31e39de.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants