From 708bf227fd55c7822edff72f650a90cd1aec9e98 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:12:37 +0530 Subject: [PATCH] test(delegate): pin counted marker on elided timeout-diagnostic goal Keeps #122392's test_timeout_diagnostic_marks_long_goal_as_non_original, moved into the existing timeout-diagnostic test file and using its fixture/stub instead of a new file. Red on base (bare marker). Co-authored-by: Halldrix <12357213+Halldrix@users.noreply.github.com> --- ...st_delegate_subagent_timeout_diagnostic.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/tools/test_delegate_subagent_timeout_diagnostic.py b/tests/tools/test_delegate_subagent_timeout_diagnostic.py index a94f0a095e..05d8269626 100644 --- a/tests/tools/test_delegate_subagent_timeout_diagnostic.py +++ b/tests/tools/test_delegate_subagent_timeout_diagnostic.py @@ -112,6 +112,26 @@ class TestDumpSubagentTimeoutDiagnostic: # We assert no exception propagates — the return value is advisory. assert result is None or Path(result).exists() + def test_timeout_diagnostic_marks_long_goal_as_non_original(self, hermes_home): + # #121572: an elided goal must carry the non-imitable counted marker, + # never the bare "...[truncated]" the model could copy. + from agent.compression_marker import _COMPRESSION_MARKER_RE + from tools.delegate_tool import _dump_subagent_timeout_diagnostic + child = _StubChild() + path = _dump_subagent_timeout_diagnostic( + child=child, + task_index=0, + timeout_seconds=300.0, + duration_seconds=300.0, + worker_thread=None, + goal="g" * 1200, + ) + child.interrupt() + text = Path(path).read_text(encoding="utf-8-sig") + assert _COMPRESSION_MARKER_RE.search(text) + assert "g" * 100 in text + assert "...[truncated]" not in text + # ── _run_single_child timeout branch wiring ───────────────────────────