Skip to content

The agent that grows with you

fix(delegate): mark elided timeout-diagnostic goal and eval tool output

Halldrix0d4dbde837e5
diff --git a/evals/session_search_schema/runner.py b/evals/session_search_schema/runner.py
index 20516488b3d..5c864c967cb 100644
--- a/evals/session_search_schema/runner.py
+++ b/evals/session_search_schema/runner.py
@@ -36,6 +36,7 @@ REPO_ROOT = EVAL_DIR.parent.parent
sys.path.insert(0, str(EVAL_DIR))
sys.path.insert(0, str(REPO_ROOT))
+from agent.compression_marker import elide # noqa: E402
from tasks import SYSTEM, TASKS # noqa: E402
ALLOWED_KEYS = {
@@ -177,7 +178,7 @@ def run_one(client, model, arm_name, arm_mod, task_id, prompt, oracle,
if was_err:
bad_calls += 1
if len(out) > 30000:
- out = out[:30000] + "...[truncated]"
+ out = elide(out, 30000)
messages.append(
{"role": "tool", "tool_call_id": tc.id, "content": out})
return {
diff --git a/tools/delegate_tool_child_run.py b/tools/delegate_tool_child_run.py
index 1da0c5d38e7..0e12ce2b679 100644
--- a/tools/delegate_tool_child_run.py
+++ b/tools/delegate_tool_child_run.py
@@ -11,6 +11,7 @@ import threading
import time
from concurrent.futures import TimeoutError as FuturesTimeoutError
from typing import Any, Dict, List, Optional
+from agent.compression_marker import elide
from agent.interrupt_compat import request_hard_interrupt
from dataclasses import dataclass, field
from tools import file_state
@@ -182,9 +183,7 @@ def _dump_subagent_timeout_diagnostic(
subagent_id = getattr(child, "_subagent_id", None) or f"idx{task_index}"
dump_path = logs_dir / f"subagent-timeout-{subagent_id}-{_dt.datetime.now().strftime('%Y%m%d_%H%M%S')}.log"
- _goal_preview = (goal or "").strip()
- if len(_goal_preview) > 1000:
- _goal_preview = _goal_preview[:1000] + " ...[truncated]"
+ _goal_preview = elide((goal or "").strip(), 1000)
def _attr_line(attr):
try:
return f" {attr}: {getattr(child, attr, None)!r}"