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>
This commit is contained in:
kshitijk4poor
2026-09-27 12:12:37 +05:30
committed by kshitij
parent 0d4dbde837
commit 708bf227fd

View File

@@ -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 ───────────────────────────