github nesquena/hermes-webui v0.51.128
v0.51.128 — Release CZ (2-PR perf + correctness)

one hour ago

Release CZ — v0.51.128 (stage-batch10, 2-PR perf + correctness batch)

What's in this batch

#2716 — Performance optimizations (@dobby-d-elf) — nesquena APPROVED

Six independent perf nudges plus one correctness fix. nesquena APPROVED on 2026-05-22; cherry-picked onto post-v0.51.127 master with sibling-PR composition resolution.

The correctness fix: Refactors the prior inline metadata-only reconciliation into _metadata_only_message_summary(sid, profile=None) helper. Pre-fix shortcut could over-count stale state.db replay rows that the merge intentionally filters out, producing false "transcript newer than loaded conversation" signals (same bug class as #2705 / #2686). Threads profile= through to preserve #2827's TLS-vs-thread profile fix.

The perf nudges:

  • Batched persisted-session checks (one glob vs N stats in all_sessions())
  • Deferred render-cache signature (no recomputation on store path)
  • Hoisted assistant tool-activity index (O(n)O(1) per-message lookup)
  • Workspace stale-session guards (loadDir + _refreshGitBadge, including the catch-path guard for late 404s)
  • Background model-catalog prime (fire-and-forget on boot)
  • Retryable failed hydration

#2830 — fix(sessions): keep pin state authoritative (@franksong2702, closes #2821)

Three coupled bugs in pin synchronization:

  • Bug A (load-bearing): /api/session/pin pre-snapshot used getattr(dict, ...) and silently returned False for dict-backed sessions. New _session_field() helper handles both.
  • Bug B: Removed stale client-side pinLimitReached short-circuit that could block legitimate pin clicks.
  • Bug C: Pin/unpin failures now refresh the sidebar from server state instead of leaving it on stale optimistic UI.

Cherry-pick mechanics for #2716

This PR had been pending merge since 2026-05-22 due to a rebase blocker against the rapidly-advancing master (10+ intervening releases). Used git apply --3way of the PR's net delta vs its original merge-base (f9302601); 12 of 14 files applied cleanly. Two files needed conflict resolution:

  1. api/routes.py: Master had been carrying an inline correctness fix; PR refactors into a helper. Resolution: took the PR's helper extraction AND added profile= threading to preserve #2827's TLS-vs-thread fix (post-PR-base master shipped #2827 which made get_state_db_session_messages profile-aware).
  2. tests/test_webui_state_db_reconciliation.py: Kept BOTH master's pre-existing test_api_session_reload_drops_stale_cached_user_tail_after_saved_assistant AND the PR's new test_metadata_fast_path_matches_reconciliation_for_restamped_replays. They pin different invariants.

Verification

  • ✅ Full pytest: 6,434 passed / 6 skipped / 3 xpassed / 8 subtests passed in 2m43s
  • ✅ Agent self-verify (per skill rule Trigger A + E):
    • _metadata_only_message_summary has profile= kwarg
    • Production call site passes profile=_session_profile
    • _session_field handles both dict and object
    • get_state_db_session_messages still accepts profile= (preserves #2827)
    • Helper executes cleanly end-to-end with unmocked invocation against a real session-load path
  • ✅ Opus pre-release advisor reviewed 6 risk areas: SHIP AS-IS — no MUST-FIX, no inline SHOULD-FIX
  • ✅ JS syntax green on all touched static/ files
  • ✅ Python syntax green on api/routes.py + api/models.py
  • ✅ Merge-marker grep clean

Follow-up issues to file (post-tag)

  1. Bug D: Startup _session_index.json rebuild perf for missing-index installs (reviewer's note on PR #2830) — only hits users on first install or after manual index deletion. Functionally correct, just slow.
  2. Test gap: Multi-profile state.db test for _metadata_only_message_summary profile threading — currently uncovered; the kwarg is mechanically obvious from the helper signature but no test pins it.

Closes

  • #2821 (pin state sync)
  • get_state_db_session_summary dead-code removed (#2716)

🤖 Generated and reviewed end-to-end by the agent pipeline (Phase 4 stage build via 3-way apply → agent self-verify → pytest gate → Opus pre-release advisor → SHIP AS-IS).

What's Changed

Full Changelog: v0.51.127...v0.51.128

Don't miss a new hermes-webui release

NewReleases is sending notifications on new releases.