From 30dfd4032061790f395536a4e2ab6dfbcf726594 Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Thu, 25 Jun 2026 21:40:25 +0000 Subject: [PATCH] test(#4932): re-anchor #4927 derived-rebuild slice to fallbackToolSources #4932 added a second 'const resultsByTid={}' (in _collectToolResultSnippetsByTid) EARLIER in ui.js than the renderMessages derived rebuild, so the #4927 test's UI_JS.index('const resultsByTid={};') sliced the wrong region and 4 assertions failed. Re-anchor on 'const fallbackToolSources=[];' which is unique to the derived-rebuild block. Pure test fix, no behavior change. --- tests/test_issue4927_durable_tool_snippet.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_issue4927_durable_tool_snippet.py b/tests/test_issue4927_durable_tool_snippet.py index a787813d4..128fc0bc1 100644 --- a/tests/test_issue4927_durable_tool_snippet.py +++ b/tests/test_issue4927_durable_tool_snippet.py @@ -24,11 +24,16 @@ SESSIONS_JS = (Path(__file__).parent.parent / "static" / "sessions.js").read_tex def _slice_derived_rebuild() -> str: - """Return the renderMessages fallback-rebuild region (resultsByTid block).""" - start = UI_JS.index("const resultsByTid={};") + """Return the renderMessages fallback-rebuild region (resultsByTid block). + + Anchored on `const fallbackToolSources=[];` which is unique to the + renderMessages derived-rebuild block — `const resultsByTid={};` alone is no + longer unique (the transparent-stream ordered path added its own at #4932). + """ + start = UI_JS.index("const fallbackToolSources=[];") # The region runs through the _partial_tool_calls derived push; bound it - # generously so both derived-push sites are included. - return UI_JS[start:start + 6000] + # generously so all derived-push sites are included. + return UI_JS[start:start + 7000] def test_persisted_snippet_lookup_is_built_from_session_tool_calls():