@tangle-network/agent-bench 0.14.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +2 -3
- package/dist/adapters.d.ts +2 -5
- package/dist/adapters.js +3 -4
- package/dist/benchmarks/_harness.d.ts +17 -20
- package/dist/benchmarks/_harness.js +4 -4
- package/dist/benchmarks/_harness.js.map +1 -1
- package/dist/benchmarks/aec-bench.d.ts +1 -4
- package/dist/benchmarks/aec-bench.js +1 -2
- package/dist/benchmarks/agentbench.d.ts +2 -5
- package/dist/benchmarks/agentbench.js +1 -2
- package/dist/benchmarks/appworld.d.ts +8 -10
- package/dist/benchmarks/appworld.js +23 -23
- package/dist/benchmarks/appworld.js.map +1 -1
- package/dist/benchmarks/bfcl.d.ts +2 -5
- package/dist/benchmarks/bfcl.js +1 -2
- package/dist/benchmarks/cad-design.d.ts +2 -5
- package/dist/benchmarks/cad-design.js +2 -3
- package/dist/benchmarks/cad-design.js.map +1 -1
- package/dist/benchmarks/cadbench.d.ts +1 -4
- package/dist/benchmarks/cadbench.js +1 -2
- package/dist/benchmarks/cadgenbench.d.ts +1 -4
- package/dist/benchmarks/cadgenbench.js +1 -2
- package/dist/benchmarks/commit0.d.ts +2 -5
- package/dist/benchmarks/commit0.js +1 -2
- package/dist/benchmarks/crag.d.ts +1 -4
- package/dist/benchmarks/crag.js +3 -3
- package/dist/benchmarks/crag.js.map +1 -1
- package/dist/benchmarks/dabstep.d.ts +2 -5
- package/dist/benchmarks/dabstep.js +2 -3
- package/dist/benchmarks/dabstep.js.map +1 -1
- package/dist/benchmarks/enterpriseops-gym.d.ts +2 -5
- package/dist/benchmarks/enterpriseops-gym.js +1 -2
- package/dist/benchmarks/finresearchbench.d.ts +2 -5
- package/dist/benchmarks/finresearchbench.js +2 -3
- package/dist/benchmarks/finsearchcomp.d.ts +2 -5
- package/dist/benchmarks/finsearchcomp.js +4 -4
- package/dist/benchmarks/finsearchcomp.js.map +1 -1
- package/dist/benchmarks/frames.d.ts +3 -19
- package/dist/benchmarks/frames.js +13 -39
- package/dist/benchmarks/frames.js.map +1 -1
- package/dist/benchmarks/hotpotqa.d.ts +4 -14
- package/dist/benchmarks/hotpotqa.js +12 -32
- package/dist/benchmarks/hotpotqa.js.map +1 -1
- package/dist/benchmarks/humaneval.d.ts +9 -12
- package/dist/benchmarks/humaneval.js +2 -3
- package/dist/benchmarks/humaneval.js.map +1 -1
- package/dist/benchmarks/mcad-bench.d.ts +13 -16
- package/dist/benchmarks/mcad-bench.js +2 -3
- package/dist/benchmarks/mcad-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-bench.d.ts +17 -20
- package/dist/benchmarks/mcad-cq-bench.js +2 -3
- package/dist/benchmarks/mcad-cq-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-golds.d.ts +2 -5
- package/dist/benchmarks/mcad-cq-golds.js +1 -2
- package/dist/benchmarks/mcad-golds.d.ts +1 -4
- package/dist/benchmarks/mcad-golds.js +0 -1
- package/dist/benchmarks/mcad-tasks.d.ts +5 -8
- package/dist/benchmarks/mcad-tasks.js +7 -8
- package/dist/benchmarks/mcad-tasks.js.map +1 -1
- package/dist/benchmarks/mind2web.d.ts +3 -5
- package/dist/benchmarks/mind2web.js +2 -3
- package/dist/benchmarks/mind2web.js.map +1 -1
- package/dist/benchmarks/nomiracl.d.ts +1 -4
- package/dist/benchmarks/nomiracl.js +1 -2
- package/dist/benchmarks/open-rag-bench.d.ts +1 -4
- package/dist/benchmarks/open-rag-bench.js +3 -3
- package/dist/benchmarks/open-rag-bench.js.map +1 -1
- package/dist/benchmarks/programbench.d.ts +2 -5
- package/dist/benchmarks/programbench.js +1 -2
- package/dist/benchmarks/rag-shared.d.ts +30 -22
- package/dist/benchmarks/rag-shared.js +8 -2
- package/dist/benchmarks/rag-shared.js.map +1 -1
- package/dist/benchmarks/ragbench.d.ts +1 -4
- package/dist/benchmarks/ragbench.js +3 -3
- package/dist/benchmarks/ragbench.js.map +1 -1
- package/dist/benchmarks/simpleqa.d.ts +2 -18
- package/dist/benchmarks/simpleqa.js +5 -31
- package/dist/benchmarks/simpleqa.js.map +1 -1
- package/dist/benchmarks/swe-bench.d.ts +7 -10
- package/dist/benchmarks/swe-bench.js +4 -4
- package/dist/benchmarks/swe-bench.js.map +1 -1
- package/dist/benchmarks/t2-ragbench.d.ts +1 -4
- package/dist/benchmarks/t2-ragbench.js +3 -3
- package/dist/benchmarks/t2-ragbench.js.map +1 -1
- package/dist/benchmarks/tau-bench-shared.d.ts +5 -8
- package/dist/benchmarks/tau-bench-shared.js +4 -4
- package/dist/benchmarks/tau-bench-shared.js.map +1 -1
- package/dist/benchmarks/tau2-bench.d.ts +2 -5
- package/dist/benchmarks/tau2-bench.js +1 -2
- package/dist/benchmarks/tau3-banking.d.ts +1 -4
- package/dist/benchmarks/tau3-banking.js +1 -2
- package/dist/benchmarks/terminal-bench.d.ts +1 -4
- package/dist/benchmarks/terminal-bench.js +4 -4
- package/dist/benchmarks/terminal-bench.js.map +1 -1
- package/dist/benchmarks/toollm.d.ts +2 -5
- package/dist/benchmarks/toollm.js +1 -2
- package/dist/benchmarks/trata-hedge.d.ts +1 -4
- package/dist/benchmarks/trata-hedge.js +2 -3
- package/dist/benchmarks/types.d.ts +6 -9
- package/dist/benchmarks/webarena-verified.d.ts +2 -5
- package/dist/benchmarks/webarena-verified.js +1 -2
- package/dist/{cadbench-BRF-59Mt.js → cadbench-DhAndllg.js} +4 -6
- package/dist/cadbench-DhAndllg.js.map +1 -0
- package/dist/{cadgenbench-DXtGkuW3.js → cadgenbench-Tvk16YKT.js} +15 -5
- package/dist/cadgenbench-Tvk16YKT.js.map +1 -0
- package/dist/index.d.ts +8 -18
- package/dist/index.js +16 -24
- package/dist/index.js.map +1 -1
- package/dist/{router-turn-uTYO6KQ1.js → router-turn-DNbQ_GjQ.js} +2 -3
- package/dist/router-turn-DNbQ_GjQ.js.map +1 -0
- package/fixtures/pier-agent/no-model-task/pre_artifacts.sh +0 -0
- package/fixtures/pier-agent/no-model-task/tests/test.sh +0 -0
- package/package.json +10 -10
- package/pier_agents/tangle_candidate.py +15 -23
- package/scripts/run-package-tests.mjs +8 -15
- package/src/atom-mcp-e2e.mts +2 -2
- package/src/benchmarks/frames.ts +10 -44
- package/src/benchmarks/hotpotqa.ts +9 -29
- package/src/benchmarks/rag-shared.ts +12 -0
- package/src/benchmarks/simpleqa.ts +2 -36
- package/src/commit0-prereqs.sh +0 -0
- package/src/corpus-replay.mts +8 -8
- package/src/corpus-report.mts +21 -21
- package/src/corpus.test.mts +5 -5
- package/src/corpus.ts +16 -16
- package/src/directives.ts +0 -38
- package/src/examples/lean-verify.ts +1 -1
- package/src/gate.ts +7 -7
- package/src/generate-eval/certify.ts +2 -2
- package/src/index.ts +1 -0
- package/src/refine-loop.ts +5 -5
- package/src/resolve-client.ts +1 -1
- package/src/router-turn.ts +3 -11
- package/src/run-pool.ts +1 -1
- package/src/runtime-hook-recorder.ts +2 -2
- package/src/search-bench/tasks.ts +1 -1
- package/src/selector.test.mts +13 -13
- package/src/selector.ts +19 -19
- package/src/swe-bench-env.ts +4 -12
- package/src/swe-jail.ts +5 -156
- package/src/swe-structural-judge-policy.ts +3 -3
- package/src/swe-structural-policy.ts +3 -3
- package/src/swe-structural-provenance.ts +4 -4
- package/src/terminal-compare.ts +10 -10
- package/src/worker-blender.ts +2 -106
- package/src/worker-build123d.ts +2 -81
- package/tb_agents/opencode_router_agent.py +1 -1
- package/dist/cadbench-BRF-59Mt.js.map +0 -1
- package/dist/cadgenbench-DXtGkuW3.js.map +0 -1
- package/dist/router-turn-uTYO6KQ1.js.map +0 -1
- package/scripts/cadbench_prepare.py +0 -22
- package/scripts/cadgenbench_hard_parts.py +0 -48
- package/scripts/clbench_codebase_judge.py +0 -73
- package/scripts/render-gate-chart.mjs +0 -176
- package/scripts/trata-hedge/README.md +0 -57
- package/scripts/trata-hedge/run.sh +0 -64
- package/src/cloud-loop.mts +0 -156
- package/src/coordination-mcp-container-reach.mts +0 -182
- package/src/fleet.mts +0 -143
- package/src/hev-structural.mts +0 -697
- package/src/humaneval-gate.mts +0 -220
- package/src/mbpp-structural.mts +0 -676
- package/src/mcp-mount-probe.mts +0 -141
- package/src/profiles.ts +0 -128
- package/src/research-gate.mts +0 -132
- package/src/research-shot.ts +0 -144
- package/src/router-executor.ts +0 -51
- package/src/sandbox-run.ts +0 -108
- package/src/search-bench/bridge.ts +0 -182
- package/src/search-bench/export.mts +0 -0
- package/src/search-bench/parametric-check.mts +0 -78
- package/src/search-bench/profiles.ts +0 -113
- package/src/search-bench/run.mts +0 -286
- package/src/search-bench/tasks-fresh.ts +0 -688
- package/src/smoke-structural-rollout.mts +0 -415
- package/src/stats.mts +0 -90
- package/src/swe-code-improve.mts +0 -306
- package/src/swe-improve.mts +0 -284
- package/src/swe-structural.mts +0 -707
- package/src/tb-container-executor.mts +0 -266
- package/src/tb-container-executor.test.mts +0 -134
- package/src/tb-supervisor-sidecar.mts +0 -208
- package/src/trata-gepa.mts +0 -381
- package/src/trata-hedge-solve.mts +0 -81
- package/tb_agents/opencode_refine_agent.py +0 -117
- package/tb_agents/opencode_supervisor_agent.py +0 -239
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
"""Terminal-Bench opencode agent with a coordination MCP mounted into the task container."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
import shlex
|
|
6
|
-
import subprocess
|
|
7
|
-
import time
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
from terminal_bench.agents.base_agent import AgentResult
|
|
11
|
-
from terminal_bench.agents.failure_mode import FailureMode
|
|
12
|
-
from terminal_bench.terminal.tmux_session import TmuxSession
|
|
13
|
-
|
|
14
|
-
from tb_agents.opencode_router_agent import (
|
|
15
|
-
_CONTAINER_DIR,
|
|
16
|
-
OpenCodeRouterAgent,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
DOCKER_BRIDGE_GATEWAY = os.environ.get("DOCKER_BRIDGE_GATEWAY", "172.17.0.1")
|
|
20
|
-
_WORKER_CONFIG_PATH = f"{_CONTAINER_DIR}/opencode-worker.json"
|
|
21
|
-
# The sidecar entrypoint, resolved relative to the bench dir (this file is bench/tb_agents/...).
|
|
22
|
-
_BENCH_DIR = Path(__file__).resolve().parent.parent
|
|
23
|
-
_REPO_DIR = _BENCH_DIR.parent
|
|
24
|
-
_SIDECAR_TS = _BENCH_DIR / "src" / "tb-supervisor-sidecar.mts"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def _resolve_tsx() -> list[str]:
|
|
28
|
-
"""Prefer the pinned local tsx binary (no npx download / no shell hook rewrite)."""
|
|
29
|
-
for cand in (
|
|
30
|
-
_BENCH_DIR / "node_modules" / ".bin" / "tsx",
|
|
31
|
-
_REPO_DIR / "node_modules" / ".bin" / "tsx",
|
|
32
|
-
):
|
|
33
|
-
if cand.exists():
|
|
34
|
-
return [str(cand)]
|
|
35
|
-
return ["npx", "tsx"]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class OpenCodeSupervisorAgent(OpenCodeRouterAgent):
|
|
39
|
-
"""`OpenCodeRouterAgent` + a coordination MCP mounted into the in-container opencode.
|
|
40
|
-
|
|
41
|
-
Adds a host orchestration sidecar and the `mcp.coordination` config block; otherwise
|
|
42
|
-
identical to Arm A. Worker model defaults to the same model as the supervisor.
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
def __init__(self, model_name: str, *args, **kwargs):
|
|
46
|
-
super().__init__(model_name, *args, **kwargs)
|
|
47
|
-
self._mcp_port: int | None = None
|
|
48
|
-
self._sidecar: subprocess.Popen | None = None
|
|
49
|
-
self._sidecar_stdout = None
|
|
50
|
-
self._sidecar_port_file: Path | None = None
|
|
51
|
-
self._sidecar_log_file: Path | None = None
|
|
52
|
-
|
|
53
|
-
@staticmethod
|
|
54
|
-
def name() -> str:
|
|
55
|
-
return "agent-runtime-opencode-supervisor"
|
|
56
|
-
|
|
57
|
-
def _mcp_url(self) -> str:
|
|
58
|
-
return f"http://{DOCKER_BRIDGE_GATEWAY}:{self._mcp_port}/mcp"
|
|
59
|
-
|
|
60
|
-
def _build_router_config(self) -> str:
|
|
61
|
-
"""Base router config plus the coordination MCP block."""
|
|
62
|
-
config = json.loads(super()._build_router_config())
|
|
63
|
-
if self._mcp_port is not None:
|
|
64
|
-
config["mcp"] = {
|
|
65
|
-
"coordination": {
|
|
66
|
-
"type": "remote",
|
|
67
|
-
"url": self._mcp_url(),
|
|
68
|
-
"enabled": True,
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return json.dumps(config)
|
|
72
|
-
|
|
73
|
-
def _write_config_to_container(self, session: TmuxSession) -> None:
|
|
74
|
-
super()._write_config_to_container(session)
|
|
75
|
-
worker_config = OpenCodeRouterAgent._build_router_config(self)
|
|
76
|
-
session.container.exec_run(
|
|
77
|
-
[
|
|
78
|
-
"sh",
|
|
79
|
-
"-c",
|
|
80
|
-
f"printf '%s' {shlex.quote(worker_config)} > {_WORKER_CONFIG_PATH}",
|
|
81
|
-
]
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
def _resolve_container_id(self, session: TmuxSession) -> str | None:
|
|
85
|
-
return getattr(session.container, "id", None) or getattr(
|
|
86
|
-
session.container, "short_id", None
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
def _start_sidecar(self, container_id: str, logging_dir: Path | None) -> None:
|
|
90
|
-
base = logging_dir if logging_dir is not None else Path.cwd()
|
|
91
|
-
base.mkdir(parents=True, exist_ok=True)
|
|
92
|
-
self._sidecar_port_file = base / ".tb-sidecar-port"
|
|
93
|
-
self._sidecar_log_file = base / "tb-sidecar-events.jsonl"
|
|
94
|
-
self._sidecar_port_file.unlink(missing_ok=True)
|
|
95
|
-
|
|
96
|
-
env = dict(os.environ)
|
|
97
|
-
env.update(
|
|
98
|
-
{
|
|
99
|
-
"TB_TARGET_CONTAINER": container_id,
|
|
100
|
-
"OPENAI_API_KEY": self._router_api_key,
|
|
101
|
-
"OPENAI_BASE_URL": self._router_base_url,
|
|
102
|
-
"WORKER_MODEL": self._model_name,
|
|
103
|
-
"TB_SIDECAR_PORT_FILE": str(self._sidecar_port_file),
|
|
104
|
-
"TB_SIDECAR_LOG": str(self._sidecar_log_file),
|
|
105
|
-
"DOCKER_BRIDGE_GATEWAY": DOCKER_BRIDGE_GATEWAY,
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
self._sidecar_stdout = open(base / "tb-sidecar.stdout.log", "w")
|
|
109
|
-
self._logger.info("Starting orchestration sidecar for container %s", container_id)
|
|
110
|
-
self._sidecar = subprocess.Popen(
|
|
111
|
-
[*_resolve_tsx(), str(_SIDECAR_TS)],
|
|
112
|
-
cwd=str(_BENCH_DIR),
|
|
113
|
-
env=env,
|
|
114
|
-
stdout=self._sidecar_stdout,
|
|
115
|
-
stderr=subprocess.STDOUT,
|
|
116
|
-
)
|
|
117
|
-
deadline = time.time() + 60.0
|
|
118
|
-
while time.time() < deadline:
|
|
119
|
-
if self._sidecar.poll() is not None:
|
|
120
|
-
raise RuntimeError(
|
|
121
|
-
f"orchestration sidecar exited early with code {self._sidecar.returncode} "
|
|
122
|
-
f"(see {base / 'tb-sidecar.stdout.log'})"
|
|
123
|
-
)
|
|
124
|
-
if self._sidecar_port_file.exists():
|
|
125
|
-
txt = self._sidecar_port_file.read_text().strip()
|
|
126
|
-
if txt.isdigit():
|
|
127
|
-
self._mcp_port = int(txt)
|
|
128
|
-
self._logger.info(
|
|
129
|
-
"Sidecar ready: mcp port=%d url=%s", self._mcp_port, self._mcp_url()
|
|
130
|
-
)
|
|
131
|
-
return
|
|
132
|
-
time.sleep(0.5)
|
|
133
|
-
raise RuntimeError("orchestration sidecar did not publish a port within 60s")
|
|
134
|
-
|
|
135
|
-
def _stop_sidecar(self) -> None:
|
|
136
|
-
if self._sidecar is None:
|
|
137
|
-
return
|
|
138
|
-
try:
|
|
139
|
-
self._sidecar.terminate()
|
|
140
|
-
try:
|
|
141
|
-
self._sidecar.wait(timeout=30)
|
|
142
|
-
except subprocess.TimeoutExpired:
|
|
143
|
-
self._sidecar.kill()
|
|
144
|
-
except Exception as e: # noqa: BLE001 - teardown is never fatal
|
|
145
|
-
self._logger.warning("Could not stop sidecar cleanly: %s", e)
|
|
146
|
-
finally:
|
|
147
|
-
if self._sidecar_stdout is not None:
|
|
148
|
-
try:
|
|
149
|
-
self._sidecar_stdout.close()
|
|
150
|
-
except Exception: # noqa: BLE001
|
|
151
|
-
pass
|
|
152
|
-
|
|
153
|
-
def _orchestration_summary(self) -> dict:
|
|
154
|
-
summary: dict = {
|
|
155
|
-
"settled": [],
|
|
156
|
-
"worker_outputs": [],
|
|
157
|
-
"history_len": 0,
|
|
158
|
-
"worker_ran": False,
|
|
159
|
-
"worker_tokens": {"input": 0, "output": 0},
|
|
160
|
-
}
|
|
161
|
-
if self._sidecar_log_file is None:
|
|
162
|
-
return summary
|
|
163
|
-
final = Path(str(self._sidecar_log_file) + ".final.json")
|
|
164
|
-
try:
|
|
165
|
-
if final.exists():
|
|
166
|
-
data = json.loads(final.read_text())
|
|
167
|
-
settled = data.get("settled", []) or []
|
|
168
|
-
summary["settled"] = settled
|
|
169
|
-
summary["worker_outputs"] = data.get("workerOutputs", []) or []
|
|
170
|
-
summary["history_len"] = len(data.get("history", []) or [])
|
|
171
|
-
summary["worker_tokens"] = data.get(
|
|
172
|
-
"workerTokens", {"input": 0, "output": 0}
|
|
173
|
-
)
|
|
174
|
-
summary["worker_ran"] = any(
|
|
175
|
-
isinstance(w, dict) and w.get("containerId")
|
|
176
|
-
for w in summary["worker_outputs"]
|
|
177
|
-
) or len(settled) > 0
|
|
178
|
-
except Exception as e: # noqa: BLE001
|
|
179
|
-
self._logger.warning("Could not read orchestration summary: %s", e)
|
|
180
|
-
return summary
|
|
181
|
-
|
|
182
|
-
def perform_task(
|
|
183
|
-
self,
|
|
184
|
-
instruction: str,
|
|
185
|
-
session: TmuxSession,
|
|
186
|
-
logging_dir: Path | None = None,
|
|
187
|
-
) -> AgentResult:
|
|
188
|
-
container_id = self._resolve_container_id(session)
|
|
189
|
-
if not container_id:
|
|
190
|
-
self._logger.error("Could not resolve container id for supervisor sidecar.")
|
|
191
|
-
return AgentResult(failure_mode=FailureMode.UNKNOWN_AGENT_ERROR)
|
|
192
|
-
|
|
193
|
-
try:
|
|
194
|
-
self._start_sidecar(container_id, logging_dir)
|
|
195
|
-
except Exception as e: # noqa: BLE001
|
|
196
|
-
self._logger.error("Sidecar failed to start: %s", e)
|
|
197
|
-
self._mcp_port = None
|
|
198
|
-
return AgentResult(failure_mode=FailureMode.UNKNOWN_AGENT_ERROR)
|
|
199
|
-
|
|
200
|
-
try:
|
|
201
|
-
supervised_instruction = (
|
|
202
|
-
"You are the supervisor. You have an MCP server named \"coordination\" with "
|
|
203
|
-
"tools including spawn_worker(profile, task), observe_agent(workerId), "
|
|
204
|
-
"and stop(). A spawned worker runs a full coding agent INSIDE "
|
|
205
|
-
"THIS SAME container and its file changes persist here, so you may delegate "
|
|
206
|
-
"concrete sub-tasks (e.g. \"install perl and 7z\", \"crack the hash with john\") "
|
|
207
|
-
"to workers via spawn_worker, then observe_agent and check the container for their results. "
|
|
208
|
-
"Delegate independent or heavy sub-tasks to workers when useful; do the rest "
|
|
209
|
-
"yourself. Complete the task fully.\n\n"
|
|
210
|
-
f"TASK:\n{instruction}"
|
|
211
|
-
)
|
|
212
|
-
result = super().perform_task(supervised_instruction, session, logging_dir)
|
|
213
|
-
finally:
|
|
214
|
-
self._stop_sidecar()
|
|
215
|
-
|
|
216
|
-
summary = self._orchestration_summary()
|
|
217
|
-
if logging_dir is not None:
|
|
218
|
-
try:
|
|
219
|
-
(logging_dir / "orchestration-summary.json").write_text(
|
|
220
|
-
json.dumps(summary, indent=2)
|
|
221
|
-
)
|
|
222
|
-
except Exception: # noqa: BLE001
|
|
223
|
-
pass
|
|
224
|
-
self._logger.info(
|
|
225
|
-
"Arm B orchestration: workers_settled=%d history_len=%d worker_ran=%s",
|
|
226
|
-
len(summary.get("settled", [])),
|
|
227
|
-
summary.get("history_len", 0),
|
|
228
|
-
summary.get("worker_ran"),
|
|
229
|
-
)
|
|
230
|
-
wt = summary.get("worker_tokens") or {}
|
|
231
|
-
worker_in = int(wt.get("input") or 0)
|
|
232
|
-
worker_out = int(wt.get("output") or 0)
|
|
233
|
-
if result.failure_mode == FailureMode.AGENT_INSTALLATION_FAILED:
|
|
234
|
-
return result
|
|
235
|
-
return AgentResult(
|
|
236
|
-
total_input_tokens=result.total_input_tokens + worker_in,
|
|
237
|
-
total_output_tokens=result.total_output_tokens + worker_out,
|
|
238
|
-
failure_mode=result.failure_mode,
|
|
239
|
-
)
|