diff --git a/CHANGELOG.md b/CHANGELOG.md index d8afb300..139ec3ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ - **PR #2293** by @franksong2702 (fixes #2237) — Docker startup no longer fails when a bind-mounted `~/.hermes/hermes-agent/.git/objects` tree contains read-only git object packs. The root init ownership pass now skips that git object subtree while still chowning the rest of `/home/hermeswebui`. macOS Docker Desktop bind mounts can now start WebUI without requiring writable ownership over agent git internals. -- **PR #2295** by @ai-ag2026 — Context-compression snapshot preservation now clears archived parent runtime fields (`active_stream_id`, `pending_user_message`, `pending_attachments`, `pending_started_at`) before saving the old session id. Pre-fix, a completed continuation session could leave its archived parent looking permanently active/running after compression (sidebar showed the parent as if it had a live in-flight turn). Continuation session's live state is restored from saved locals after the snapshot write so the active turn is not affected. Stage-359 maintainer fix integrated this runtime-clearing into the `_preserve_pre_compression_snapshot()` helper from #2285 — both PRs touch the same compression rotation block. +- **PR #2295** by @ai-ag2026 — Context-compression snapshot preservation now clears archived parent runtime fields (`active_stream_id`, `pending_user_message`, `pending_attachments`, `pending_started_at`) before saving the old session id. Pre-fix, a completed continuation session could leave its archived parent looking permanently active/running after compression (sidebar showed the parent as if it had a live in-flight turn). Continuation session's live state is restored from saved locals after the snapshot write so the active turn is not affected. Stage-359 maintainer fix integrated this runtime-clearing into the `_preserve_pre_compression_snapshot()` helper from #2285 — both PRs touch the same compression rotation block. Stage-359 Opus SHOULD-FIX applied inline: the second branch of `_preserve_pre_compression_snapshot()` (when an existing on-disk file is at-least-as-complete-as memory) now also clears runtime fields on the loaded snapshot before saving — keeps the contract symmetric so snapshot files never contain live runtime state even via the load-and-mark-only path. - **PR #2296** by @Jordan-SkyLF — Offline/recovery banner now follows the active theme palette via `--warning-*` tokens instead of mixing warning colors with a hard-coded `--bg-1` fallback. Light/custom skins (Sienna, Poseidon, etc.) no longer show a banner that looks detached from the selected palette. Behavior-neutral: offline detection and recovery flow unchanged. diff --git a/api/streaming.py b/api/streaming.py index 1f9b95d0..275888a5 100644 --- a/api/streaming.py +++ b/api/streaming.py @@ -1657,6 +1657,17 @@ def _preserve_pre_compression_snapshot(s, old_sid: str) -> None: snapshot = Session.load(old_sid) if snapshot: snapshot.pre_compression_snapshot = True + # Stage-359 Opus SHOULD-FIX: clear runtime fields on the loaded + # snapshot too. If the disk snapshot was last persisted while the + # parent was live, it could carry a stale active_stream_id / + # pending_* over to disk. The sidebar projection filters snapshot + # rows so this is latent today, but the contract should match the + # primary branch above so future readers can trust snapshot files + # to never contain live runtime state. + snapshot.active_stream_id = None + snapshot.pending_user_message = None + snapshot.pending_attachments = [] + snapshot.pending_started_at = None snapshot.save(touch_updated_at=False, skip_index=False) logger.info( "Marked pre-compression session %s as sidebar-hidden snapshot",