From 9441e32adb64e2f5751acbbb371c5fe20ae32e4f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 16 May 2026 20:11:06 +0000 Subject: [PATCH] test(stage-369): widen brittle setCompressionUi({ assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #2347 hoisted the inline state object to a `state` variable so the auto-compression handler could share it with appendLiveCompressionCard. Behavior is identical — same setCompressionUi() dispatch, same calm compression-card path — but tests/test_run_journal_frontend_static.py pinned the literal substring `setCompressionUi({` to verify the call site. Relax the assertion to accept either inline (`{...}`) or hoisted (`state`) argument form. Both forms route through the same compression card path; the over-specific substring was the bug. --- tests/test_run_journal_frontend_static.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_run_journal_frontend_static.py b/tests/test_run_journal_frontend_static.py index 773b6618..5b8ea81a 100644 --- a/tests/test_run_journal_frontend_static.py +++ b/tests/test_run_journal_frontend_static.py @@ -66,7 +66,15 @@ def test_replayed_long_task_events_enter_the_same_live_timeline_handlers(): assert "updateThinking(" in wire_block, "reasoning replay should use the live Thinking card path" assert "appendLiveToolCard(tc)" in wire_block, "tool replay should use live tool-card rendering" - assert "setCompressionUi({" in wire_block, "compression replay should use the compression card path" + # Compression replay must dispatch through setCompressionUi(...). The handler + # body may build the state object inline (`setCompressionUi({...})`) or hoist + # it into a `state` variable first (`setCompressionUi(state)`) — both forms + # use the same compression-card path, so accept either. Pinning the literal + # `{` after the open-paren was over-specific and broke in v0.51.76 when + # PR #2347 hoisted the state object to share it with `appendLiveCompressionCard`. + assert ("setCompressionUi({" in wire_block) or ("setCompressionUi(state)" in wire_block), ( + "compression replay should use the compression card path" + ) assert "_runJournalReplayParams()" in MESSAGES_SRC, "replay attachments should enter _wireSSE via EventSource"