Skip to content

fix: collapse stale compression sidebar segments#1930

Closed
ai-ag2026 wants to merge 1 commit into
nesquena:masterfrom
ai-ag2026:fix/compression-sidebar-collapse
Closed

fix: collapse stale compression sidebar segments#1930
ai-ag2026 wants to merge 1 commit into
nesquena:masterfrom
ai-ag2026:fix/compression-sidebar-collapse

Conversation

@ai-ag2026
Copy link
Copy Markdown
Contributor

Summary

  • Prefer explicit lineage metadata before the visible-parent guard when collapsing sidebar session rows.
  • Keep the subagent/fork child guard for rows without compression lineage metadata.
  • Add a regression test for stale optimistic compression segment rows that still carry parent links.

Root cause

The sidebar collapse key treated any row whose parent_session_id pointed at another visible row as a non-collapsible child/fork row. That is correct for subagent/fork sessions without lineage metadata, but automatic compression continuations also form visible parent chains when stale optimistic rows remain in browser memory during an active stream. Those compression rows already carry _lineage_root_id/lineage_root_id, so they should collapse by lineage even when parent segments are still locally visible.

Related reconnaissance

Test plan

  • node --check static/sessions.js
  • pytest -q tests/test_session_lineage_collapse.py tests/test_session_lineage_metadata_api.py -> 14 passed
  • pytest -q tests/test_gateway_sync.py tests/test_session_lineage_collapse.py tests/test_session_lineage_metadata_api.py -> 65 passed
  • git diff --check
  • Added-line static scan: 0 blocking findings; test harness eval()/console.log() matches existing source-extraction pattern and is not production code.

@ai-ag2026
Copy link
Copy Markdown
Contributor Author

Review note: this PR is intentionally independent of the long-session navigation stack (#1927-#1929).

It only addresses stale compression/sidebar lineage collapse behavior, with focused regression coverage for the stale optimistic row case. No dependency on the scroll/jump-button work.

Current state: 3/3 CI checks are green and the PR is mergeable.

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Shipped in v0.51.29 via the Release F batch (release PR #1934, merge SHA 596c6b3). Your work is now live on master.

🚀 Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.29

Thanks for the contribution!

pull Bot pushed a commit to soitun/hermes-webui that referenced this pull request May 8, 2026
pull Bot pushed a commit to soitun/hermes-webui that referenced this pull request May 8, 2026
…persistence + scroll/lineage fixes + i18n cleanup)

Six-PR contributor batch:
- PR nesquena#1919 (franksong2702): Persist login rate limit attempts (closes nesquena#1910)
- PR nesquena#1920 (franksong2702): Remove dead Kanban start i18n key
- PR nesquena#1921 (Michaelyklam): Production Docker image hardening (closes nesquena#1908)
- PR nesquena#1926 (ai-ag2026): Prevent chat scroll resets after final render
- PR nesquena#1927 (ai-ag2026): Preserve viewport when loading older messages
- PR nesquena#1930 (ai-ag2026): Collapse stale compression sidebar segments

Tests: 4947 → 4960 (+13 net new). Browser API harness all-green.
Opus advisor: SHIP-READY. CHANGELOG conflict on nesquena#1919 auto-resolved
during stage rebase (CHANGELOG took ours strategy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants