HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
fast-agent and Deep Agents Code show each step as it happens (#591)
github-actions[bot]b4d53a10d088
diff --git a/docker/entrypoint.sh b/docker/entrypoint.shindex ee8802e9..bdfff12a 100644--- a/docker/entrypoint.sh+++ b/docker/entrypoint.sh@@ -253,7 +253,7 @@ backend_bin() {opensquilla) echo "$TOOLS/opensquilla-venv/bin/opensquilla" ;;vibe) echo "$TOOLS/vibe-venv/bin/vibe" ;;docker-agent) echo "$TOOLS/bin/docker-agent" ;;- fast-agent) echo "$TOOLS/fast-agent-venv/bin/fast-agent" ;;+ fast-agent) echo "$TOOLS/fast-agent-venv/bin/fast-agent-acp" ;;dcode) echo "$TOOLS/dcode-venv/bin/dcode" ;;nanobot) echo "$TOOLS/nanobot-venv/bin/nanobot" ;;zeroclaw) echo "$TOOLS/bin/zeroclaw" ;;@@ -1213,7 +1213,7 @@ install_fast_agent() {install_unlocked_venv "fast-agent" "${HR_FAST_AGENT_BASE_PYTHON:-python3}" "$TOOLS/fast-agent-venv" "fast-agent-mcp==$fa_ver" || return 1fi# RUN what was installed and compare the version it REPORTS, and prove the two surfaces this- # backend depends on: the generic client's own env-var names and the ATIF trajectory writer.+ # backend depends on: the generic client's own env-var names and the ACP server the runner drives."$TOOLS/fast-agent-venv/bin/python" -c 'import sys, importlib.metadata as mdhave = md.version("fast-agent-mcp")@@ -1224,6 +1224,8 @@ src = open(llm_generic.__file__).read()for name in ("GENERIC_BASE_URL",):if name not in src:sys.exit("fast-agent-mcp %s no longer reads %s, which the runner sets" % (have, name))+if not any(e.name == "fast-agent-acp" for e in md.distribution("fast-agent-mcp").entry_points):+ sys.exit("fast-agent-mcp %s has no fast-agent-acp, which the runner drives" % have)' "$fa_ver" || { rm -rf "$TOOLS/fast-agent-venv"; return 1; }}@@ -1604,7 +1606,11 @@ install_backends() {echo "[harnessrouter] installing fast-agent $FAST_AGENT_PIN (Apache-2.0, version-pinned)…"try_install "fast-agent" install_fast_agent || truefi- [ -x "$TOOLS/fast-agent-venv/bin/fast-agent" ] && export HR_FAST_AGENT_BIN="$TOOLS/fast-agent-venv/bin/fast-agent"+ if [ -x "$TOOLS/fast-agent-venv/bin/fast-agent-acp" ]; then+ export HR_FAST_AGENT_ACP_BIN="$TOOLS/fast-agent-venv/bin/fast-agent-acp"+ # The driver is stdlib-only, so the agent's own interpreter runs it (dcode's arrangement).+ export HR_FAST_AGENT_PYTHON="$TOOLS/fast-agent-venv/bin/python"+ fiDCODE_PIN="${HR_DCODE_VERSION:-$DCODE_LOCKED}"if wanted dcode && [ "$("$TOOLS/dcode-venv/bin/python" -c 'import importlib.metadata as m;print(m.version("deepagents-code"))' 2>/dev/null)" != "$DCODE_PIN" ]; thendiff --git a/docs/support-matrix-notes.md b/docs/support-matrix-notes.mdindex 01c3bfb7..a45af395 100644--- a/docs/support-matrix-notes.md+++ b/docs/support-matrix-notes.md@@ -5268,3 +5268,97 @@ claude-sonnet-5.5-direct was the review instance's own row on its Anthropic connclaude-sonnet-5-5: the model claude-sonnet-5.5 names, under a second id that read as a different model. It is gonefrom the matrix, on every base (its rows are out of support-matrix-results.json), and from that instance'sconnection.++## fast-agent and Deep Agents Code show each step as it happens (0.37.1, 2026-10-26)++On 0.37.0 both bases showed "Thinking" for a whole turn and then every step at once. deepagents-code's driver+held every ACP update until `session/prompt` returned; fast-agent ran as `fast-agent go --quiet`, and its record+was read from the trajectory file after the process exited. Both now run on one ACP turn (runner/acp_turn.py)+that sends each text chunk, thought, tool call and result on as the agent reports it. fast-agent is driven over+its own ACP server, `fast-agent-acp` (0.10.47, the release 0.37.0 pinned), with the runner as the client. The+client offers the terminal capability, so fast-agent's shell tool (`execute`, recorded as `bash`) runs each+command through the runner and reports its command, output and exit code; a setup with bash switched off is not+offered the terminal. A conversation the store has and the agent will not load fails the turn with the agent's+reason instead of starting a new one.++One API turn per base on the test instance, two shell commands that each sleep 4 s and then a fixed reply,+seconds from the request (scratch probe, the SSE events as they arrived):++| Base, build | first command | its output | second command | its output | answer |+|---|---|---|---|---|---|+| fast-agent, 0.37.0 | 16.6 | 16.6 | 16.6 | 16.6 | 16.6 |+| fast-agent, 0.37.1-rc.1 | 7.5 | 11.6 | 13.0 | 17.1 | 17.9 |+| dcode, 0.37.0 | 18.6 | 18.6 | 18.6 | 18.6 | 18.6 |+| dcode, 0.37.1-rc.1 | 7.3 | 11.4 | 13.1 | 17.3 | 18.5 |++In the console, `scripts/support-matrix/ui-tool-rows-live.mjs` (two commands that each sleep 8 s, the page read+every half second; it fails a base whose steps all land in one frame), 0.37.1-rc.2: fast-agent's first command on+screen at 8.2 s, the second at 17.5 s, the answer at 26.7 s; dcode 8.2, 18.1 and 27.9, each row reading "Running+sleep 8; echo …" while its command ran. dcode's shell tool is `execute`, which the console's tool rows did not+know: its row read "Using Execute" with nothing after it. reifyui 0.18.1 reads `execute` as a shell command.++### Both columns again, on the test instance itself (0.37.1-rc.2)++Every model each base offers, five scenarios each, on the test instance with its own connections, the way a+person uses it: four workers, two per base. fast-agent: 51 of 53 models passed all five; dcode: 53 of 54. No turn+was served by another connection or as another model. The three failures were the models' own, read from each+turn's stored conversation, and each model is now off that base (`_NOT_OFFERED`, one failure as before):++- fast-agent, qwen3.8-max: answered its first turn "GPT-5.5". Its reasoning quoted an instruction, "If the user+ asks about the model being used, reply with: GPT-5.5", that is in neither its prompt (the workspace contract+ and the skill list) nor fast-agent's package (Vercel).+- fast-agent, nemotron-3-super: wrote the artifact turn's file to `/workspaces/<session>/`, its workspace without+ the `/data` it was given, was refused, wrote it to `/tmp`, which its instructions say is never collected, and+ answered DONE (Vercel). On 0.37.0 its first write missed too and its second went to the workspace.+- dcode, llama-3.3-70b: answered the recycle check DONE, the artifact turn's word, with its whole history restored+ and the word it was asked for the first message in it (OpenRouter); the failure it is off fast-agent for.++Their rows left support-matrix-results.json. The columns that change (0.37.0's in parentheses):++| Connection | fast-agent | dcode |+|---|---|---|+| Vercel AI Gateway | 50 (52) | 51 |+| OpenRouter | 51 (53) | 52 (53) |+| TokenRouter | 40 (42) | 27 |+| HarnessRouter API | 50 (52) | 44 (45) |++With four workers on the instance's four vCPUs a turn took about 40 s (fast-agent's first turns on Vercel in 0.37.0,+one base per instance: 11 to 15 s); the model's own call in qwen3.8-max's turn was 1.7 s of its 40. The same build with the instance+otherwise idle, claude-haiku-5.5 on Vercel, one pair at a time, the five scenarios: fast-agent 10.7 to 13.8 s+(0.37.0: 10.7 to 13.9 s), dcode 13.7 to 13.8 s (0.37.0: 22.8 to 27.7 s). The time was the load's, not the+protocol's.++### Steps 2 to 4 (0.37.1-rc.2, the test instance)++- fast-agent: the custom harness passed (its skill reached, its script run through the client's terminal, the MCP+ server called; it has no tool the fixture does not need, so its tool policy row still has nothing to switch+ off); the plugin matrix passed 5 of 5 (skill, stdio MCP, the rows tool, SSE and streamable HTTP); the family+ tour passed 10 of 11 families on rc.2, and the eleventh is the finding below. On rc.3, with its fix, the tour+ passed 11 of 11.+- dcode: the custom harness passed (`delete` switched off and not used); the plugin matrix passed 5 of 5; the+ family tour passed 11 of 11 families in one conversation.++hunyuan-4-preview is not served on this instance, so the tour has eleven families here, not twelve.++### A text-only model in a fast-agent conversation that holds an image++The fast-agent tour failed at its last family: nemotron-3.5-lightning's turn ended "the model refused the request",+and the provider's answer, which the turn recorded, was OpenRouter's 404 "No endpoints found that support image+input". Earlier in the same conversation gpt-5.4 had rendered its slide and called fast-agent's `attach_media` on+the preview, which puts the image into the conversation as a user message. fast-agent takes out what a model cannot+read only from a message that is new to that call; the history it stores keeps the image, and a later turn on+another model sends it again. 0.37.0's tour on this base never reached the case: its instance did not serve+nemotron-3.5-lightning.++The gateway already declares, per model, whether its channel takes images (`_TEXT_ONLY_INPUT`, until now+qwen3.7-max and glm-5.3): pi, dsh and omp are told such a model takes text only, and pi then leaves images out. nemotron-3.5-lightning joins it,+measured, and fast-agent now reads the same flag: on a turn whose model is declared text-only, the runner takes+each block that is not text out of the stored conversation before the agent loads it, as the line fast-agent+itself writes when it removes one ("[vision content was removed - <model> does not support this content type]").+A model that reads images gets the conversation as it is.++Whether a tour's model attaches an image is the model's choice, so the fix was also measured on a conversation+built to need it (0.37.1-rc.3, the test instance): gpt-5.4 on Vercel drew an 8 by 8 red PNG with its shell,+attached it and answered "Red"; the next turn, on nemotron-3.5-lightning through OpenRouter, answered "SWITCHED",+served as itself. The stored conversation holds the line in the image's place; the copy fast-agent keeps in the+tool result's `_meta` for a client to preview is not sent to the model and stays.diff --git a/docs/support-matrix-results.json b/docs/support-matrix-results.jsonindex 9caaf02e..987df5cc 100644--- a/docs/support-matrix-results.json+++ b/docs/support-matrix-results.json@@ -144143,97 +144143,6 @@},"deleted": 200},- "harnessrouter|dcode|llama-3.3-70b": {- "provider": "harnessrouter",- "harness": "dcode",- "model": "llama-3.3-70b",- "at": "2026-10-25T19:12:56.967Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 29.85,- "tail": "Reply with exactly: M1-llama-3.3-70b M1-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 26.0 s",- "answer": "M1-llama-3.3-70b",- "turn_files": [],- "why": ""- },- "sid": "hsess1f1504f45d764750ad522ba37147dd0e",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 23.93,- "tail": "Reply with exactly: M2-llama-3.3-70b M2-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 21.2 s",- "answer": "M2-llama-3.3-70b",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "done",- "pill": "done",- "s": 22.58,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol Deep Agents Code \u00b7 gpt-6.1-sol \u00b7 Done in 20.1 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 27.09,- "tail": "Create a file named hello-dcode.txt containing exactly the word HELLO, then reply DONE. Created hello-dcode.txt +1 \u22120 DONE txt hello-dcode.txt TXT Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 23.1 s",- "answer": "DONE",- "turn_files": [- "hello-dcode.txt"- ],- "why": "",- "files": [- "hello-dcode.txt"- ],- "record_files": [- "hello-dcode.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 23.5,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 20.4 s",- "answer": "M1-llama-3.3-70b",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess1f1504f45d764750ad522ba37147dd0e\",\"checkpoint_sha\":\"cd0fd0f21af413f77f7d696fec177dcfe6053b323367d9a5ab34424bbab6ee54\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:HarnessRouter API test 1",- "connections": [- "integration:HarnessRouter API test 1"- ],- "served": [- "meta-llama/llama-3.3-70b-instruct",- "gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "tokens": {- "input": 25025,- "cache_read": 51744,- "turns_with_usage": 5- },- "deleted": 200- },"harnessrouter|dcode|deepseek-v4.1-flash": {"provider": "harnessrouter","harness": "dcode",@@ -149876,97 +149785,6 @@},"deleted": 200},- "openrouter|dcode|llama-3.3-70b": {- "provider": "openrouter",- "harness": "dcode",- "model": "llama-3.3-70b",- "at": "2026-10-25T11:14:23.091Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.05,- "tail": "Reply with exactly: M1-llama-3.3-70b M1-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 16.4 s",- "answer": "M1-llama-3.3-70b",- "turn_files": [],- "why": ""- },- "sid": "hsessf689a9464e274bc19106876d411e4a9c",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 17.35,- "tail": "Reply with exactly: M2-llama-3.3-70b M2-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 15.3 s",- "answer": "M2-llama-3.3-70b",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 17.01,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol Deep Agents Code \u00b7 gpt-6.1-sol \u00b7 Done in 13.8 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.1,- "tail": "Create a file named hello-dcode.txt containing exactly the word HELLO, then reply DONE. Created hello-dcode.txt +1 \u22120 DONE txt hello-dcode.txt TXT Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 17.8 s",- "answer": "DONE",- "turn_files": [- "hello-dcode.txt"- ],- "why": "",- "files": [- "hello-dcode.txt"- ],- "record_files": [- "hello-dcode.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.01,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-llama-3.3-70b Deep Agents Code \u00b7 llama-3.3-70b \u00b7 Done in 16.3 s",- "answer": "M1-llama-3.3-70b",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsessf689a9464e274bc19106876d411e4a9c\",\"checkpoint_sha\":\"df13b29e8ecafdd83c2d1aed7514eee8e4891bc8bdcb3be7950799ff29e9c68e\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:OpenRouter",- "connections": [- "integration:OpenRouter"- ],- "served": [- "meta-llama/llama-3.3-70b-instruct",- "openai/gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "tokens": {- "input": 32038,- "cache_read": 44960,- "turns_with_usage": 5- },- "deleted": 200- },"openrouter|dcode|deepseek-v4.1-flash": {"provider": "openrouter","harness": "dcode",@@ -186635,97 +186453,6 @@},"deleted": 200},- "harnessrouter|fast-agent|qwen3.8-max": {- "provider": "harnessrouter",- "harness": "fast-agent",- "model": "qwen3.8-max",- "at": "2026-10-25T19:11:22.338Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.71,- "tail": "Reply with exactly: M1-qwen3.8-max M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 12.7 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": ""- },- "sid": "hsessf326fa70e06b497abed868167fff2dd7",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.09,- "tail": "Reply with exactly: M2-qwen3.8-max M2-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.3 s",- "answer": "M2-qwen3.8-max",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.95,- "tail": "Reply with exactly: M3-gpt-6-sol M3-gpt-6-sol fast-agent \u00b7 gpt-6-sol \u00b7 Done in 10.8 s",- "answer": "M3-gpt-6-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.24,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Used a tool, ran 2 commands DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 qwen3.8-max \u00b7 Done in 17.2 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.23,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.3 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsessf326fa70e06b497abed868167fff2dd7\",\"checkpoint_sha\":\"334ed92ca59aff360c657fbbf6b433e714e0789dd3af86f909753523a4df9471\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:HarnessRouter API test 1",- "connections": [- "integration:HarnessRouter API test 1"- ],- "served": [- "alibaba/qwen3.8-max",- "openai/gpt-6-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6-sol"- ],- "foreign": [],- "unlabelled": 0,- "tokens": {- "input": 4412,- "cache_read": 13665,- "turns_with_usage": 5- },- "deleted": 200- },"harnessrouter|fast-agent|qwen3.8-flash": {"provider": "harnessrouter","harness": "fast-agent",@@ -187454,97 +187181,6 @@},"deleted": 200},- "harnessrouter|fast-agent|nemotron-3-super": {- "provider": "harnessrouter",- "harness": "fast-agent",- "model": "nemotron-3-super",- "at": "2026-10-25T19:25:26.188Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.18,- "tail": "Reply with exactly: M1-nemotron-3-super M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 11.9 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": ""- },- "sid": "hsess9e274ec4aa174a5696030916cf7ab515",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 11,- "tail": "Reply with exactly: M2-nemotron-3-super M2-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 9.2 s",- "answer": "M2-nemotron-3-super",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.56,- "tail": "Reply with exactly: M3-gpt-6-sol M3-gpt-6-sol fast-agent \u00b7 gpt-6-sol \u00b7 Done in 12.7 s",- "answer": "M3-gpt-6-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.33,- "tail": "t.txt containing exactly the word HELLO, then reply DONE. I'll create the file hello-fast-agent.txt with exactly the word HELLO. Used Write text file Let me check the current directory and create the file in the correct location. Ran pwd Now I'll create the file in the current workspace directory. Used Write text file DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 nemotron-3-super \u00b7 Done in 15.9 s",- "answer": "I'll create the file hello-fast-agent.txt with exactly the word HELLO.\n\nLet me check the current directory and create the file in the correct location.\n\nNow I'll create the file in the current workspace directory.\n\nDONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.78,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 12.4 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess9e274ec4aa174a5696030916cf7ab515\",\"checkpoint_sha\":\"8ecbb74d423e829e8c5f479da6f0e72c8aedf3eafc189f788344469cd27e6242\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:HarnessRouter API test 1",- "connections": [- "integration:HarnessRouter API test 1"- ],- "served": [- "nvidia/nemotron-3-super-120b-a12b",- "openai/gpt-6-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6-sol"- ],- "foreign": [],- "unlabelled": 0,- "tokens": {- "input": 19755,- "cache_read": 0,- "turns_with_usage": 5- },- "deleted": 200- },"openai|fast-agent|gpt-6-sol": {"provider": "openai","harness": "fast-agent",@@ -190297,92 +189933,6 @@"unlabelled": 0,"deleted": 200},- "openrouter|fast-agent|qwen3.8-max": {- "provider": "openrouter",- "harness": "fast-agent",- "model": "qwen3.8-max",- "at": "2026-10-25T03:44:22.907Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.81,- "tail": "Reply with exactly: M1-qwen3.8-max M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 8.9 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": ""- },- "sid": "hsess2360165f7dea4fcf9a11caa010e1c0b4",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.11,- "tail": "Reply with exactly: M2-qwen3.8-max M2-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 12.1 s",- "answer": "M2-qwen3.8-max",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.03,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol fast-agent \u00b7 gpt-6.1-sol \u00b7 Done in 10.2 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 17.24,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Used Write text file DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 qwen3.8-max \u00b7 Done in 14.1 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.98,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 10.8 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess2360165f7dea4fcf9a11caa010e1c0b4\",\"checkpoint_sha\":\"a02bd6bf1abfb448924b17000cd4d09677030e3c666fde00dc5a0d275b9497fc\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:OpenRouter",- "connections": [- "integration:OpenRouter"- ],- "served": [- "qwen/qwen3.8-max-0902",- "openai/gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"openrouter|fast-agent|qwen3.8-flash": {"provider": "openrouter","harness": "fast-agent",@@ -191071,92 +190621,6 @@"unlabelled": 0,"deleted": 200},- "openrouter|fast-agent|nemotron-3-super": {- "provider": "openrouter",- "harness": "fast-agent",- "model": "nemotron-3-super",- "at": "2026-10-25T04:05:44.919Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.04,- "tail": "Reply with exactly: M1-nemotron-3-super M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 10.0 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": ""- },- "sid": "hsess768c2ae1ee4e4b1cad6ecc0ce9b8d095",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.21,- "tail": "Reply with exactly: M2-nemotron-3-super M2-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 11.6 s",- "answer": "M2-nemotron-3-super",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.77,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol fast-agent \u00b7 gpt-6.1-sol \u00b7 Done in 8.2 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 20.39,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Ran a command, used a tool DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 nemotron-3-super \u00b7 Done in 15.9 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.05,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 11.3 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess768c2ae1ee4e4b1cad6ecc0ce9b8d095\",\"checkpoint_sha\":\"6b645726ed0460a1c6316211dd5d41e276de62278d2d20196c44c3c189e436de\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:OpenRouter",- "connections": [- "integration:OpenRouter"- ],- "served": [- "nvidia/nemotron-3-super-120b-a12b",- "openai/gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"openrouter|fast-agent|gemini-4-argon": {"provider": "openrouter","harness": "fast-agent",@@ -194824,92 +194288,6 @@"unlabelled": 0,"deleted": 200},- "tokenrouter|fast-agent|qwen3.8-max": {- "provider": "tokenrouter",- "harness": "fast-agent",- "model": "qwen3.8-max",- "at": "2026-10-25T05:28:56.825Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.95,- "tail": "Reply with exactly: M1-qwen3.8-max M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.1 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": ""- },- "sid": "hsessef64ee6f4c7f4e4a95391ac0d6f76ebd",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.84,- "tail": "Reply with exactly: M2-qwen3.8-max M2-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 10.3 s",- "answer": "M2-qwen3.8-max",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6-sol",- "ok": true,- "status": "done",- "pill": "done",- "s": 12.36,- "tail": "Reply with exactly: M3-gpt-6-sol M3-gpt-6-sol fast-agent \u00b7 gpt-6-sol \u00b7 Done in 9.4 s",- "answer": "M3-gpt-6-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 22.99,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Used a tool, ran 2 commands DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 qwen3.8-max \u00b7 Done in 20.0 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.98,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.0 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsessef64ee6f4c7f4e4a95391ac0d6f76ebd\",\"checkpoint_sha\":\"0b3b680764fdef95af62c0474a23de65a84b433cf88a82b035b744f0dad7cf97\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:My TokenRouter",- "connections": [- "integration:My TokenRouter"- ],- "served": [- "qwen3.8-max",- "gpt-6-sol"- ],- "substituted": [],- "switch_served": [- "gpt-6-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"tokenrouter|fast-agent|qwen3.8-flash": {"provider": "tokenrouter","harness": "fast-agent",@@ -195598,92 +194976,6 @@"unlabelled": 0,"deleted": 200},- "tokenrouter|fast-agent|nemotron-3-super": {- "provider": "tokenrouter",- "harness": "fast-agent",- "model": "nemotron-3-super",- "at": "2026-10-25T05:43:02.923Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.72,- "tail": "Reply with exactly: M1-nemotron-3-super M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 8.8 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": ""- },- "sid": "hsess596cfdf6c4bb47c68cc58246a5802d5b",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.95,- "tail": "Reply with exactly: M2-nemotron-3-super M2-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 11.7 s",- "answer": "M2-nemotron-3-super",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.87,- "tail": "Reply with exactly: M3-gpt-6-sol M3-gpt-6-sol fast-agent \u00b7 gpt-6-sol \u00b7 Done in 11.2 s",- "answer": "M3-gpt-6-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 26.13,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Ran echo -n HELLO > hello-fast-agent.txt DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 nemotron-3-super \u00b7 Done in 22.3 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 13.91,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 9.8 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess596cfdf6c4bb47c68cc58246a5802d5b\",\"checkpoint_sha\":\"3c3dbb4d4c6d043abf74a7dc5168aa3bee51f9f403a6322ae2e8dedd52ba475f\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:My TokenRouter",- "connections": [- "integration:My TokenRouter"- ],- "served": [- "nvidia/nemotron-3-super-120b-a12b",- "gpt-6-sol"- ],- "substituted": [],- "switch_served": [- "gpt-6-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"tokenrouter|fast-agent|claude-fable-5-1": {"provider": "tokenrouter","harness": "fast-agent",@@ -199346,92 +198638,6 @@"unlabelled": 0,"deleted": 200},- "vercel|fast-agent|qwen3.8-max": {- "provider": "vercel",- "harness": "fast-agent",- "model": "qwen3.8-max",- "at": "2026-10-25T00:51:56.487Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.12,- "tail": "Reply with exactly: M1-qwen3.8-max M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.5 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": ""- },- "sid": "hsess04f988cd29574b70b1f62deb2c11d290",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.2,- "tail": "Reply with exactly: M2-qwen3.8-max M2-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 12.1 s",- "answer": "M2-qwen3.8-max",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.85,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol fast-agent \u00b7 gpt-6.1-sol \u00b7 Done in 10.6 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.01,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. Used Write text file DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 qwen3.8-max \u00b7 Done in 10.7 s",- "answer": "DONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 14.54,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-qwen3.8-max fast-agent \u00b7 qwen3.8-max \u00b7 Done in 11.8 s",- "answer": "M1-qwen3.8-max",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess04f988cd29574b70b1f62deb2c11d290\",\"checkpoint_sha\":\"ba4a57218d7058b9705135a5b6b6740f4c206a24b9cb3d2956700e299dc93af3\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:Vercel AI Gateway",- "connections": [- "integration:Vercel AI Gateway"- ],- "served": [- "alibaba/qwen3.8-max",- "openai/gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"vercel|fast-agent|qwen3.8-flash": {"provider": "vercel","harness": "fast-agent",@@ -200034,92 +199240,6 @@"unlabelled": 0,"deleted": 200},- "vercel|fast-agent|nemotron-3-super": {- "provider": "vercel",- "harness": "fast-agent",- "model": "nemotron-3-super",- "at": "2026-10-25T01:06:11.209Z",- "first": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.74,- "tail": "Reply with exactly: M1-nemotron-3-super M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 7.7 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": ""- },- "sid": "hsess24275947e01f48ffae68b24b500a356a",- "followup": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.74,- "tail": "Reply with exactly: M2-nemotron-3-super M2-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 7.1 s",- "answer": "M2-nemotron-3-super",- "turn_files": [],- "why": ""- },- "switch": {- "to": "gpt-6.1-sol",- "ok": true,- "status": "completed",- "pill": "done",- "s": 11.21,- "tail": "Reply with exactly: M3-gpt-6.1-sol M3-gpt-6.1-sol fast-agent \u00b7 gpt-6.1-sol \u00b7 Done in 8.2 s",- "answer": "M3-gpt-6.1-sol",- "turn_files": [],- "why": ""- },- "artifact": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.81,- "tail": "Create a file named hello-fast-agent.txt containing exactly the word HELLO, then reply DONE. I'll create the file hello-fast-agent.txt with the word HELLO and then reply DONE. Used Write text file Let me try writing to the current directory instead: Used Write text file DONE txt hello-fast-agent.txt TXT fast-agent \u00b7 nemotron-3-super \u00b7 Done in 9.0 s",- "answer": "I'll create the file hello-fast-agent.txt with the word HELLO and then reply DONE.\n\nLet me try writing to the current directory instead:\n\nDONE",- "turn_files": [- "hello-fast-agent.txt"- ],- "why": "",- "files": [- "hello-fast-agent.txt"- ],- "record_files": [- "hello-fast-agent.txt"- ],- "cards_agree": true- },- "recycle": {- "ok": true,- "status": "completed",- "pill": "done",- "s": 10.79,- "tail": "What exact word did I ask you to reply with in my very first message of this task? Reply with just that word. M1-nemotron-3-super fast-agent \u00b7 nemotron-3-super \u00b7 Done in 7.0 s",- "answer": "M1-nemotron-3-super",- "turn_files": [],- "why": "",- "recycled": {- "code": 200,- "body": "{\"session_id\":\"hsess24275947e01f48ffae68b24b500a356a\",\"checkpoint_sha\":\"61f8bf287812d4983f200819a4fa667cae6f3e3edd97368c694a4ecbb648ef76\",\"hydrated\":true,\"hydrate\":{\"ok\":true,\"restored\":true,\"bytes_in"- }- },- "connection": "integration:Vercel AI Gateway",- "connections": [- "integration:Vercel AI Gateway"- ],- "served": [- "nvidia/nemotron-3-super-120b-a12b",- "openai/gpt-6.1-sol"- ],- "substituted": [],- "switch_served": [- "openai/gpt-6.1-sol"- ],- "foreign": [],- "unlabelled": 0,- "deleted": 200- },"vercel|fast-agent|claude-fable-5-1": {"provider": "vercel","harness": "fast-agent",diff --git a/docs/support-matrix.md b/docs/support-matrix.mdindex 88e7f6fc..d2a2fa60 100644--- a/docs/support-matrix.md+++ b/docs/support-matrix.md@@ -2938,7 +2938,6 @@ Findings, pairs served by a connection other than the one under test or as a mod| dcode | grok-4.6 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 72% of input || dcode | grok-build-0.1 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 67% of input || dcode | kimi-k3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 50% of input |-| dcode | llama-3.3-70b | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 67% of input || dcode | mistral-medium-3.5 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 0% of input || dcode | muse-spark-1.2 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 50% of input || dcode | muse-spark-1.3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | HarnessRouter API test 1 | cache 17% of input |@@ -3049,12 +3048,10 @@ Findings, pairs served by a connection other than the one under test or as a mod| fast-agent | muse-spark-1.2 | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 34% of input || fast-agent | muse-spark-1.3 | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 18% of input || fast-agent | muse-wonder-1.0 | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 54% of input |-| fast-agent | nemotron-3-super | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 0% of input || fast-agent | nemotron-3.5-lightning | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 30% of input || fast-agent | qwen3.7-max | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 36% of input || fast-agent | qwen3.7-plus | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 52% of input || fast-agent | qwen3.8-flash | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 61% of input |-| fast-agent | qwen3.8-max | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 76% of input || fast-agent | step-3.7-flash | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 52% of input || vibe | claude-fable-5 | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | no prompt cache reads (finding below) || vibe | claude-fable-5-1 | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | no prompt cache reads (finding below) |@@ -3110,7 +3107,7 @@ Findings, pairs served by a connection other than the one under test or as a mod| vibe | qwen3.8-max | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 51% of input || vibe | step-3.7-flash | pass | pass | pass (gpt-6-sol) | pass | pass | HarnessRouter API test 1 | cache 49% of input |-203 pairs, 1015 of 1015 scenario runs passed.+200 pairs, 1000 of 1000 scenario runs passed.Findings, pairs served by a connection other than the one under test or as a model other than the id asked for:@@ -3157,7 +3154,7 @@ Findings, pairs served by a connection other than the one under test or as a mod- vibe x claude-sonnet-5: no prompt cache reads over 77462 input tokens (every call paid full price)- vibe x claude-sonnet-5.5: no prompt cache reads over 77545 input tokens (every call paid full price)-Not run in this column, 29 pairs the provider serves that the harness did not run, with the reason:+Not run in this column, 31 pairs the provider serves that the harness did not run, with the reason:- dcode x gemini-3-flash-preview: not run, this provider's connection refuses the pair for this harness (the gateway's channel rules)- dcode x gemini-3.1-pro-preview: not run, this provider's connection refuses the pair for this harness (the gateway's channel rules)@@ -3182,6 +3179,8 @@ Not run in this column, 29 pairs the provider serves that the harness did not ru- fast-agent x grok-4.5: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x hunyuan-4-preview: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x kimi-k2.7-code: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x nemotron-3-super: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x qwen3.8-max: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- vibe x claude-opus-4.7: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- vibe x deepseek-v4.1-flash: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- vibe x gpt-5.3-codex: not run, the model answers on the Responses API only and this harness speaks chat/completions only@@ -3958,7 +3957,6 @@ Not run in this column, 61 pairs the provider serves that the harness did not ru| dcode | grok-4.6 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 72% of input || dcode | grok-build-0.1 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 67% of input || dcode | kimi-k3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 67% of input |-| dcode | llama-3.3-70b | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 58% of input || dcode | mistral-medium-3.5 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 71% of input || dcode | muse-spark-1.2 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 1% of input || dcode | muse-spark-1.3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 17% of input |@@ -4102,12 +4100,10 @@ Not run in this column, 61 pairs the provider serves that the harness did not ru| fast-agent | muse-spark-1.2 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | muse-spark-1.3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | muse-wonder-1.0 | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | |-| fast-agent | nemotron-3-super | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | nemotron-3.5-lightning | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | qwen3.7-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | qwen3.7-plus | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | qwen3.8-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | |-| fast-agent | qwen3.8-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || fast-agent | step-3.7-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | || goose | claude-haiku-5.5 | pass | pass | pass (claude-haiku-4.5) | pass | pass | OpenRouter | no prompt cache reads (finding below) ; served as anthropic/claude-haiku-5.5 (the provider's alias of the same model) || goose | gpt-6.1-sol | pass | pass | pass (gpt-6-sol) | pass | pass | OpenRouter | served as openai/gpt-6.1-sol (the provider's alias of the same model) ; cache 52% of input |@@ -4383,7 +4379,7 @@ session_id: 20260913_060549_70cbeb || vibe | qwen3.8-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 53% of input || vibe | step-3.7-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | OpenRouter | cache 65% of input |-497 pairs, 2444 of 2450 scenario runs passed; 7 pairs served by another connection or as another model are findings, not counted.+494 pairs, 2429 of 2435 scenario runs passed; 7 pairs served by another connection or as another model are findings, not counted.Findings, pairs served by a connection other than the one under test or as a model other than the id asked for:@@ -4419,7 +4415,7 @@ Findings, pairs served by a connection other than the one under test or as a mod- pi x claude-haiku-5.5: no prompt cache reads over 25529 input tokens (every call paid full price)- qwen x claude-haiku-5.5: no prompt cache reads over 570679 input tokens (every call paid full price)-Not run in this column, 931 pairs the provider serves that the harness did not run, with the reason:+Not run in this column, 934 pairs the provider serves that the harness did not run, with the reason:- agentzero x claude-fable-5: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- agentzero x claude-fable-5-1: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)@@ -4735,6 +4731,7 @@ Not run in this column, 931 pairs the provider serves that the harness did not r- dcode x jev-latest: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- dcode x kimi-k2.7-code: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- dcode x ling-3.0-flash: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- dcode x llama-3.3-70b: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- dcode x llama-4-maverick: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- dcode x minimax-m3: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- dcode x muse-glimmer-30b: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)@@ -4804,9 +4801,11 @@ Not run in this column, 931 pairs the provider serves that the harness did not r- fast-agent x llama-3.3-70b: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x llama-4-maverick: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x minimax-m3: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x nemotron-3-super: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x nemotron-3-ultra: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x qwen3.7-flash: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x qwen3.8-27b: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x qwen3.8-max: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- goose x claude-fable-5: not run, not run in this column- goose x claude-fable-5-1: not run, not run in this column- goose x claude-haiku-4.5: not run, not run in this column@@ -5496,12 +5495,10 @@ Not run in this column, 931 pairs the provider serves that the harness did not r| fast-agent | grok-4.6 | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | grok-build-0.1 | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | mistral-medium-3.5 | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | |-| fast-agent | nemotron-3-super | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | nemotron-3.5-lightning | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | qwen3.7-max | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | qwen3.7-plus | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | qwen3.8-flash | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | |-| fast-agent | qwen3.8-max | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || fast-agent | step-3.7-flash | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | || goose | claude-sonnet-5.5 | pass | pass | pass (claude-sonnet-5) | pass | pass | My TokenRouter | served as claude-sonnet-5-5 (the provider's alias of the same model) ; served by another connection (finding below) || goose | gpt-6.1-sol | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | cache 52% of input |@@ -5632,7 +5629,7 @@ Not run in this column, 931 pairs the provider serves that the harness did not r| vibe | qwen3.8-max | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | cache 57% of input || vibe | step-3.7-flash | pass | pass | pass (gpt-6-sol) | pass | pass | My TokenRouter | cache 32% of input |-274 pairs, 1259 of 1261 scenario runs passed; 21 pairs served by another connection or as another model are findings, not counted.+272 pairs, 1249 of 1251 scenario runs passed; 21 pairs served by another connection or as another model are findings, not counted.Findings, pairs served by a connection other than the one under test or as a model other than the id asked for:@@ -5685,7 +5682,7 @@ Findings, pairs served by a connection other than the one under test or as a mod- vibe x claude-sonnet-5: no prompt cache reads over 77995 input tokens (every call paid full price)- vibe x claude-sonnet-5.5: no prompt cache reads over 77418 input tokens (every call paid full price)-Not run in this column, 590 pairs the provider serves that the harness did not run, with the reason:+Not run in this column, 592 pairs the provider serves that the harness did not run, with the reason:- aider x claude-fable-5: not run, not run in this column- aider x claude-fable-5-1: not run, not run in this column@@ -5973,6 +5970,8 @@ Not run in this column, 590 pairs the provider serves that the harness did not r- fast-agent x grok-4.5: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x hunyuan-4-preview: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x kimi-k2.7-code: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x nemotron-3-super: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x qwen3.8-max: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- goose x claude-fable-5: not run, not run in this column- goose x claude-fable-5-1: not run, not run in this column- goose x claude-haiku-4.5: not run, not run in this column@@ -6475,11 +6474,9 @@ Not run in this column, 590 pairs the provider serves that the harness did not r| fast-agent | muse-spark-1.2 | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | muse-spark-1.3 | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | muse-wonder-1.0 | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | |-| fast-agent | nemotron-3-super | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | qwen3.7-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | qwen3.7-plus | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | qwen3.8-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | |-| fast-agent | qwen3.8-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || fast-agent | step-3.7-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | || goose | claude-haiku-5.5 | pass | pass | pass (claude-haiku-4.5) | pass | pass | Vercel AI Gateway | no prompt cache reads (finding below) ; served as anthropic/claude-haiku-5.5 (the provider's alias of the same model) || goose | gpt-6.1-sol | pass | pass | pass (gpt-6-sol) | pass | pass | Vercel AI Gateway | served as openai/gpt-6.1-sol (the provider's alias of the same model) ; cache 62% of input |@@ -6654,7 +6651,7 @@ Not run in this column, 590 pairs the provider serves that the harness did not r| vibe | qwen3.8-max | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | cache 17% of input || vibe | step-3.7-flash | pass | pass | pass (gpt-6.1-sol) | pass | pass | Vercel AI Gateway | cache 32% of input |-371 pairs, 1748 of 1766 scenario runs passed; 9 pairs served by another connection or as another model are findings, not counted.+369 pairs, 1738 of 1756 scenario runs passed; 9 pairs served by another connection or as another model are findings, not counted.Findings, pairs served by a connection other than the one under test or as a model other than the id asked for:@@ -6690,7 +6687,7 @@ Findings, pairs served by a connection other than the one under test or as a mod- qwen x claude-haiku-5.5: no prompt cache reads over 569929 input tokens (every call paid full price)- qwen x grok-4.1-fast: served as spacexai/grok-4.1-fast-reasoning (the CLI reports the model it ran)-Not run in this column, 1040 pairs the provider serves that the harness did not run, with the reason:+Not run in this column, 1042 pairs the provider serves that the harness did not run, with the reason:- agentzero x claude-fable-5: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- agentzero x claude-fable-5-1: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)@@ -7125,9 +7122,11 @@ Not run in this column, 1040 pairs the provider serves that the harness did not- fast-agent x kimi-k2.7-code: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x ling-3.0-flash: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x minimax-m3: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x nemotron-3-super: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x nemotron-3-ultra: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x qwen3.7-flash: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- fast-agent x qwen3.8-27b: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)+- fast-agent x qwen3.8-max: not run, not in this harness's catalog (unmeasured or excluded, see the catalog's note)- goose x claude-fable-5: not run, not run in this column- goose x claude-fable-5-1: not run, not run in this column- goose x claude-haiku-4.5: not run, not run in this columndiff --git a/gateway/app.py b/gateway/app.pyindex 3e33582f..d605d443 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -8367,6 +8367,14 @@ _NOT_OFFERED: dict[str, frozenset[str]] = {# the word it was asked for (OpenRouter).# qwen3.8-27b refused its follow-up's word ("would amount to confirming a# specific version number, which I don't disclose") (HarnessRouter API).+ # qwen3.8-max answered its first turn "GPT-5.5", after reasoning that "the+ # instructions say: if the user asks about the model being used,+ # reply with: GPT-5.5"; no such line is in its prompt or in+ # fast-agent's (Vercel, 0.37.1-rc.2, the test instance's column).+ # nemotron-3-super wrote the artifact turn's file to /workspaces/<session>/ (its+ # workspace without the /data it was given), was refused, wrote it+ # to /tmp, which its instructions say is never collected, and+ # answered DONE (Vercel, 0.37.1-rc.2, the test instance's column).# dcode grok-4.5 wrote its write_file call as JSON text, 1 of 4 in sequence.# kimi-k2.7-code answered the artifact turn DONE with no tool call (Vercel).# hunyuan-4-preview a follow-up streamed until Vercel ended it, about 13 minutes@@ -8377,10 +8385,16 @@ _NOT_OFFERED: dict[str, frozenset[str]] = {# ("M1-claude-opus-4.5"), served as meta/muse-spark-1.1 (HarnessRouter# API, 0.37.0-rc.15); 4 of 4 first turns on the probe after it do not# erase a measured failure.+ # llama-3.3-70b answered the recycle check DONE, the artifact turn's word, with the+ # whole history restored and the first word its first message+ # (OpenRouter, 0.37.1-rc.2, the test instance's column); the failure it+ # is off fast-agent for."vibe": frozenset({"gpt-5.6-luna", "llama-3.3-70b", "deepseek-v4.1-flash", "claude-opus-4.7"}),"docker-agent": frozenset({"grok-build-0.1", "grok-4.5", "claude-opus-4.7", "llama-3.3-70b"}),- "fast-agent": frozenset({"grok-4.5", "llama-3.3-70b", "kimi-k2.7-code", "hunyuan-4-preview", "qwen3.8-27b"}),- "dcode": frozenset({"grok-4.5", "kimi-k2.7-code", "hunyuan-4-preview", "muse-glimmer-30b", "muse-spark-1.1"}),+ "fast-agent": frozenset({"grok-4.5", "llama-3.3-70b", "kimi-k2.7-code", "hunyuan-4-preview", "qwen3.8-27b",+ "qwen3.8-max", "nemotron-3-super"}),+ "dcode": frozenset({"grok-4.5", "kimi-k2.7-code", "hunyuan-4-preview", "muse-glimmer-30b", "muse-spark-1.1",+ "llama-3.3-70b"}),}# Muse Wonder (muse-wonder-1.0), on every base that offers the Meta family, review instance# 0.34.0-rc.7 (2026-10-15): the five scenarios passed on all 21 through OpenRouter and through Vercel;@@ -8443,12 +8457,17 @@ _BARE_MODELS = {"", "claude", "codex", "anthropic", "bedrock", "openai", "hermes# glm-5.3 -> 400 {"message":"..type is invalid, allowed values: ['text']","code":"1210"}# at the preview read; the turn died at its own verification step.# glm-5.3-flash -> the SAME task, same preview read, completed. Accepts images; NOT listed.+# 2026-10-26, through the product again (fast-agent's family tour, 0.37.1-rc.2): gpt-5.4 attached+# its rendered slide earlier in the conversation, and the nemotron-3.5-lightning turn failed:+# nemotron-3.5-lightning -> 404 "No endpoints found that support image input" (OpenRouter)# Echo sweeps never catch this class: the image only appears when a TOOL returns one.# Consumed by the pi backend: pi replays a session's image tool-results to the CURRENT model# (a cross-model conversation is one session), so a text-only channel turns every follow-up in# an image-bearing session into a hard 400. Declared text-only, pi drops the image instead —-# a degraded answer beats a dead conversation.-_TEXT_ONLY_INPUT = {"qwen3.7-max", "glm-5.3"}+# a degraded answer beats a dead conversation. dsh, omp and fast-agent read the same flag (fast-agent+# keeps an image in its history under the model that attached it; the runner takes it out of the+# stored conversation before a text-only model loads it).+_TEXT_ONLY_INPUT = {"qwen3.7-max", "glm-5.3", "nemotron-3.5-lightning"}# Union of BOTH tables' values — a dict merge would drop the bedrock ids (shared keys, anthropic# values win), silently rejecting the us.anthropic.* ids this set exists to allow._PROVIDER_CLAUDE_IDS = {v.lower() for v in [*_BEDROCK_CLAUDE.values(), *_ANTHROPIC_CLAUDE.values()]}@@ -9382,7 +9401,7 @@ async def _resp_execute(translator: _RespTranslator, *, org: str, member: str, s"idempotency_key": f"{translator.resp_id}:{name}",# token-level streaming (claude): runner adds --include-partial-messages + emits deltas"partial_messages": bool(partial_messages),- # pi: whether this model's channel takes image input (see _TEXT_ONLY_INPUT)+ # pi, dsh, omp, fast-agent: whether this model's channel takes image input (see _TEXT_ONLY_INPUT)"vision": model_req.strip().lower() not in _TEXT_ONLY_INPUT,# hermes: which integration answers its image questions (vision_analyze, browser# tools), resolved across the instance like image generation, so the capabilitydiff --git a/runner/acp_turn.py b/runner/acp_turn.pynew file mode 100644index 00000000..8b09ce02--- /dev/null+++ b/runner/acp_turn.py@@ -0,0 +1,405 @@+"""One agent turn over the Agent Client Protocol, STREAMED: the client the ACP drivers share, and the+translation of each `session/update` into claude's stream-json the moment it arrives.++WHY STREAMED. A turn's record used to be built after `session/prompt` returned: every update was+held, translated in one pass and written out at the end. The protocol was carrying each text chunk,+each tool call and each result live, and the person saw "Thinking" for the whole turn and then all+of it at once (Richard, 2026-10-26, on deepagents-code and fast-agent). Now each update is written+as it arrives: a text chunk as a small assistant text event (the gateway renders it as an+incremental output_text delta, the shape claude's partial mode takes), a thought as thinking, a+tool call as soon as its input is known, and its result when the call completes.++A loaded session replays its history as updates before the prompt is sent, so nothing is written+until `session/prompt` goes out (`Acp.recording`): a turn's record never opens with an earlier+turn's reply.++THE TERMINAL. A client that advertises `terminal` runs the agent's shell commands itself, through+`terminal/create`, `terminal/wait_for_exit`, `terminal/output`, `terminal/release` and+`terminal/kill`. fast-agent reports a command's progress and result over ACP only on that path:+measured on 0.10.47, its own local shell sends a `tool_call` with no arguments and no completion at+all, while the terminal path sends the command, then its output and exit code. The command runs+here, in the session directory, with the agent's own environment plus what the request names, as+the agent's local shell would have run it.+"""+from __future__ import annotations++import json+import os+import signal+import subprocess+import sys+import threading+from typing import Callable++_RPC_TIMEOUT = float(os.environ.get("HR_ACP_RPC_TIMEOUT", os.environ.get("HR_DCODE_RPC_TIMEOUT", "120")))+# How long the agent has to exit once its input ends, before it is killed (see Acp.close).+_END_GRACE = float(os.environ.get("HR_ACP_END_GRACE", os.environ.get("HR_DCODE_END_GRACE", "10")))+_PROMPT_TIMEOUT = float(os.environ.get("HR_ACP_PROMPT_TIMEOUT", os.environ.get("HR_DCODE_PROMPT_TIMEOUT", "7200")))+_EMIT_LOCK = threading.Lock()+++def emit(obj: dict) -> None:+ with _EMIT_LOCK:+ sys.stdout.write(json.dumps(obj, separators=(",", ":")) + "\n")+ sys.stdout.flush()+++class _Terminal:+ """One command the agent asked this client to run."""++ def __init__(self, argv: list[str], cwd: str, env: dict, limit: int) -> None:+ self.limit = max(1024, int(limit or 16000))+ self.chunks: list[bytes] = []+ self.size = 0+ self.truncated = False+ self.proc = subprocess.Popen(argv, cwd=cwd, env=env, stdin=subprocess.DEVNULL,+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,+ start_new_session=True)+ self.done = threading.Event()+ threading.Thread(target=self._read, daemon=True).start()++ def _read(self) -> None:+ for chunk in iter(lambda: self.proc.stdout.read(4096), b""): # type: ignore[union-attr]+ self.chunks.append(chunk)+ self.size += len(chunk)+ # The protocol's limit keeps the END of the output: that is where a failing command says why.+ while self.size > self.limit and len(self.chunks) > 1:+ self.size -= len(self.chunks.pop(0))+ self.truncated = True+ self.proc.wait()+ self.done.set()++ def output(self) -> str:+ data = b"".join(self.chunks)+ if len(data) > self.limit:+ data, self.truncated = data[-self.limit:], True+ return data.decode("utf-8", "replace")++ def status(self) -> dict | None:+ rc = self.proc.poll()+ if rc is None:+ return None+ return {"exitCode": rc if rc >= 0 else None, "signal": signal.Signals(-rc).name if rc < 0 else None}++ def kill(self) -> None:+ if self.proc.poll() is None:+ try:+ os.killpg(self.proc.pid, signal.SIGKILL)+ except OSError:+ pass+++class Acp:+ """A newline-delimited JSON-RPC client for one ACP agent process.++ `on_update` receives each `session/update` while `recording` is set. With `terminal=True` the+ client runs the agent's shell commands (see the module docstring); without it every request the+ agent makes but the permission one is refused by name."""++ def __init__(self, argv: list[str], cwd: str, env: dict,+ on_update: Callable[[dict], None] | None = None, terminal: bool = False) -> None:+ self.cwd = cwd+ self.env = env+ self.terminal = terminal+ self.proc = subprocess.Popen(argv, cwd=cwd, env=env, text=True, bufsize=1,+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,+ stderr=subprocess.PIPE, start_new_session=True)+ self._id = 0+ self._lock = threading.Lock()+ self._pending: dict[int, list] = {}+ self._terms: dict[str, _Terminal] = {}+ self.on_update = on_update+ self.recording = False+ self.errtail: list[str] = []+ threading.Thread(target=self._read_out, daemon=True).start()+ threading.Thread(target=self._read_err, daemon=True).start()++ # ── wire ──────────────────────────────────────────────────────────────────────────────────+ def _send(self, obj: dict) -> None:+ with self._lock:+ try:+ self.proc.stdin.write(json.dumps(obj) + "\n") # type: ignore[union-attr]+ self.proc.stdin.flush() # type: ignore[union-attr]+ except (BrokenPipeError, ValueError):+ pass++ def call(self, method: str, params: dict, timeout: float = _RPC_TIMEOUT) -> dict:+ with self._lock:+ self._id += 1+ rid = self._id+ slot = [threading.Event(), None]+ self._pending[rid] = slot+ self._send({"jsonrpc": "2.0", "id": rid, "method": method, "params": params})+ if not slot[0].wait(timeout):+ raise TimeoutError(method)+ with self._lock:+ self._pending.pop(rid, None)+ return slot[1] or {}++ def _read_out(self) -> None:+ for raw in self.proc.stdout: # type: ignore[union-attr]+ raw = raw.strip()+ if not raw:+ continue+ try:+ msg = json.loads(raw)+ except ValueError:+ continue+ if "id" in msg and ("result" in msg or "error" in msg):+ with self._lock:+ slot = self._pending.get(msg["id"])+ if slot:+ slot[1] = msg+ slot[0].set()+ continue+ if "id" in msg and "method" in msg:+ # Answered off this thread: a command's wait must not stop the updates behind it.+ threading.Thread(target=self._answer, args=(msg,), daemon=True).start()+ continue+ if msg.get("method") == "session/update" and self.recording and self.on_update:+ self.on_update((msg.get("params") or {}).get("update") or {})+ # the agent's stdout closed: wake anything still waiting rather than letting it time out+ with self._lock:+ for slot in self._pending.values():+ slot[1] = {"error": {"code": -32000, "message": "the agent closed its stream"}}+ slot[0].set()++ def close(self) -> None:+ """End the agent and WAIT until it has exited. dcode 0.2 keeps a lock on its thread for as+ long as its process lives (deepagents_code/thread_ownership.py), and the next turn of the+ conversation is another process loading that thread. MEASURED 2026-10-25, four matrix+ columns at once: a driver that sent SIGTERM and returned at once left an idle agent 1.3 to+ 1.7 s to go, two caught the signal and were still running minutes later, orphaned, and the+ turn after them was refused its own thread ("Thread … is open elsewhere"). End of input is+ how an ACP client ends the agent; one that has not gone in _END_GRACE is killed with its+ group. The runner holds the turn's result until this process exits, so the next turn starts+ only once the agent is gone. A command still running in the client's terminal goes too."""+ for t in list(self._terms.values()):+ t.kill()+ p = self.proc+ if p.poll() is None:+ try:+ p.stdin.close() # type: ignore[union-attr] (a write racing it is dropped: _send)+ except (OSError, ValueError):+ pass+ try:+ p.wait(timeout=_END_GRACE)+ return+ except subprocess.TimeoutExpired:+ pass+ try:+ os.killpg(p.pid, signal.SIGKILL)+ except OSError:+ pass+ p.wait()++ def _read_err(self) -> None:+ for raw in self.proc.stderr: # type: ignore[union-attr]+ self.errtail.append(raw.rstrip()[:400])+ del self.errtail[:-40]++ def _reply(self, msg: dict, result: dict | None = None, error: str = "") -> None:+ if error:+ self._send({"jsonrpc": "2.0", "id": msg["id"], "error": {"code": -32602, "message": error}})+ else:+ self._send({"jsonrpc": "2.0", "id": msg["id"], "result": result or {}})++ def _answer(self, msg: dict) -> None:+ """The agent's own requests. It must never be left waiting."""+ method = str(msg.get("method") or "")+ params = msg.get("params") or {}+ if method == "session/request_permission":+ # The sandbox is the trust boundary and nobody is attached to answer, so this allows:+ # the grant claude gets with --dangerously-skip-permissions.+ opts = params.get("options") or []+ pick = next((o for o in opts+ if "allow" in str(o.get("kind", "")).lower()+ or "allow" in str(o.get("optionId", "")).lower()), None)+ pick = pick or (opts[0] if opts else None)+ self._reply(msg, {"outcome": {"outcome": "selected", "optionId": pick["optionId"]}}+ if pick else {"outcome": {"outcome": "cancelled"}})+ return+ if self.terminal and method.startswith("terminal/"):+ self._terminal(msg, method, params)+ return+ # Anything else is refused by name rather than ignored: silence would hang the agent.+ self._send({"jsonrpc": "2.0", "id": msg["id"],+ "error": {"code": -32601, "message": f"this client does not implement {method}"}})++ def _terminal(self, msg: dict, method: str, params: dict) -> None:+ if method == "terminal/create":+ cmd = str(params.get("command") or "")+ if not cmd:+ self._reply(msg, error="terminal/create needs a command")+ return+ env = dict(self.env)+ for e in params.get("env") or []:+ if isinstance(e, dict) and e.get("name"):+ env[str(e["name"])] = str(e.get("value") or "")+ try:+ t = _Terminal([cmd, *[str(a) for a in (params.get("args") or [])]],+ str(params.get("cwd") or self.cwd), env, int(params.get("outputByteLimit") or 16000))+ except OSError as e:+ self._reply(msg, error=f"the command could not start: {e}")+ return+ tid = f"term-{len(self._terms) + 1}"+ self._terms[tid] = t+ self._reply(msg, {"terminalId": tid})+ return+ t = self._terms.get(str(params.get("terminalId") or ""))+ if t is None:+ self._reply(msg, error="no such terminal")+ return+ if method == "terminal/wait_for_exit":+ t.done.wait()+ self._reply(msg, t.status() or {})+ elif method == "terminal/output":+ self._reply(msg, {"output": t.output(), "truncated": t.truncated, "exitStatus": t.status()})+ elif method == "terminal/kill":+ t.kill()+ self._reply(msg, {})+ elif method == "terminal/release":+ t.kill()+ self._terms.pop(str(params.get("terminalId") or ""), None)+ self._reply(msg, {})+ else:+ self._send({"jsonrpc": "2.0", "id": msg["id"],+ "error": {"code": -32601, "message": f"this client does not implement {method}"}})+++def _text_of(u: dict) -> str:+ c = u.get("content")+ return str(c.get("text") or "") if isinstance(c, dict) else ""+++def _content_text(content) -> str:+ """The text of an ACP tool call's content blocks ({"type": "content", "content": {"type":+ "text", "text": ...}}), "" when there is none."""+ parts = []+ for item in content if isinstance(content, list) else []:+ if not isinstance(item, dict):+ continue+ inner = item.get("content") if isinstance(item.get("content"), dict) else {}+ parts.append(str(inner.get("text") or item.get("text") or ""))+ return "\n".join(p for p in parts if p)+++class Stream:+ """`session/update` → claude stream-json, written as each update arrives.++ `tool_name(title, kind)` gives a call its tool's own id: ACP carries a title for a human and a+ kind from a fixed vocabulary, and each agent fills them its own way."""++ def __init__(self, tool_name: Callable[[str, str], str], out: Callable[[dict], None] = emit) -> None:+ self.tool_name = tool_name+ self.out = out+ self.runs: list[list[str]] = [[]] # the answer's text, one list per run between tool calls+ self.calls: dict[str, dict] = {} # toolCallId → {"name", "shown", "closed"}++ def answer(self) -> str:+ return "\n".join("".join(r).strip() for r in self.runs if "".join(r).strip()).strip()++ def _call(self, cid: str, name: str, args) -> None:+ self.out({"type": "assistant", "message": {"content": [+ {"type": "tool_use", "id": cid, "name": name,+ "input": args if isinstance(args, dict) else {"input": args} if args is not None else {}}]}})++ def update(self, u: dict) -> None:+ kind = str(u.get("sessionUpdate") or "")+ if kind == "agent_message_chunk":+ t = _text_of(u)+ if t:+ self.runs[-1].append(t)+ self.out({"type": "assistant", "message": {"content": [{"type": "text", "text": t}]}})+ elif kind == "agent_thought_chunk":+ t = _text_of(u)+ if t:+ # Thinking, shown as thinking: never the answer.+ self.out({"type": "assistant", "message": {"content": [{"type": "thinking", "thinking": t}]}})+ elif kind == "tool_call":+ cid = str(u.get("toolCallId") or "tool")+ if self.runs[-1]:+ self.runs.append([])+ c = self.calls.setdefault(cid, {"name": self.tool_name(str(u.get("title") or ""), str(u.get("kind") or "")),+ "shown": False, "closed": False})+ args = u.get("rawInput")+ if isinstance(args, dict) and args:+ # The call is written once its input is known: some agents send the arguments with+ # the call (deepagents-code), others only on its first progress update (fast-agent).+ self._call(cid, c["name"], args)+ c["shown"] = True+ if str(u.get("status") or "") in ("completed", "failed"):+ self._close(cid, u)+ elif kind == "tool_call_update":+ cid = str(u.get("toolCallId") or "tool")+ c = self.calls.get(cid)+ if c is None:+ c = self.calls[cid] = {"name": self.tool_name(str(u.get("title") or ""), str(u.get("kind") or "")),+ "shown": False, "closed": False}+ args = u.get("rawInput")+ if not c["shown"] and isinstance(args, dict) and args:+ self._call(cid, c["name"], args)+ c["shown"] = True+ if str(u.get("status") or "") in ("completed", "failed"):+ self._close(cid, u)+ # plan, user_message_chunk, session_info_update, available_commands_update and the rest are+ # an IDE's progress, not the turn's record.++ def _close(self, cid: str, u: dict) -> None:+ c = self.calls[cid]+ if c["closed"]:+ return+ if not c["shown"]:+ self._call(cid, c["name"], u.get("rawInput"))+ c["shown"] = True+ c["closed"] = True+ status = str(u.get("status") or "")+ body = _content_text(u.get("content"))+ if not body and isinstance(u.get("rawOutput"), str):+ body = u["rawOutput"]+ self.out({"type": "user", "message": {"content": [+ {"type": "tool_result", "tool_use_id": cid, "is_error": status == "failed",+ "content": body[:8000]}]}})++ def finish(self) -> None:+ """A call that was never completed is closed by saying exactly that: a tool_use with no+ tool_result is a hole in the record, and claiming an outcome nobody reported is worse.+ (deepagents-code sends an edit_file with a full diff through a branch that emits the call+ and nothing after it: measured on a six-tool turn, the edit landed and the status stayed+ `pending`.)"""+ for cid, c in self.calls.items():+ if c["closed"]:+ continue+ if not c["shown"]:+ self._call(cid, c["name"], None)+ c["closed"] = True+ self.out({"type": "user", "message": {"content": [+ {"type": "tool_result", "tool_use_id": cid, "is_error": False,+ "content": f"(the agent reported no completion for this {c['name']} call)"}]}})+++def translate(updates: list[dict], tool_name: Callable[[str, str], str]) -> tuple[list[dict], str]:+ """The events a list of updates streams, and the turn's answer: Stream, collected."""+ evs: list[dict] = []+ s = Stream(tool_name, out=evs.append)+ for u in updates:+ s.update(u)+ s.finish()+ return evs, s.answer()+++def error_text(err: dict) -> str:+ """The readable reason inside a JSON-RPC error, which is not its `message`.++ A provider refusal can arrive as -32603 "Internal error" with the real thing in `data.details`,+ and that string may be the agent's own traceback with its frames joined by " / " (deepagents-code,+ MEASURED on a 401 through the relay). The first segment is the reason; the rest is the agent's+ internals, and a turn's record is not where they belong."""+ if not isinstance(err, dict):+ return "the agent reported an error"+ data = err.get("data") if isinstance(err.get("data"), dict) else {}+ text = str(data.get("details") or err.get("message") or "").strip()+ if not text:+ return "the agent reported an error"+ return text.split(" / ")[0].strip().splitlines()[0][:600]+diff --git a/runner/dcode_driver.py b/runner/dcode_driver.pyindex 593ca648..8e4abc3c 100644--- a/runner/dcode_driver.py+++ b/runner/dcode_driver.py@@ -22,7 +22,7 @@ What this driver does, and why each part is here (every claim measured on that bsession directory here, so that holds across a sandbox recycle.* A LOADED session replays its whole history as `session/update` notifications before the promptis sent. Nothing is recorded until `session/prompt` goes out, or a turn's record would open- with every earlier turn's reply (the shape fast-agent's trajectory has, in another protocol).+ with every earlier turn's reply (the shape fast-agent's trajectory had, in another protocol).* The model is NOT the `-M` flag once a session exists: the session carries its own, and`session/set_config_option(configId="model")` is the door. The flag still matters because theserver's valid-model list is built from the model THIS process resolved, so `-M` is what puts@@ -40,140 +40,12 @@ from __future__ import annotationsimport jsonimport os-import signal-import subprocessimport sys-import threadingimport time-# A client that never answers would hang the agent; a client that waits forever would hang the-# turn. Both are bounded, under the runner's own wall-clock cap.-_RPC_TIMEOUT = float(os.environ.get("HR_DCODE_RPC_TIMEOUT", "120"))-# How long the agent has to exit once its input ends, before it is killed (see Acp.close).-_END_GRACE = float(os.environ.get("HR_DCODE_END_GRACE", "10"))-_PROMPT_TIMEOUT = float(os.environ.get("HR_DCODE_PROMPT_TIMEOUT", "7200"))---def emit(obj: dict) -> None:- sys.stdout.write(json.dumps(obj, separators=(",", ":")) + "\n")- sys.stdout.flush()---class Acp:- """A newline-delimited JSON-RPC client for one `dcode --acp` process."""-- def __init__(self, argv: list[str], cwd: str, env: dict) -> None:- self.proc = subprocess.Popen(argv, cwd=cwd, env=env, text=True, bufsize=1,- stdin=subprocess.PIPE, stdout=subprocess.PIPE,- stderr=subprocess.PIPE, start_new_session=True)- self._id = 0- self._lock = threading.Lock()- self._pending: dict[int, list] = {}- self.updates: list[dict] = []- self.recording = False # see the module docstring: a load replays the conversation- self.errtail: list[str] = []- threading.Thread(target=self._read_out, daemon=True).start()- threading.Thread(target=self._read_err, daemon=True).start()-- # ── wire ──────────────────────────────────────────────────────────────────────────────────- def _send(self, obj: dict) -> None:- with self._lock:- try:- self.proc.stdin.write(json.dumps(obj) + "\n") # type: ignore[union-attr]- self.proc.stdin.flush() # type: ignore[union-attr]- except (BrokenPipeError, ValueError):- pass-- def call(self, method: str, params: dict, timeout: float = _RPC_TIMEOUT) -> dict:- with self._lock:- self._id += 1- rid = self._id- slot = [threading.Event(), None]- self._pending[rid] = slot- self._send({"jsonrpc": "2.0", "id": rid, "method": method, "params": params})- if not slot[0].wait(timeout):- raise TimeoutError(method)- with self._lock:- self._pending.pop(rid, None)- return slot[1] or {}-- def _read_out(self) -> None:- for raw in self.proc.stdout: # type: ignore[union-attr]- raw = raw.strip()- if not raw:- continue- try:- msg = json.loads(raw)- except ValueError:- continue- if "id" in msg and ("result" in msg or "error" in msg):- with self._lock:- slot = self._pending.get(msg["id"])- if slot:- slot[1] = msg- slot[0].set()- continue- if "id" in msg and "method" in msg:- self._answer(msg)- continue- if msg.get("method") == "session/update" and self.recording:- self.updates.append((msg.get("params") or {}).get("update") or {})- # the agent's stdout closed: wake anything still waiting rather than letting it time out- with self._lock:- for slot in self._pending.values():- slot[1] = {"error": {"code": -32000, "message": "the agent closed its stream"}}- slot[0].set()-- def close(self) -> None:- """End the agent and WAIT until it has exited. dcode 0.2 keeps a lock on its thread for as- long as its process lives (deepagents_code/thread_ownership.py), and the next turn of the- conversation is another process loading that thread. MEASURED 2026-10-25, four matrix- columns at once: this driver sent SIGTERM and returned at once; an idle agent took 1.3 to- 1.7 s to go, two caught the signal and were still running minutes later, orphaned, and the- turn after them was refused its own thread ("Thread … is open elsewhere"). End of input is- how an ACP client ends the agent (it exits 0 in about 1.6 s and releases the thread itself);- one that has not gone in _END_GRACE is killed with its group, and its lock goes with it.- The runner holds the turn's result until this process exits, so the next turn starts only- once the agent is gone."""- p = self.proc- if p.poll() is None:- try:- p.stdin.close() # type: ignore[union-attr] (a write racing it is dropped: _send)- except (OSError, ValueError):- pass- try:- p.wait(timeout=_END_GRACE)- return- except subprocess.TimeoutExpired:- pass- try:- os.killpg(p.pid, signal.SIGKILL)- except OSError:- pass- p.wait()-- def _read_err(self) -> None:- for raw in self.proc.stderr: # type: ignore[union-attr]- self.errtail.append(raw.rstrip()[:400])- del self.errtail[:-40]-- def _answer(self, msg: dict) -> None:- """The agent's own requests. It asks for permission; it must not be left waiting."""- method = str(msg.get("method") or "")- if method == "session/request_permission":- opts = ((msg.get("params") or {}).get("options") or [])- pick = next((o for o in opts- if "allow" in str(o.get("kind", "")).lower()- or "allow" in str(o.get("optionId", "")).lower()), None)- pick = pick or (opts[0] if opts else None)- result = ({"outcome": {"outcome": "selected", "optionId": pick["optionId"]}}- if pick else {"outcome": {"outcome": "cancelled"}})- self._send({"jsonrpc": "2.0", "id": msg["id"], "result": result})- return- # Anything else — a filesystem or terminal request — is refused by name rather than- # ignored: this client advertises neither capability, and silence would hang the agent.- self._send({"jsonrpc": "2.0", "id": msg["id"],- "error": {"code": -32601, "message": f"this client does not implement {method}"}})+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+from acp_turn import Acp, Stream, emit, error_text, _PROMPT_TIMEOUT # noqa: E402+import acp_turn # noqa: E402# The tools whose own name the server sends as the call's title. Everything else it renames for a@@ -203,83 +75,9 @@ def _tool_name(title: str, kind: str) -> str:return title or kind or "tool"-def error_text(err: dict) -> str:- """The readable reason inside a JSON-RPC error, which is not its `message`.-- A provider refusal arrives as -32603 "Internal error" with the real thing in `data.details`,- and that string is this agent's own traceback with its frames joined by " / " — MEASURED on a- 401 through the relay: `Error code: 401 - {...'Authentication failed'...} / raise- OpenAIAuthenticationError( / langchain_openai...OpenAIAuthenticationError: ... / During task- with name 'model'`. The first segment is the reason; the rest is the agent's internals, and a- turn's record is not where they belong."""- if not isinstance(err, dict):- return "the agent reported an error"- data = err.get("data") if isinstance(err.get("data"), dict) else {}- text = str(data.get("details") or err.get("message") or "").strip()- if not text:- return "the agent reported an error"- return text.split(" / ")[0].strip().splitlines()[0][:600]--def translate(updates: list[dict]) -> tuple[list[dict], str]:- """ACP session updates → canonical claude events, and the turn's answer.-- Text arrives in chunks; they are joined into one block per run of them and flushed when a tool- call interrupts, so the transcript keeps the order the reader saw."""- evs: list[dict] = []- buf: list[str] = []- final: list[str] = []- calls: dict[str, str] = {}-- def flush() -> None:- text = "".join(buf).strip()- buf.clear()- if text:- final.append(text)- evs.append({"type": "assistant", "message": {"content": [- {"type": "text", "text": text}]}})-- for u in updates:- kind = str(u.get("sessionUpdate") or "")- if kind == "agent_message_chunk":- buf.append(str((u.get("content") or {}).get("text") or ""))- elif kind == "tool_call":- flush()- cid = str(u.get("toolCallId") or "tool")- name = _tool_name(str(u.get("title") or ""), str(u.get("kind") or ""))- calls[cid] = name- args = u.get("rawInput")- evs.append({"type": "assistant", "message": {"content": [- {"type": "tool_use", "id": cid, "name": name,- "input": args if isinstance(args, dict) else {"input": args}}]}})- elif kind == "tool_call_update":- status = str(u.get("status") or "")- if status not in ("completed", "failed"):- continue # pending / in_progress: the call row already said so- cid = str(u.get("toolCallId") or "tool")- calls.pop(cid, None)- parts = []- for item in (u.get("content") or []):- if not isinstance(item, dict):- continue- inner = item.get("content") if isinstance(item.get("content"), dict) else {}- parts.append(str(inner.get("text") or item.get("text") or ""))- evs.append({"type": "user", "message": {"content": [- {"type": "tool_result", "tool_use_id": cid, "is_error": status == "failed",- "content": "\n".join(p for p in parts if p)[:8000]}]}})- # agent_thought_chunk, plan, user_message_chunk, current_mode_update: progress, not the- # turn's record. The thought chunks are deliberately not rendered as the answer.- flush()- for cid, name in calls.items():- # One call in this protocol never gets a completion: an edit_file with a full diff is sent- # through the server's `start_edit_tool_call` branch, which emits the call and nothing- # after it (measured on a six-tool turn — the edit landed, the status stayed `pending`).- # A tool_use with no tool_result is a hole in the record, so it is closed by saying exactly- # that rather than by claiming an outcome nobody reported.- evs.append({"type": "user", "message": {"content": [- {"type": "tool_result", "tool_use_id": cid, "is_error": False,- "content": f"(the agent reported no completion for this {name} call)"}]}})- return evs, "\n".join(final).strip()+ """The events a list of this agent's updates streams, and the turn's answer (acp_turn.translate)."""+ return acp_turn.translate(updates, _tool_name)def main() -> int:@@ -289,8 +87,9 @@ def main() -> int:model_spec = str(job.get("model_spec") or "")resume = str(job.get("resume") or "")started = time.time()+ stream = Stream(_tool_name)try:- acp = Acp(list(job["argv"]), cwd, env)+ acp = Acp(list(job["argv"]), cwd, env, on_update=stream.update)except OSError as e:emit({"type": "result", "subtype": "error", "is_error": True,"result": f"dcode did not start: {e}", "usage": {}})@@ -354,16 +153,17 @@ def main() -> int:if "error" in res:emit({"type": "system", "subtype": "notice","text": f"this turn's model could not be set on the session: {model_spec}"})- acp.recording = True # everything before this is the loaded conversation's replay+ acp.recording = True # everything before this is the loaded conversation's replay;+ # from here each update is written as it arrives (Stream)out = acp.call("session/prompt",{"sessionId": session_id,"prompt": [{"type": "text", "text": str(job["prompt"])}]},timeout=min(_PROMPT_TIMEOUT, max(60.0, float(job.get("timeout") or _PROMPT_TIMEOUT))))except TimeoutError as e:return fail(f"the agent did not answer {e} in time", with_tail=True)- evs, answer = translate(acp.updates)- for ev in evs:- emit(ev)+ acp.recording = False+ stream.finish()+ answer = stream.answer()if "error" in out:err = out["error"] if isinstance(out.get("error"), dict) else {}blob = json.dumps(err)diff --git a/runner/fast_agent_driver.py b/runner/fast_agent_driver.pynew file mode 100644index 00000000..f4751793--- /dev/null+++ b/runner/fast_agent_driver.py@@ -0,0 +1,132 @@+"""One fast-agent turn, over its ACP server, streamed, as a runner subprocess.++WHY ACP AND NOT `go`. `fast-agent go ... --quiet` prints the answer and nothing else, and its `go`+command has no machine-readable stream; the turn's record was the ATIF trajectory it wrote, read+once the process had exited. So a fast-agent turn showed "Thinking" for its whole length and then+every step at once (Richard, 2026-10-26). `fast-agent-acp` is the same agent behind the Agent Client+Protocol, and it sends each text chunk and tool call as it happens. MEASURED on 0.10.47 (2026-10-26),+against a stand-in model:++ * `initialize` answers `loadSession: true`, and `session/load` in a SECOND process restores the+ conversation from the session store under `--home` (replayed as updates first, see acp_turn);+ the model was sent the whole history.+ * The session keeps the model it started on: a second process started with another `--model`+ still asked for the first, and `session/set_config_option` answers "method not found". The+ runner points the stored session at this turn's model before the process starts+ (server._fast_agent_set_model), as it did for `go --resume`.+ * Offered a terminal, the agent runs its shell commands through it and reports each one: a+ `tool_call` (no arguments yet), an `in_progress` update with the command, then `completed`+ with the output and exit code. Its own local shell reports a call with no arguments and no+ completion at all. So this client offers the terminal and runs the commands (acp_turn).+ * With the terminal its shell tool is named `execute` (with its own shell, `bash`); `process`+ is not declared. It is the same tool behind the same switch (`-x` / `--no-shell`), so the+ record keeps the name the harness's tool list has always used for it: `bash`.+ * `--workspace` is still what makes the session directory the tools' root; without it the+ commands ran in the agent's own home.++Protocol out: claude's stream-json on stdout, one object per line, which is why this backend's+normaliser in server.py is the passthrough. Usage is the relay's to stamp (_fill_relay_usage): ACP+carries none that prices.+"""+from __future__ import annotations++import json+import os+import sys+import time++sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+from acp_turn import Acp, Stream, emit, error_text, _PROMPT_TIMEOUT # noqa: E402+++def _tool_name(title: str, kind: str) -> str:+ """The tool's id from what ACP carries. The server's title IS the tool's name for its own file+ tools and for MCP tools; its shell tool is `execute` on this path and `bash` in the harness's+ tool list (see the module docstring)."""+ if title == "execute" or (kind == "execute" and not title):+ return "bash"+ return title.split("/")[-1] if title.startswith("environment/") else (title or kind or "tool")+++def main() -> int:+ job = json.loads(sys.argv[1])+ # resolved as --workspace is, so the session the agent opens and the shell's directory are the same path+ cwd = os.path.realpath(str(job["cwd"]))+ env = {**os.environ, **{str(k): str(v) for k, v in (job.get("env") or {}).items()}}+ resume = str(job.get("resume") or "")+ terminal = bool(job.get("terminal", True))+ started = time.time()+ stream = Stream(_tool_name)+ try:+ acp = Acp(list(job["argv"]), cwd, env, on_update=stream.update, terminal=terminal)+ except OSError as e:+ emit({"type": "result", "subtype": "error", "is_error": True,+ "result": f"fast-agent did not start: {e}", "usage": {}})+ return 0++ def fail(reason: str, with_tail: bool = False) -> int:+ tail = " / ".join(acp.errtail[-3:]) if with_tail else ""+ emit({"type": "result", "subtype": "error", "is_error": True,+ "result": (reason + (f": {tail}" if tail else ""))[:2000], "usage": {}})+ acp.close()+ return 0++ try:+ init = acp.call("initialize", {"protocolVersion": 1,+ "clientCapabilities": {"fs": {"readTextFile": False,+ "writeTextFile": False},+ "terminal": terminal},+ "clientInfo": {"name": "harnessrouter", "version": "1"}})+ if "error" in init:+ return fail(f"ACP initialize refused: {error_text(init['error'])}", with_tail=True)+ loadable = bool(((init.get("result") or {}).get("agentCapabilities") or {}).get("loadSession"))+ session_id = ""+ known = bool(job.get("resume_known"))+ if resume and loadable:+ got = acp.call("session/load", {"cwd": cwd, "sessionId": resume, "mcpServers": []})+ if "error" in got and known:+ # A conversation the store HAS that will not load is never answered as a new one.+ return fail("the conversation could not be continued: it is stored but the agent "+ f"would not load it ({error_text(got['error'])})", with_tail=True)+ if "error" not in got:+ session_id = resume+ if not session_id:+ new = acp.call("session/new", {"cwd": cwd, "mcpServers": []})+ if "error" in new:+ return fail(f"ACP session/new refused: {error_text(new['error'])}", with_tail=True)+ session_id = str((new.get("result") or {}).get("sessionId") or "")+ if not session_id:+ return fail("the agent returned no session id", with_tail=True)+ emit({"type": "system", "subtype": "init", "session_id": session_id, "model": job.get("model") or ""})+ acp.recording = True # everything before this is the loaded conversation's replay+ out = acp.call("session/prompt",+ {"sessionId": session_id, "prompt": [{"type": "text", "text": str(job["prompt"])}]},+ timeout=min(_PROMPT_TIMEOUT, max(60.0, float(job.get("timeout") or _PROMPT_TIMEOUT))))+ except TimeoutError as e:+ return fail(f"the agent did not answer {e} in time", with_tail=True)+ acp.recording = False+ stream.finish()+ answer = stream.answer()+ if "error" in out:+ reason = error_text(out["error"] if isinstance(out.get("error"), dict) else {})+ # The reason alone: the gateway frames a failed turn ("The turn failed: <reason>").+ return fail(reason, with_tail=reason == "the agent reported an error")+ stop = str((out.get("result") or {}).get("stopReason") or "")+ ok = stop == "end_turn"+ why = {"cancelled": "the turn was cancelled",+ "refusal": "the model refused the request",+ "max_tokens": "the model hit its token limit",+ "max_turn_requests": "the turn hit its request limit"}.get(stop, stop or "no stop reason")+ if ok and not answer.strip():+ # `end_turn` with nothing said is not a completed turn (dcode_driver says why at length).+ ok = False+ why = "the agent ended the turn without answering"+ emit({"type": "result", "subtype": "success" if ok else "error", "is_error": not ok,+ "result": answer if ok else f"{why} after {int(time.time() - started)}s",+ "usage": {}})+ acp.close()+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/runner/server.py b/runner/server.pyindex 75e84bcd..c3ec8ca3 100644--- a/runner/server.py+++ b/runner/server.py@@ -496,10 +496,6 @@ def _fast_agent_home(cwd: str) -> pathlib.Path:return pathlib.Path(cwd) / ".harness" / "fast-agent"-def _fast_agent_traj(cwd: str) -> pathlib.Path:- return _fast_agent_home(cwd) / "turn.atif.json"--def _fast_agent_session_file(cwd: str, session_id: str) -> pathlib.Path:return _fast_agent_home(cwd) / "sessions" / session_id / "session.json"@@ -562,9 +558,9 @@ _SESSION_PRESENT = {# place it exists: the driver asks the agent to load it and the store is what knows it is# there."dcode": _dcode_session_present,- # fast-agent: _build_fast_agent passes --resume only when the session's own file is in the- # store, so the argv is that lookup's conclusion.- "fast-agent": _argv_session_present,+ # fast-agent: the driver asks the agent to load the session, and the session's own file in the+ # store is what says it is there (the same lookup _build_fast_agent makes for resume_known).+ "fast-agent": _fast_agent_session_present,# zeroclaw: the driver asks for `session/resume` on every turn that has an id and starts a new# session when the store says it is not there, so the store is asked here too."zeroclaw": _zeroclaw_session_present,@@ -13062,33 +13058,29 @@ def _build_dcode(provider: str, auth: Auth, model: str, prompt: str, cwd: str, e# ── fast-agent (evalstate/fast-agent, PyPI fast-agent-mcp) ────────────────────────────────────-# An MCP-first agent framework with a one-shot CLI: `fast-agent go -m "<task>" --quiet` prints the-# answer, and `--trajectory-output` writes the whole turn as ATIF — a structured record with the-# steps, each step's tool calls AND their results, each step's token metrics and the session id. So-# this base's stream carries nothing and its EOF carries everything: _fast_agent_eof reads that file-# (opensquilla's arrangement, where the CLI's own transcript is replayed at the end of the turn).+# An MCP-first agent framework. It is driven over its own ACP server, `fast-agent-acp`, by+# runner/fast_agent_driver.py, which streams each text chunk, tool call and result as it happens+# (see that file for why, measured on 0.10.47). Until 0.37.1 it ran as `fast-agent go -m ... --quiet`+# with the turn read back from its ATIF trajectory after the process exited, so a turn showed+# "Thinking" and then every step at once.#-# MEASURED on 0.10.45 (2026-10-16) against the Vercel AI Gateway through a recording proxy:+# MEASURED on 0.10.45 (2026-10-16) against the Vercel AI Gateway through a recording proxy, and still+# true on the ACP path:# * `GENERIC_BASE_URL` + `GENERIC_API_KEY` with `--model generic.<id>` is its OpenAI-compatible# client pointed at the relay (`llm_generic.py` reads exactly those two).-# * **It has no tools at all by default.** A first turn asked to write a file answered "I can't-# create files in this conversation because I have no file-system tool", and the request-# declared ZERO tools: its tools come from MCP servers. `-x` (`--shell`) turns on the local-# runtime, and with it a turn declares four — bash, process, read_text_file, edit_file — and-# the file was written. Every turn here passes it.-# * `--resume <session_id>` continues a conversation (measured with a question the workspace-# could not answer), and sessions live under `$FAST_AGENT_HOME/sessions/<id>/` — a directory-# whose default is `./.fast-agent`, i.e. inside the workspace the user collects, which is why-# FAST_AGENT_HOME is set per session.-# * A resumed session RESTORES ITS OWN MODEL: turn two with `--model generic.google/gemini-3-flash`-# asked the provider for the first turn's claude id. The model is in the session's own-# `session.json` (`continuation.agents.<name>.model` and `.model_spec`), so this builder writes-# this turn's model there before `--resume` reads it — the fourth base in this batch with that-# shape (checklist item 42), and the second where the door is the store.+# * **It has no tools at all by default.** `-x` (`--shell`) turns on its shell and file tools;+# `--no-shell` takes them all away, which is what switching bash off has always meant here.+# * Sessions live under `$FAST_AGENT_HOME/sessions/<id>/`, a directory whose default is+# `./.fast-agent`, i.e. inside the workspace the user collects, which is why the home is named.+# * A resumed session RESTORES ITS OWN MODEL: the model is in the session's own `session.json`+# (`continuation.agents.<name>.model` and `.model_spec`), so this builder writes this turn's+# model there before the session is loaded (_fast_agent_set_model); ACP has no switch for it.# * Its MCP client takes stdio, sse AND streamable http with `headers`, so nothing is bridged.FAST_AGENT_PROVIDERS = {"anthropic", "openai", "azure", "openai-api", "tokenrouter"}-FAST_AGENT_BIN = os.environ.get("HR_FAST_AGENT_BIN",- "/data/agent-tools/fast-agent-venv/bin/fast-agent")+FAST_AGENT_ACP_BIN = os.environ.get("HR_FAST_AGENT_ACP_BIN",+ "/data/agent-tools/fast-agent-venv/bin/fast-agent-acp")+FAST_AGENT_PYTHON = os.environ.get("HR_FAST_AGENT_PYTHON", "/data/agent-tools/fast-agent-venv/bin/python")+FAST_AGENT_DRIVER = os.path.join(os.path.dirname(os.path.abspath(__file__)), "fast_agent_driver.py")FAST_AGENT_DEFAULT_MODEL = os.environ.get("FAST_AGENT_DEFAULT_MODEL", "gpt-5.4")# The agent's name inside the session store, which is also the key under# `continuation.agents` that carries the model. It is ours: `--name` sets it.@@ -13106,9 +13098,10 @@ ALL_FAST_AGENT_TOOLS = ("bash", "read_text_file", "edit_file")def _fast_agent_set_model(cwd: str, session_id: str, model: str) -> bool:- """Point the session's stored model at THIS turn's model, before --resume reads it.+ """Point the session's stored model at THIS turn's model, before the session is loaded.- MEASURED: without this a resumed turn asks the provider for the model the session started on,+ MEASURED (with `go --resume`, and again over ACP's session/load on 0.10.47): without this a+ resumed turn asks the provider for the model the session started on,and the harness's switch is dropped in silence — matrix rule 2 broken by the store. The file isplain JSON with no checksum of its own; only the two model fields change, the agent's historyand its prompt are left exactly as they are, and it is written beside and renamed so a crash@@ -13147,6 +13140,74 @@ def _fast_agent_set_model(cwd: str, session_id: str, model: str) -> bool:return False+def _fast_agent_drop_media(cwd: str, session_id: str, model: str) -> int:+ """Take what is not text out of the stored conversation before a text-only model loads it.++ fast-agent filters a message for the model it is sent to only when the message is new: an+ image `attach_media` put into the conversation under a model that reads images stays in the+ history file as it is, and a later turn on a model whose channel refuses images sends it+ again. MEASURED (0.37.1-rc.2, the family tour): gpt-5.4 attached its rendered slide, and+ nemotron-3.5-lightning's turn later in the same conversation failed at OpenRouter, "No+ endpoints found that support image input", and so would every turn after it. So on a turn+ whose model is declared text-only (the gateway's _TEXT_ONLY_INPUT, pi's `vision`), each block+ that is not text becomes the line fast-agent itself writes when it removes one. Returns how+ many blocks were taken out; the files are written beside and renamed, as the model is."""+ note =f"content was removed - {model} does not support this content type]"++ def text_only(blocks: list) -> tuple[list, int]:+ kept, n = [], 0+ for b in blocks:+ kind = b.get("type") if isinstance(b, dict) else None+ res = b.get("resource") if kind == "resource" else None+ if kind in ("image", "audio") or (isinstance(res, dict) and "blob" in res):+ label = "vision" if kind == "image" else "document" # fast-agent's own labels+ kept.append({"type": "text", "text": f"[{label} {note}"})+ n += 1+ else:+ kept.append(b)+ return kept, n++ # The id is the agent's own (its init event), and the history file's name is read from the+ # agent's store: both are kept to paths inside the session store before anything is written.+ store = os.path.realpath(os.path.join(str(_fast_agent_home(cwd)), "sessions"))+ sdir = os.path.realpath(os.path.join(store, session_id))+ if not sdir.startswith(store + os.sep):+ return 0+ removed = 0+ try:+ with open(os.path.join(sdir, "session.json"), encoding="utf-8") as fh:+ agents = ((json.load(fh).get("continuation") or {}).get("agents") or {})+ names = {str(s.get("history_file")) for s in agents.values()+ if isinstance(s, dict) and s.get("history_file")}+ for name in sorted(names):+ hist = os.path.realpath(os.path.join(sdir, name))+ if not hist.startswith(sdir + os.sep) or not os.path.isfile(hist):+ continue+ with open(hist, encoding="utf-8") as fh:+ doc = json.load(fh)+ n = 0+ for msg in doc.get("messages") or []:+ if not isinstance(msg, dict):+ continue+ if isinstance(msg.get("content"), list):+ msg["content"], k = text_only(msg["content"])+ n += k+ results = msg.get("tool_results")+ for res in (results.values() if isinstance(results, dict) else results or []):+ if isinstance(res, dict) and isinstance(res.get("content"), list):+ res["content"], k = text_only(res["content"])+ n += k+ if n:+ tmp = hist + ".hr-tmp"+ with open(tmp, "w", encoding="utf-8") as fh:+ json.dump(doc, fh)+ os.replace(tmp, hist)+ removed += n+ except (OSError, ValueError):+ pass+ return removed++def _fast_agent_config(cwd: str, tools_disabled: list[str] | None,mcp_servers: list[dict] | None, base_url: str = "") -> tuple[pathlib.Path, list[str]]:"""Write the fastagent.config.yaml this turn runs with, and name the servers it declares.@@ -13235,98 +13296,11 @@ def _fast_agent_config(cwd: str, tools_disabled: list[str] | None,return path, [name for name, _body in entries]-def _fast_agent_to_claude(obj: dict, state: dict) -> list[dict]:- """Nothing comes off the stream: `--quiet` prints prose, and the turn's record is the ATIF file- the eof handler reads. A JSON line here would only be an answer that happens to be JSON."""- return []---def _fast_agent_eof(state: dict, rc: int) -> list[dict]:- """The whole turn, out of the ATIF trajectory: the session id, the steps, the usage.-- Each agent step's `message` is CUMULATIVE — a two-step turn reported "FAOK" and then- "FAOK\\n\\nDONE" — so a step that only extends the previous one contributes its new text and not- the whole of it again (docker-agent's delta lesson, in another spelling)."""- path = _fast_agent_traj(str(state.get("cwd") or ""))- try:- with path.open(encoding="utf-8") as fh:- doc = json.load(fh)- except (OSError, ValueError):- doc = {}- evs: list[dict] = []- sid = str(doc.get("session_id") or "")- if sid:- evs.append({"type": "system", "subtype": "init", "session_id": sid,- "model": state.get("model")})- # A resumed session's trajectory holds every turn of the conversation (measured: nine steps- # across three turns), and a turn's record must hold its own. The boundary is this turn's own- # prompt: everything up to and including the LAST user step carrying it belongs to the turns- # before. Without this, each reply arrived with every earlier reply glued in front of it.- steps = [x for x in (doc.get("steps") or []) if isinstance(x, dict)]- prompt = str(state.get("prompt") or "")- if prompt:- cut = max((i for i, x in enumerate(steps)- if x.get("source") == "user" and str(x.get("message") or "") == prompt),- default=-1)- steps = steps[cut + 1:]- # ...and STOP at the next user message. Trimming only the front is right for the file this- # turn just wrote (its own prompt is the last one in it) and wrong for any trajectory that- # also holds what came after — which is how its own captured fixture reads, and what a- # stale file would look like if the clear in _build_fast_agent ever failed. Two independent- # guards for one invariant: a turn's record is one turn.- nxt = next((i for i, x in enumerate(steps) if x.get("source") == "user"), None)- if nxt is not None:- steps = steps[:nxt]- seen_text = ""- for step in steps:- if step.get("source") != "agent":- continue- text = str(step.get("message") or "")- new = text[len(seen_text):] if text.startswith(seen_text) else text- if new.strip():- evs.append({"type": "assistant",- "message": {"content": [{"type": "text", "text": new.strip()}]}})- state["final"] = (state.get("final", "") + "\n" + new.strip()).strip()- if text:- seen_text = text- for call in (step.get("tool_calls") or []):- if not isinstance(call, dict):- continue- args = call.get("arguments")- evs.append({"type": "assistant", "message": {"content": [- {"type": "tool_use", "id": str(call.get("tool_call_id") or "tool"),- "name": str(call.get("function_name") or "tool"),- "input": args if isinstance(args, dict) else {"arguments": args}}]}})- for res in ((step.get("observation") or {}).get("results") or []):- if not isinstance(res, dict):- continue- evs.append({"type": "user", "message": {"content": [- {"type": "tool_result", "tool_use_id": str(res.get("source_call_id") or "tool"),- "is_error": bool((res.get("extra") or {}).get("is_error")),- "content": str(res.get("content") or "")[:8000]}]}})- # The usage is this turn's own steps, each of which carries its call's counts. final_metrics- # totals the whole trajectory, and a resumed session's trajectory holds every earlier turn:- # measured 2026-10-25, a third turn reported 7077 prompt tokens, the four calls of all three- # turns, where its own two calls took 2385.- own = [x["metrics"] for x in steps if x.get("source") == "agent" and isinstance(x.get("metrics"), dict)]- usage = _norm_token_usage({"input_tokens": sum(int(m.get("prompt_tokens") or 0) for m in own),- "output_tokens": sum(int(m.get("completion_tokens") or 0) for m in own),- "cached_input_tokens": sum(int(m.get("cached_tokens") or 0) for m in own)})- ok = rc == 0 and bool(doc)- # No trajectory at all means the CLI died before writing one; the run loop's stderr tail is the- # reason, and an empty result lets it through rather than shadowing it.- return evs + [{"type": "result", "subtype": "success" if ok else "error", "is_error": not ok,- "result": state.get("final", "") if ok else "", "usage": usage}]---_fast_agent_to_claude.eof = _fast_agent_eof # type: ignore[attr-defined]--def _build_fast_agent(provider: str, auth: Auth, model: str, prompt: str, cwd: str, env: dict,resume_session_id: str | None = None,mcp_servers: list[dict] | None = None,tools_disabled: list[str] | None = None,- max_turns: int | None = None) -> list[str]:+ max_turns: int | None = None, vision: bool = True) -> list[str]:pr = provider or "openai-api"if pr not in FAST_AGENT_PROVIDERS:raise HTTPException(400, f"unknown fast-agent provider '{pr}' "@@ -13342,66 +13316,56 @@ def _build_fast_agent(provider: str, auth: Auth, model: str, prompt: str, cwd: senv["FAST_AGENT_HOME"] = str(home)env[_FA_BASE_ENV] = (auth.base_url or "").rstrip("/")env[_FA_KEY_ENV] = auth.api_key or ""- traj = _fast_agent_traj(cwd)- # Last turn's trajectory must not be able to answer for this one: the eof reads this file.- try:- traj.unlink()- except OSError:- passdisabled = {str(t) for t in (tools_disabled or ())}doc = _agent_doc_path(cwd, "fast-agent")- cmd = [FAST_AGENT_BIN, "go",+ cmd = [FAST_AGENT_ACP_BIN,"--name", _FA_AGENT,# WITHOUT THIS the agent works in its own home: measured end to end, a turn asked to- # write e2e.txt wrote it into .harness/fast-agent/ (its `working_dir` in the trajectory's- # tool metadata), which this product excludes from the produced-files list — so the- # user's deliverable would simply not exist for them. The workspace root is the session- # directory, and the home stays under .harness/ because FAST_AGENT_HOME says so.+ # write e2e.txt wrote it into .harness/fast-agent/, which this product excludes from the+ # produced-files list, so the user's deliverable would simply not exist for them. The+ # workspace root is the session directory (measured again over ACP: without it the shell+ # ran in the home), and the home stays under .harness/."--workspace", str(pathlib.Path(cwd).resolve()),# ...and the home NAMED, not left to the environment: with --workspace given the home- # resolved under it (`<cwd>/.fast-agent`) and FAST_AGENT_HOME was ignored, so the- # session store landed in the directory the user collects. The flag beats both.+ # resolved under it (`<cwd>/.fast-agent`) and FAST_AGENT_HOME was ignored."--home", str(home),"--model", f"generic.{model}",# The harness's workspace contract IS this agent's instruction: it has no- # instruction-file convention of its own, so the file the runner writes is named here- # (aider's arrangement).+ # instruction-file convention of its own, so the file the runner writes is named here."-i", str(doc),- "-m", prompt,- # the answer on stdout and nothing else; the record comes from the trajectory- "--quiet","-c", str(cfg),- "--trajectory-output", str(traj),- "--trajectory-format", "atif"]+ # Nobody is attached to answer a permission request; the sandbox is the boundary.+ "--no-permissions"]if server_names:- # DECLARED IS NOT ENABLED on this entry point. `go` builds an ad-hoc agent, and its- # `--servers` is "a comma-separated list of server names to enable from config" (its own- # help), so a server this runner wrote into the config reaches the model only when the- # flag names it. MEASURED by the custom-harness dimension (2026-10-20): with the config- # valid and the flag missing, the turn ran, recorded ZERO tool calls, and the harness's- # own MCP server was never called — the model simply had nothing attached. The names come- # from the writer, so the flag and the file cannot disagree.+ # DECLARED IS NOT ENABLED: `--servers` is "a comma-separated list of server names to enable+ # from config" (its own help), so a server this runner wrote into the config reaches the+ # model only when the flag names it. MEASURED by the custom-harness dimension (2026-10-20):+ # with the config valid and the flag missing, the harness's own MCP server was never called.cmd += ["--servers", ",".join(server_names)]if "bash" in disabled:- # EXPLICITLY off, not merely un-asked-for: a resumed session brings its shell runtime back,- # so a turn that only omitted -x had bash anyway and ran the command it was supposed to be- # unable to run. With --no-shell on the same resumed session the request declared no bash at- # all and the model said so. Both measured.+ # EXPLICITLY off, not merely un-asked-for: a resumed session brings its shell runtime back+ # otherwise (measured). It takes the file tools with it, as it always has on this base.cmd.append("--no-shell")else:- # Without it this framework has NO tools of its own at all: they come from MCP servers, and- # `-x` is what turns on the local shell and file runtime (measured — a turn without it- # answered that it had no file-system tool, and its request declared zero tools).+ # Without it this framework has NO tools of its own at all: they come from MCP servers.cmd.append("-x")- if resume_session_id and _fast_agent_session_present(cwd, cmd, resume_session_id):- # The store is pointed at this turn's model first, because --resume restores the- # session's own and the --model flag does not override it (measured).+ known = bool(resume_session_id) and _fast_agent_session_present(cwd, cmd, resume_session_id)+ if known:+ # The store is pointed at this turn's model first: the loaded session keeps its own, and+ # neither --model nor ACP changes it (measured)._fast_agent_set_model(cwd, resume_session_id, model)- cmd += ["--resume", resume_session_id]+ if not vision:+ # ...and an image an earlier model attached is not sent to one that refuses images.+ _fast_agent_drop_media(cwd, resume_session_id, model)skills = pathlib.Path(cwd) / ".harness" / "fast-agent" / "skills"if skills.is_dir():cmd += ["--skills", str(skills)]- return cmd+ job = {"argv": cmd, "cwd": cwd, "prompt": prompt, "model": model,+ "resume": resume_session_id or "", "resume_known": known,+ # The client runs the agent's shell commands only when the shell is on at all.+ "terminal": "bash" not in disabled,+ "timeout": MAX_TURN_SECONDS}+ return [FAST_AGENT_PYTHON, FAST_AGENT_DRIVER, json.dumps(job, separators=(",", ":"))]@@ -13516,11 +13480,11 @@ BACKENDS = {# and emits claude's stream-json itself — the passthrough, as systemone's and nanobot's are."dcode": {"providers": sorted(DCODE_PROVIDERS), "default_model": DCODE_DEFAULT_MODEL,"normalize": _claude_passthrough},- # fast-agent's stream is prose and its RECORD is the ATIF trajectory it writes, so the- # normaliser passes every line and the eof reads that file — opensquilla's arrangement.+ # fast-agent is driven over its ACP server, so runner/fast_agent_driver.py emits claude's+ # stream-json itself, streamed as the agent works: the passthrough, as dcode's is."fast-agent": {"providers": sorted(FAST_AGENT_PROVIDERS),"default_model": FAST_AGENT_DEFAULT_MODEL,- "normalize": _fast_agent_to_claude},+ "normalize": _claude_passthrough},# The zeroclaw driver emits claude's stream-json itself (see zeroclaw_driver.py)."zeroclaw": {"providers": sorted(ZEROCLAW_PROVIDERS), "default_model": ZEROCLAW_DEFAULT_MODEL,"normalize": _claude_passthrough},@@ -15487,7 +15451,7 @@ class TurnReq(BaseModel):metadata: dict | None = None # systemone: {"systemone": {"script": [...]}} selects a scripted provider (a probe)idempotency_key: str = "" # dedup a retried /turn: same key -> same turn, no re-execpartial_messages: bool = False # claude: stream token-level deltas (--include-partial-messages)- vision: bool = True # pi: whether the model's channel accepts image input+ vision: bool = True # pi, dsh, omp, fast-agent: whether the model's channel accepts image inputvision_auth: dict | None = None # hermes: {provider, model, base_url, api_key} for its image questionscodex_appserver: bool = False # codex: run via app-server (streams item/agentMessage/delta)environment: dict | None = None # {id, slug, entry}: the project layer at /env/<slug>, read-only (environments.py)@@ -15822,7 +15786,8 @@ def turn(req: TurnReq, identifier: str = "") -> dict:cmd = _build_fast_agent(req.provider, auth, model, req.prompt, cwd, env,resume_session_id=req.resume_session_id,mcp_servers=req.mcp_servers,- tools_disabled=req.tools_disabled, max_turns=req.max_turns)+ tools_disabled=req.tools_disabled, max_turns=req.max_turns,+ vision=bool(req.vision))elif backend == "dcode":model = model or DCODE_DEFAULT_MODELcmd = _build_dcode(req.provider, auth, model, req.prompt, cwd, env,diff --git a/runner/tests/fixtures/batch4/fake_acp_agent.py b/runner/tests/fixtures/batch4/fake_acp_agent.pyindex 2c503335..55c1a0ff 100644--- a/runner/tests/fixtures/batch4/fake_acp_agent.py+++ b/runner/tests/fixtures/batch4/fake_acp_agent.py@@ -7,8 +7,10 @@ cannot carry, answered as deepagents' server answers it), `no_load` (an agent thadvertise loadSession at all), `load_fails` (it does, and the session is gone), `bad_model` (themodel this turn asks for is not in the session's list), `provider_401` (a refusal in `data.details`with a traceback on stderr at the same time), `refusal` (a stopReason that is not end_turn),-`permission` (one tool call that asks the client), `slow_exit` (takes a second to go once its input-ends) or `no_exit` (catches SIGTERM and never goes). Its pid, and that it exited, are written to+`permission` (one tool call that asks the client), `slow_prompt` (one chunk, two seconds, then the+answer: what streaming is measured against), `terminal` (a shell call the CLIENT runs through+terminal/create, as fast-agent's goes when the client offers a terminal), `slow_exit` (takes a+second to go once its input ends) or `no_exit` (catches SIGTERM and never goes). Its pid, and that it exited, are written to$FAKE_ACP_LOG.life."""import json@@ -40,6 +42,17 @@ def update(sid, upd):"params": {"sessionId": sid, "update": upd}})+def ask(rid, method, params):+ """A request of the agent's own, answered by the client before anything else is read."""+ send({"jsonrpc": "2.0", "id": rid, "method": method, "params": params})+ for raw in sys.stdin:+ reply = json.loads(raw)+ if reply.get("id") == rid and reply.get("method") is None:+ note({"asked_client": method, "reply": reply})+ return reply+ return {}++for line in sys.stdin:line = line.strip()if not line:@@ -107,6 +120,25 @@ for line in sys.stdin:"status": "completed","content": [{"type": "content","content": {"type": "text", "text": "hi"}}]})+ if MODE == "slow_prompt":+ update(sid, {"sessionUpdate": "agent_message_chunk",+ "content": {"type": "text", "text": "FIRST "}})+ time.sleep(2)+ if MODE == "terminal":+ update(sid, {"sessionUpdate": "tool_call", "toolCallId": "t1", "title": "execute",+ "kind": "execute", "status": "pending", "content": []})+ update(sid, {"sessionUpdate": "tool_call_update", "toolCallId": "t1", "kind": "execute",+ "status": "in_progress", "rawInput": {"command": "echo T > t.txt; echo TERMINAL-OUT"}})+ made = ask(9101, "terminal/create", {"sessionId": sid, "command": "/bin/sh",+ "args": ["-lc", "echo T > t.txt; echo TERMINAL-OUT"],+ "outputByteLimit": 16000})+ tid = (made.get("result") or {}).get("terminalId")+ ask(9102, "terminal/wait_for_exit", {"sessionId": sid, "terminalId": tid})+ out = ask(9103, "terminal/output", {"sessionId": sid, "terminalId": tid})+ ask(9104, "terminal/release", {"sessionId": sid, "terminalId": tid})+ text = (out.get("result") or {}).get("output", "")+ update(sid, {"sessionUpdate": "tool_call_update", "toolCallId": "t1", "status": "completed",+ "content": [{"type": "content", "content": {"type": "text", "text": text}}]})if MODE != "silent_end_turn":update(sid, {"sessionUpdate": "agent_message_chunk","content": {"type": "text", "text": "THE NEW ANSWER"}})diff --git a/runner/tests/fixtures/batch4/fast-agent-three-turns.atif.json b/runner/tests/fixtures/batch4/fast-agent-three-turns.atif.jsondeleted file mode 100644index 7f09ef75..00000000--- a/runner/tests/fixtures/batch4/fast-agent-three-turns.atif.json+++ /dev/null@@ -1,399 +0,0 @@-{- "schema_version": "ATIF-v1.8",- "session_id": "2610160220-7kil4q",- "trajectory_id": "traj_44b135aaa89b4d1db043a6d1d65cd163",- "agent": {- "name": "fast-agent",- "version": "0.10.45",- "model_name": "anthropic/claude-haiku-5.5",- "tool_definitions": [- {- "type": "function",- "function": {- "name": "read_skill",- "description": "Read a skill's SKILL.md file or associated resources. Use this to load skill instructions before using the skill.",- "parameters": {- "type": "object",- "properties": {- "path": {- "type": "string",- "description": "Absolute path to the file to read (from the <location> in available_skills)"- }- },- "required": [- "path"- ],- "additionalProperties": false- }- }- }- ],- "extra": {- "target_agent": "AGENTS",- "provider": "generic"- }- },- "steps": [- {- "step_id": 1,- "source": "system",- "message": "Always begin your reply with the token E2EFA.\n\n<!-- harness-skills:begin -->\n## Workspace\n\nYour working directory is this task's workspace and the ONLY place the user can see files. Save every deliverable (documents, decks, code, exports) to a relative path under it. Never write output to an absolute path outside it (/tmp, /app, the workspace parent directory, or your home directory): those files are not collected, and the user will never see them.\n<!-- harness-skills:end -->\n"- },- {- "step_id": 2,- "timestamp": "2026-10-16T06:20:40.598480Z",- "source": "user",- "message": "Reply with exactly: FA-E2E-FIRST"- },- {- "step_id": 3,- "timestamp": "2026-10-16T06:20:41.625955Z",- "source": "agent",- "model_name": "anthropic/claude-haiku-5.5",- "message": "E2EFA FA-E2E-FIRST",- "metrics": {- "prompt_tokens": 1863,- "completion_tokens": 18,- "cached_tokens": 0,- "extra": {- "observed_prompt_tokens_lower_bound": 1863,- "observed_completion_tokens_lower_bound": 18,- "observed_cached_tokens_lower_bound": 0,- "observed_reasoning_tokens_lower_bound": 0,- "provider": "generic",- "usage_schema": "openai-chat",- "model": "anthropic/claude-haiku-5.5",- "reasoning_tokens": 0,- "tool_calls": 0,- "usage_provider_attempt_count": 1,- "raw_usage": [- {- "completion_tokens": 18,- "prompt_tokens": 1863,- "total_tokens": 1881,- "completion_tokens_details": {- "accepted_prediction_tokens": null,- "audio_tokens": null,- "reasoning_tokens": 0,- "rejected_prediction_tokens": null,- "text_tokens": null,- "image_tokens": 0- },- "prompt_tokens_details": {- "audio_tokens": 0,- "cache_write_tokens": null,- "cached_tokens": 0,- "image_tokens": null,- "text_tokens": null,- "video_tokens": 0- },- "cost": 0.0001953,- "is_byok": false,- "cost_details": {- "upstream_inference_cost": null,- "upstream_inference_prompt_cost": 0,- "upstream_inference_completions_cost": 0- },- "cache_creation_input_tokens": 0,- "market_cost": 0.0001953,- "gateway_cost": 0.0001953- }- ]- }- },- "llm_call_count": 1,- "extra": {- "duration_ms": 1027.19,- "ttft_ms": 1024.87,- "time_to_response_ms": 1024.87,- "stop_reason": "LlmStopReason.END_TURN"- }- },- {- "step_id": 4,- "timestamp": "2026-10-16T06:20:42.823534Z",- "source": "user",- "message": "Create a file called e2e.txt containing the word MADE, then say in one sentence what word I asked you to reply with in my first message."- },- {- "step_id": 5,- "timestamp": "2026-10-16T06:20:43.866581Z",- "source": "agent",- "model_name": "anthropic/claude-haiku-5.5",- "message": "",- "tool_calls": [- {- "tool_call_id": "call_3379114",- "function_name": "bash",- "arguments": {- "command": "echo \"MADE\" > e2e.txt"- }- }- ],- "observation": {- "results": [- {- "source_call_id": "call_3379114",- "content": "process_id: process-1\nprocess exit code was 0",- "extra": {- "is_error": false,- "timing_ms": 112.77,- "tool_metadata": {- "variant": "shell",- "command": "echo \"MADE\" > e2e.txt",- "shell_name": "zsh",- "shell_path": "/bin/zsh",- "shell_kind": "local",- "shell_provider": null,- "working_dir": "/ws",- "working_dir_display": ".",- "idle_yield_seconds": 10,- "foreground_yield_seconds": 30,- "foreground_auto_await_max_seconds": 30.0,- "background": false,- "lifecycle": "session",- "timeout_seconds": null,- "output_byte_limit": 16000,- "streams_output": true,- "returns_exit_code": true- },- "process_metadata": {- "process_id": "process-1",- "lifecycle": "session",- "process_status": "completed",- "process_elapsed_seconds": 0.10701400006655604,- "os_process_id": 28019,- "exit_code": 0,- "output_line_count": 0,- "total_output_bytes": 0,- "has_observed_output": false,- "stdout_bytes": 0,- "stderr_bytes": 0- }- }- }- ]- },- "metrics": {- "prompt_tokens": 909,- "completion_tokens": 23,- "cached_tokens": 0,- "extra": {- "observed_prompt_tokens_lower_bound": 909,- "observed_completion_tokens_lower_bound": 23,- "observed_cached_tokens_lower_bound": 0,- "observed_reasoning_tokens_lower_bound": 0,- "provider": "generic",- "usage_schema": "openai-chat",- "model": "google/gemini-3-flash",- "reasoning_tokens": 0,- "tool_calls": 1,- "usage_provider_attempt_count": 1,- "raw_usage": [- {- "completion_tokens": 23,- "prompt_tokens": 909,- "total_tokens": 932,- "completion_tokens_details": {- "accepted_prediction_tokens": null,- "audio_tokens": null,- "reasoning_tokens": 0,- "rejected_prediction_tokens": null,- "text_tokens": null,- "image_tokens": 0- },- "prompt_tokens_details": {- "audio_tokens": 0,- "cache_write_tokens": null,- "cached_tokens": 0,- "image_tokens": null,- "text_tokens": null,- "video_tokens": 0- },- "cost": 0.0005235,- "is_byok": false,- "cost_details": {- "upstream_inference_cost": null,- "upstream_inference_prompt_cost": 0,- "upstream_inference_completions_cost": 0- },- "cache_creation_input_tokens": 0,- "market_cost": 0.0005235,- "gateway_cost": 0.0005235- }- ]- }- },- "llm_call_count": 1,- "extra": {- "duration_ms": 1042.14,- "ttft_ms": 967.28,- "time_to_response_ms": 967.28,- "stop_reason": "LlmStopReason.TOOL_USE"- }- },- {- "step_id": 6,- "timestamp": "2026-10-16T06:20:46.816052Z",- "source": "agent",- "model_name": "anthropic/claude-haiku-5.5",- "message": "E2EFA You asked me to reply with exactly FA-E2E-FIRST in your first message.",- "metrics": {- "prompt_tokens": 947,- "completion_tokens": 339,- "cached_tokens": 0,- "extra": {- "observed_prompt_tokens_lower_bound": 947,- "observed_completion_tokens_lower_bound": 339,- "observed_cached_tokens_lower_bound": 0,- "observed_reasoning_tokens_lower_bound": 316,- "provider": "generic",- "usage_schema": "openai-chat",- "model": "google/gemini-3-flash",- "reasoning_tokens": 316,- "tool_calls": 0,- "usage_provider_attempt_count": 1,- "raw_usage": [- {- "completion_tokens": 339,- "prompt_tokens": 947,- "total_tokens": 1286,- "completion_tokens_details": {- "accepted_prediction_tokens": null,- "audio_tokens": null,- "reasoning_tokens": 316,- "rejected_prediction_tokens": null,- "text_tokens": null,- "image_tokens": 0- },- "prompt_tokens_details": {- "audio_tokens": 0,- "cache_write_tokens": null,- "cached_tokens": 0,- "image_tokens": null,- "text_tokens": null,- "video_tokens": 0- },- "cost": 0.0014905,- "is_byok": false,- "cost_details": {- "upstream_inference_cost": null,- "upstream_inference_prompt_cost": 0,- "upstream_inference_completions_cost": 0- },- "cache_creation_input_tokens": 0,- "market_cost": 0.0014905,- "gateway_cost": 0.0014905- }- ]- }- },- "llm_call_count": 1,- "extra": {- "duration_ms": 2802.3,- "ttft_ms": 2634.03,- "time_to_response_ms": 2634.03,- "stop_reason": "LlmStopReason.END_TURN"- }- },- {- "step_id": 7,- "timestamp": "2026-10-16T06:20:47.995039Z",- "source": "user",- "message": "Run the shell command `echo NOPE` and tell me what it printed."- },- {- "step_id": 8,- "timestamp": "2026-10-16T06:20:50.724995Z",- "source": "agent",- "model_name": "anthropic/claude-haiku-5.5",- "message": "E2EFA I can't run that command. The only tool I have available right now is for reading skill files, so I have no way to execute `echo NOPE` or see its output. I won't guess at the result. If you run it yourself in a terminal, it should print `NOPE`.",- "metrics": {- "prompt_tokens": 805,- "completion_tokens": 335,- "cached_tokens": 0,- "extra": {- "observed_prompt_tokens_lower_bound": 805,- "observed_completion_tokens_lower_bound": 335,- "observed_cached_tokens_lower_bound": 0,- "observed_reasoning_tokens_lower_bound": 251,- "provider": "generic",- "usage_schema": "openai-chat",- "model": "anthropic/claude-haiku-5.5",- "reasoning_tokens": 251,- "tool_calls": 0,- "usage_provider_attempt_count": 1,- "raw_usage": [- {- "completion_tokens": 335,- "prompt_tokens": 805,- "total_tokens": 1140,- "completion_tokens_details": {- "accepted_prediction_tokens": null,- "audio_tokens": null,- "reasoning_tokens": 251,- "rejected_prediction_tokens": null,- "text_tokens": null,- "image_tokens": 0- },- "prompt_tokens_details": {- "audio_tokens": 0,- "cache_write_tokens": null,- "cached_tokens": 0,- "image_tokens": null,- "text_tokens": null,- "video_tokens": 0- },- "cost": 0.000248,- "is_byok": false,- "cost_details": {- "upstream_inference_cost": null,- "upstream_inference_prompt_cost": 0,- "upstream_inference_completions_cost": 0- },- "cache_creation_input_tokens": 0,- "market_cost": 0.000248,- "gateway_cost": 0.000248- }- ]- }- },- "llm_call_count": 1,- "extra": {- "duration_ms": 2728.83,- "ttft_ms": 2187.42,- "time_to_response_ms": 2187.42,- "stop_reason": "LlmStopReason.END_TURN"- }- }- ],- "final_metrics": {- "total_prompt_tokens": 4524,- "total_completion_tokens": 715,- "total_cached_tokens": 0,- "total_steps": 8,- "extra": {- "total_reasoning_tokens": 567,- "llm_usage_expected_call_count": 4,- "llm_usage_observed_call_count": 4,- "llm_usage_call_coverage_ratio": 1.0,- "llm_usage_calls_complete": true,- "observed_prompt_tokens_lower_bound": 4524,- "observed_completion_tokens_lower_bound": 715,- "observed_cached_tokens_lower_bound": 0,- "observed_cost_usd_lower_bound": 0,- "observed_reasoning_tokens_lower_bound": 567,- "observed_tool_use_prompt_tokens_lower_bound": 0,- "accounting": {- "schema": "fast-agent.accounting/v1",- "scope": "observed",- "provider_usage_complete": true,- "observed_token_availability": {- "prompt_tokens": true,- "completion_tokens": true,- "cached_tokens": true- }- }- }- }-}diff --git a/runner/tests/test_acp_turn.py b/runner/tests/test_acp_turn.pynew file mode 100644index 00000000..671b85aa--- /dev/null+++ b/runner/tests/test_acp_turn.py@@ -0,0 +1,154 @@+"""The streamed ACP turn the drivers share (acp_turn), and fast-agent's driver on it (2026-10-26).++Until 0.37.1 deepagents-code's driver held every update until session/prompt returned and fast-agent+ran as `go --quiet` with its record read from a file at the end, so both showed "Thinking" for the+whole turn and then every step at once. These pin the streamed shape, the terminal fast-agent's+shell runs through, and the fast-agent driver against a fake agent."""+import json+import os+import pathlib+import subprocess+import sys+import time++sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))+import acp_turn as A # noqa: E402+import fast_agent_driver as F # noqa: E402++AGENT = pathlib.Path(__file__).resolve().parent / "fixtures" / "batch4" / "fake_acp_agent.py"+++def _blocks(evs, kind):+ return [c for e in evs for c in (e.get("message") or {}).get("content") or [] if c.get("type") == kind]+++# ── the translator ─────────────────────────────────────────────────────────────────────────────+def test_a_call_is_shown_once_its_input_is_known_and_closed_by_its_result():+ """fast-agent's shape: the call first with no arguments, the command on its first progress update."""+ evs, answer = A.translate([+ {"sessionUpdate": "tool_call", "toolCallId": "t1", "title": "execute", "kind": "execute",+ "status": "pending", "content": []},+ {"sessionUpdate": "tool_call_update", "toolCallId": "t1", "status": "in_progress",+ "rawInput": {"command": "echo hi"}},+ {"sessionUpdate": "tool_call_update", "toolCallId": "t1", "status": "completed",+ "content": [{"type": "content", "content": {"type": "text", "text": "hi\n[Exit code: 0]"}}]},+ {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "done"}},+ ], F._tool_name)+ calls, results = _blocks(evs, "tool_use"), _blocks(evs, "tool_result")+ assert [(c["name"], c["input"]) for c in calls] == [("bash", {"command": "echo hi"})]+ assert results[0]["tool_use_id"] == "t1" and "hi" in results[0]["content"]+ assert [e["type"] for e in evs] == ["assistant", "user", "assistant"] and answer == "done"+++def test_a_call_that_never_reports_input_or_completion_is_still_closed():+ evs, _ = A.translate([{"sessionUpdate": "tool_call", "toolCallId": "t1", "title": "execute",+ "kind": "execute", "status": "pending"}], F._tool_name)+ assert _blocks(evs, "tool_use")[0]["input"] == {}+ assert "no completion" in _blocks(evs, "tool_result")[0]["content"]+++def test_the_answer_is_its_text_runs_and_never_its_thinking():+ evs, answer = A.translate([+ {"sessionUpdate": "agent_thought_chunk", "content": {"type": "text", "text": "hmm"}},+ {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "one "}},+ {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "two"}},+ {"sessionUpdate": "tool_call", "toolCallId": "c", "title": "read_text_file", "kind": "read",+ "rawInput": {"path": "a"}},+ {"sessionUpdate": "tool_call_update", "toolCallId": "c", "status": "completed", "content": []},+ {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "three"}},+ {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": ""}},+ ], F._tool_name)+ assert answer == "one two\nthree"+ assert _blocks(evs, "thinking")[0]["thinking"] == "hmm"+++def test_fast_agents_names_come_back_as_the_harness_knows_them():+ assert F._tool_name("execute", "execute") == "bash"+ assert F._tool_name("write_text_file", "edit") == "write_text_file"+ assert F._tool_name("environment/write_text_file", "edit") == "write_text_file"+ assert F._tool_name("deepwiki__read_wiki_structure", "other") == "deepwiki__read_wiki_structure"+ assert F._tool_name("", "") == "tool"+++# ── the terminal ───────────────────────────────────────────────────────────────────────────────+def test_the_terminal_keeps_the_end_of_a_long_output_and_says_it_was_cut(tmp_path):+ t = A._Terminal(["/bin/sh", "-c", "seq 1 5000; echo THE-END"], str(tmp_path), dict(os.environ), 2048)+ t.done.wait(10)+ out = t.output()+ assert out.rstrip().endswith("THE-END") and len(out.encode()) <= 2048 and t.truncated+ assert t.status() == {"exitCode": 0, "signal": None}+++def test_the_terminal_runs_in_the_session_and_can_be_killed(tmp_path):+ t = A._Terminal(["/bin/sh", "-c", "pwd; sleep 30"], str(tmp_path), dict(os.environ), 16000)+ time.sleep(0.5)+ t.kill()+ assert t.done.wait(10)+ assert str(tmp_path.resolve()) in t.output() or str(tmp_path) in t.output()+ assert t.status()["signal"] == "SIGKILL"+++# ── fast-agent's driver, against the fake agent ────────────────────────────────────────────────+def _drive(tmp_path, mode, terminal=True):+ log = tmp_path / "asked.ndjson"+ job = {"argv": [sys.executable, str(AGENT)], "cwd": str(tmp_path), "prompt": "do it",+ "model": "gpt-5.4", "resume": "", "resume_known": False, "terminal": terminal, "timeout": 60}+ proc = subprocess.run([sys.executable, str(pathlib.Path(F.__file__)), json.dumps(job)], cwd=str(tmp_path),+ text=True, capture_output=True, stdin=subprocess.DEVNULL, timeout=120,+ env={**os.environ, "FAKE_ACP_MODE": mode, "FAKE_ACP_LOG": str(log)})+ evs = [json.loads(line) for line in proc.stdout.splitlines() if line.strip().startswith("{")]+ asked = [json.loads(line) for line in log.read_text().splitlines() if line.strip()]+ return evs, asked+++def test_a_shell_call_runs_in_the_clients_terminal_and_streams_its_command_and_output(tmp_path):+ evs, asked = _drive(tmp_path, "terminal")+ calls, results = _blocks(evs, "tool_use"), _blocks(evs, "tool_result")+ assert [(c["name"], c["input"].get("command")) for c in calls] == [("bash", "echo T > t.txt; echo TERMINAL-OUT")]+ assert "TERMINAL-OUT" in results[0]["content"] and results[0]["is_error"] is False+ assert (tmp_path / "t.txt").read_text().strip() == "T" # run in the session directory+ init = next(a for a in asked if a.get("method") == "initialize")+ assert init["params"]["clientCapabilities"]["terminal"] is True+ made = next(a for a in asked if a.get("asked_client") == "terminal/create")+ assert made["reply"]["result"]["terminalId"]+ assert evs[-1]["type"] == "result" and evs[-1]["result"] == "THE NEW ANSWER"+++def test_with_the_shell_off_the_terminal_is_not_offered_and_the_turn_still_ends(tmp_path):+ evs, asked = _drive(tmp_path, "terminal", terminal=False)+ init = next(a for a in asked if a.get("method") == "initialize")+ assert init["params"]["clientCapabilities"]["terminal"] is False+ refused = next(a for a in asked if a.get("asked_client") == "terminal/create")+ assert "error" in refused["reply"]+ assert not (tmp_path / "t.txt").exists()+ assert evs[-1]["type"] == "result"+++def test_fast_agents_updates_stream_while_its_prompt_is_still_running(tmp_path):+ log = tmp_path / "asked.ndjson"+ job = {"argv": [sys.executable, str(AGENT)], "cwd": str(tmp_path), "prompt": "do it", "model": "m",+ "resume": "", "terminal": True, "timeout": 60}+ proc = subprocess.Popen([sys.executable, str(pathlib.Path(F.__file__)), json.dumps(job)], cwd=str(tmp_path),+ text=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL,+ env={**os.environ, "FAKE_ACP_MODE": "slow_prompt", "FAKE_ACP_LOG": str(log)})+ t0, seen = time.time(), []+ for line in proc.stdout:+ if line.strip().startswith("{"):+ seen.append((time.time() - t0, json.loads(line)))+ proc.wait(timeout=30)+ first = next(t for t, e in seen if e["type"] == "assistant" and e["message"]["content"][0].get("text") == "FIRST ")+ done = next(t for t, e in seen if e["type"] == "result")+ assert done - first >= 1.5, (first, done)+++def test_a_conversation_the_store_has_but_will_not_load_fails_rather_than_starting_over(tmp_path):+ log = tmp_path / "asked.ndjson"+ job = {"argv": [sys.executable, str(AGENT)], "cwd": str(tmp_path), "prompt": "do it", "model": "m",+ "resume": "s-old", "resume_known": True, "terminal": True, "timeout": 60}+ proc = subprocess.run([sys.executable, str(pathlib.Path(F.__file__)), json.dumps(job)], cwd=str(tmp_path),+ text=True, capture_output=True, stdin=subprocess.DEVNULL, timeout=60,+ env={**os.environ, "FAKE_ACP_MODE": "load_fails", "FAKE_ACP_LOG": str(log)})+ res = [json.loads(line) for line in proc.stdout.splitlines() if line.strip().startswith("{")][-1]+ assert res["is_error"] and "could not be continued" in res["result"]+ asked = [json.loads(line)["method"] for line in log.read_text().splitlines() if line.strip() and "method" in line]+ assert "session/new" not in askeddiff --git a/runner/tests/test_batch4_backends.py b/runner/tests/test_batch4_backends.pyindex 57d30396..d8699497 100644--- a/runner/tests/test_batch4_backends.py+++ b/runner/tests/test_batch4_backends.py@@ -32,11 +32,10 @@ from server import (ALL_VIBE_TOOLS, Auth, BACKENDS, # noqa: E402ALL_DOCKER_AGENT_TOOLS, _build_docker_agent, _docker_agent_eof,_docker_agent_home, _docker_agent_session_db, _sse_bridges,_docker_agent_session_present, _docker_agent_to_claude,- ALL_FAST_AGENT_TOOLS, _build_fast_agent, _fast_agent_eof,- _record_cli_session_id,+ ALL_FAST_AGENT_TOOLS, _build_fast_agent, _claude_passthrough,+ FAST_AGENT_ACP_BIN, FAST_AGENT_DRIVER,_fast_agent_home, _fast_agent_session_file,- _fast_agent_session_present, _fast_agent_set_model,- _fast_agent_to_claude, _fast_agent_traj)+ _fast_agent_session_present, _fast_agent_set_model, _fast_agent_drop_media)UP = "https://up.example/v1"FIX = pathlib.Path(__file__).resolve().parent / "fixtures" / "batch4"@@ -556,44 +555,35 @@ def test_the_bridged_server_is_written_as_a_stdio_toolset():# ══ fast-agent (fast-agent-mcp 0.10.45) ═══════════════════════════════════════════════════════-FA_FIXTURE = "fast-agent-three-turns.atif.json"-# The three prompts of the captured conversation, in order. A turn's record must hold its own-# steps, and this turn's prompt is the boundary (see _fast_agent_eof).-FA_PROMPTS = (- "Reply with exactly: FA-E2E-FIRST",- "Create a file called e2e.txt containing the word MADE, then say in one sentence what word I "- "asked you to reply with in my first message.",- "Run the shell command `echo NOPE` and tell me what it printed.",-)+class _Argv(list):+ """The agent's argv, out of the driver command the builder returns, with the driver's job on it."""+ job: dict-def _fa_ws() -> str:- """A workspace whose trajectory file IS the captured three-turn conversation."""- ws = _ws()- traj = _fast_agent_traj(ws)- traj.parent.mkdir(parents=True, exist_ok=True)- traj.write_text((FIX / FA_FIXTURE).read_text())- return ws---def _fa_eof(ws: str, prompt: str, rc: int = 0):- state = {"model": "gpt-5.4", "final": "", "cwd": ws, "prompt": prompt}- # the stream carries nothing on this base; everything comes out of the eof- assert _fast_agent_to_claude({"anything": True}, state) == []- return _fast_agent_eof(state, rc), state+def _fab(*a, **kw) -> _Argv:+ cmd = _build_fast_agent(*a, **kw)+ assert cmd[1] == FAST_AGENT_DRIVER, cmd[:2]+ job = json.loads(cmd[2])+ argv = _Argv(job["argv"])+ argv.job = job+ return argv-def test_fast_agent_is_registered_with_an_eof_that_carries_the_turn():- assert "fast-agent" in BACKENDS- assert BACKENDS["fast-agent"]["normalize"] is _fast_agent_to_claude- assert getattr(BACKENDS["fast-agent"]["normalize"], "eof", None) is _fast_agent_eof+def test_fast_agent_runs_its_acp_server_through_the_streaming_driver():+ """0.37.1: driven over `fast-agent-acp` so each step streams as it happens (fast_agent_driver);+ the driver writes claude's stream-json itself, so the normaliser is the passthrough."""+ assert BACKENDS["fast-agent"]["normalize"] is _claude_passthrough+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", _ws(), {})+ assert cmd[0] == FAST_AGENT_ACP_BIN and "go" not in cmd and "--quiet" not in cmd+ assert "--no-permissions" in cmd+ assert cmd.job["prompt"] == "hi" and cmd.job["terminal"] is Truedef test_the_instruction_file_is_the_one_the_runner_writes_and_names():ws = _ws()# it has no instruction-file convention of its own: the file is passed with -i (aider's shape)assert _agent_doc_path(ws, "fast-agent") == pathlib.Path(ws) / "AGENTS.md"- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})assert cmd[cmd.index("-i") + 1] == str(pathlib.Path(ws) / "AGENTS.md")@@ -603,7 +593,7 @@ def test_the_agent_works_in_the_session_and_keeps_its_store_out_of_it():--workspace was given, the home resolved UNDER it and FAST_AGENT_HOME was ignored, so thesession store moved into the directory the user collects."""ws, env = _ws(), {}- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, env)+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, env)assert cmd[cmd.index("--workspace") + 1] == str(pathlib.Path(ws).resolve())assert cmd[cmd.index("--home") + 1] == str(_fast_agent_home(ws))assert str(_fast_agent_home(ws)).endswith("/.harness/fast-agent")@@ -612,68 +602,70 @@ def test_the_agent_works_in_the_session_and_keeps_its_store_out_of_it():def test_the_credential_is_in_the_two_variables_its_generic_client_reads():ws, env = _ws(), {}- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="real-key"), "gpt-5.4", "hi", ws, env)+ _fab("openai-api", Auth(base_url=UP, api_key="real-key"), "gpt-5.4", "hi", ws, env)assert env["GENERIC_BASE_URL"].startswith("http://127.0.0.1:") # the relay, not the upstreamassert env["GENERIC_API_KEY"].startswith("hr-relay-")assert "real-key" not in json.dumps(env)-def test_the_model_rides_the_generic_prefix_and_the_trajectory_is_cleared_per_turn():- ws = _fa_ws()- assert _fast_agent_traj(ws).is_file()- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "claude-haiku-5.5",- "hi", ws, {})+def test_the_model_rides_the_generic_prefix():+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "claude-haiku-5.5", "hi", _ws(), {})assert cmd[cmd.index("--model") + 1] == "generic.claude-haiku-5.5"- assert not _fast_agent_traj(ws).exists(), (- "last turn's trajectory would otherwise answer for this one")- assert cmd[cmd.index("--trajectory-format") + 1] == "atif"def test_the_shell_runtime_is_asked_for_and_withheld_by_NAME():"""Measured on a resumed session: omitting -x left bash in place and the model ran the command;--no-shell made the request declare no bash at all."""ws = _ws()- on = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})+ on = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})assert "-x" in on and "--no-shell" not in on- off = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ off = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},tools_disabled=["bash"])assert "--no-shell" in off and "-x" not in off+ # the client offers its terminal only when the shell is on at all+ assert on.job["terminal"] is True and off.job["terminal"] is Falsedef test_the_two_file_tools_are_withheld_in_the_config_and_only_when_asked():ws = _ws()- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})+ _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})cfg = (_fast_agent_home(ws) / "fastagent.config.yaml").read_text()assert "enable_read_text_file: true" in cfgassert 'write_text_file_mode: "auto"' in cfg- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},tools_disabled=["read_text_file", "edit_file"])cfg = (_fast_agent_home(ws) / "fastagent.config.yaml").read_text()assert "enable_read_text_file: false" in cfgassert 'write_text_file_mode: "off"' in cfg# with the shell runtime withheld there is no shell section to write at all- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},tools_disabled=["bash"])assert "shell:" not in (_fast_agent_home(ws) / "fastagent.config.yaml").read_text()-def test_resume_is_passed_only_when_the_session_file_is_there():+def test_resume_is_asked_for_only_when_the_session_file_is_there():+ """The conversation is loaded through the protocol (session/load), so the id rides the job, and+ `resume_known` says the store has it: a stored conversation that will not load fails the turn+ instead of running as a new one."""ws = _ws()sid = "2610160220-7kil4q"- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},- resume_session_id=sid)- assert "--resume" not in cmd+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ resume_session_id=sid)+ assert "--resume" not in cmd and cmd.job["resume"] == sid and cmd.job["resume_known"] is Falseassert _resume_lost("fast-agent", cmd, sid, ws) == sidf = _fast_agent_session_file(ws, sid)f.parent.mkdir(parents=True, exist_ok=True)f.write_text(json.dumps({"session_id": sid, "continuation": {"agents": {"harness": {- "shell_enabled": True, "model": "gpt-5.4", "model_spec": "generic.gpt-5.4",+ "shell_enabled": True, "model": "claude-haiku-5.5", "model_spec": "generic.claude-haiku-5.5","history_file": "history_harness.json"}}}}))- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},- resume_session_id=sid)- assert cmd[cmd.index("--resume") + 1] == sid+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ resume_session_id=sid)+ assert cmd.job["resume_known"] is Trueassert _fast_agent_session_present(ws, cmd, sid) is Trueassert _resume_lost("fast-agent", cmd, sid, ws) is None+ # the loaded session keeps its own model, so the store is pointed at this turn's first+ stored = json.loads(f.read_text())["continuation"]["agents"]["harness"]+ assert stored["model"] == "gpt-5.4" and stored["model_spec"] == "generic.gpt-5.4"def test_a_switch_rewrites_the_sessions_stored_model_and_nothing_else():@@ -707,6 +699,78 @@ def test_a_switch_rewrites_the_sessions_stored_model_and_nothing_else():assert _fast_agent_set_model(ws, "nope", "gemini-3-flash") is False+def test_a_text_only_model_loads_the_conversation_without_its_images():+ """fast-agent filters a message for its model only when the message is new, so an image+ attach_media added under gpt-5.4 stayed in the history and nemotron-3.5-lightning's turn later+ in the conversation failed at the provider ("No endpoints found that support image input",+ the family tour on 0.37.1-rc.2). A turn declared text-only takes every block that is not text+ out of the stored conversation first, as the line fast-agent writes when it removes one; a turn+ on a model that reads images leaves the conversation exactly as it is."""+ ws = _ws()+ sid = "2610260950-FIta9i"+ f = _fast_agent_session_file(ws, sid)+ f.parent.mkdir(parents=True, exist_ok=True)+ f.write_text(json.dumps({"session_id": sid, "continuation": {"agents": {"harness": {+ "model": "gpt-5.4", "model_spec": "generic.gpt-5.4", "history_file": "history_harness.json"}}}}))+ png = {"type": "image", "data": "iVBORw0KGgo=", "mimeType": "image/png"}+ pdf = {"type": "resource", "resource": {"uri": "file:///w/a.pdf", "mimeType": "application/pdf",+ "blob": "JVBERi0="}}+ page = {"type": "resource", "resource": {"uri": "file:///w/a.md", "mimeType": "text/markdown",+ "text": "# kept"}}+ history = {"messages": [+ {"role": "user", "content": [{"type": "text", "text": "make a slide"}]},+ {"role": "user", "content": [], "tool_results": {"call-1": {+ "content": [{"type": "text", "text": "attached"}, png], "isError": False}}},+ {"role": "user", "content": [png]},+ {"role": "user", "content": [page, pdf]},+ {"role": "assistant", "content": [{"type": "text", "text": "done"}]}]}+ h = f.parent / "history_harness.json"+ h.write_text(json.dumps(history))++ _fab("openai-api", Auth(base_url=UP, api_key="k"), "claude-sonnet-5", "hi", ws, {},+ resume_session_id=sid)+ assert json.loads(h.read_text()) == history, "a model that reads images gets them"++ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "nemotron-3.5-lightning", "hi", ws, {},+ resume_session_id=sid, vision=False)+ assert cmd.job["resume_known"] is True+ after = json.loads(h.read_text())["messages"]+ text = json.dumps(after)+ assert "iVBORw0KGgo=" not in text and "JVBERi0=" not in text+ gone = "content was removed - nemotron-3.5-lightning does not support this content type]"+ assert after[1]["tool_results"]["call-1"]["content"] == [+ {"type": "text", "text": "attached"}, {"type": "text", "text": "[vision " + gone}]+ assert after[2]["content"] == [{"type": "text", "text": "[vision " + gone}]+ assert after[3]["content"] == [page, {"type": "text", "text": "[document " + gone}]+ assert after[0] == history["messages"][0] and after[4] == history["messages"][4]+ # the stored model was still pointed at the turn's, as on every resumed turn+ stored = json.loads(f.read_text())["continuation"]["agents"]["harness"]+ assert stored["model"] == "nemotron-3.5-lightning"+++def test_the_media_drop_writes_only_inside_the_session_store():+ """The session id is the agent's own (its init event) and the history file's name is read from+ its store, so neither may point the rewrite outside the session's own directory."""+ ws = _ws()+ png = {"type": "image", "data": "iVBORw0KGgo=", "mimeType": "image/png"}+ outside = pathlib.Path(ws) / "victim.json"+ outside.write_text(json.dumps({"messages": [{"role": "user", "content": [png]}]}))+ # an id that climbs out of the store+ evil = pathlib.Path(ws) / "evil"+ evil.mkdir()+ (evil / "session.json").write_text(json.dumps({"continuation": {"agents": {"a": {+ "history_file": "../victim.json"}}}}))+ assert _fast_agent_drop_media(ws, "../../../evil", "m") == 0+ # a history file name that climbs out of the session's directory+ sid = "2610260950-FIta9i"+ f = _fast_agent_session_file(ws, sid)+ f.parent.mkdir(parents=True, exist_ok=True)+ f.write_text(json.dumps({"continuation": {"agents": {"a": {+ "history_file": "../../../../victim.json"}}}}))+ assert _fast_agent_drop_media(ws, sid, "m") == 0+ assert png in json.loads(outside.read_text())["messages"][0]["content"]++def test_an_mcp_server_carries_its_bearer_and_its_transport():"""PARSED, not substring-matched. The first version of this test asserted `'transport:"http"' in cfg`, which is true at ANY indentation — and the indentation was wrong: the server@@ -717,7 +781,7 @@ def test_an_mcp_server_carries_its_bearer_and_its_transport():because a column declares no MCP servers. Found by the custom-harness dimension, 2026-10-20."""import yamlws = _ws()- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},mcp_servers=[{"name": "plugs", "url": "https://p.example/mcp","transport": "http", "auth": "tok-7"},{"name": "legacy", "url": "https://l.example/sse",@@ -745,7 +809,7 @@ def test_a_declared_server_is_also_enabled_on_the_command_line():the DOCUMENT rather than against a second copy of the naming rule."""import yamlws = _ws()- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},mcp_servers=[{"name": "one", "url": "https://a.example/mcp"},{"name": "two", "command": ["/bin/echo"]}])doc = yaml.safe_load((_fast_agent_home(ws) / "fastagent.config.yaml").read_text())@@ -755,7 +819,7 @@ def test_a_declared_server_is_also_enabled_on_the_command_line():def test_no_servers_means_no_servers_flag():ws = _ws()- cmd = _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})+ cmd = _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {})assert "--servers" not in cmdassert "mcp:" not in (_fast_agent_home(ws) / "fastagent.config.yaml").read_text()@@ -765,7 +829,7 @@ def test_every_server_body_sits_under_its_own_name():`mcp.servers` holds nothing but server names."""import yamlws = _ws()- _build_fast_agent("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},+ _fab("openai-api", Auth(base_url=UP, api_key="k"), "gpt-5.4", "hi", ws, {},mcp_servers=[{"name": "one", "url": "https://a.example/mcp"},{"name": "two", "url": "https://b.example/mcp"}])doc = yaml.safe_load((_fast_agent_home(ws) / "fastagent.config.yaml").read_text())@@ -774,93 +838,6 @@ def test_every_server_body_sits_under_its_own_name():assert not set(body) - {"transport", "url", "command", "args", "headers"}, body-def test_a_turns_record_is_its_own_steps_and_not_the_whole_conversation():- """Its trajectory holds every turn of a resumed session — eight steps across three here — and- a turn that reported all of them arrived with every earlier reply glued in front of its own."""- ws = _fa_ws()- evs, state = _fa_eof(ws, FA_PROMPTS[2])- texts = [b["text"] for e in evs for b in (e.get("message", {}).get("content") or [])- if b.get("type") == "text"]- assert len(texts) == 1- assert texts[0].startswith("E2EFA I can't run that command")- assert "FA-E2E-FIRST" not in texts[0], "the first turn's answer is not this turn's"- assert state["final"] == texts[0]---def test_the_middle_turns_tool_call_and_its_result_come_off_the_real_trajectory():- ws = _fa_ws()- evs, state = _fa_eof(ws, FA_PROMPTS[1])- calls = [b for e in evs for b in (e.get("message", {}).get("content") or [])- if b.get("type") == "tool_use"]- results = [b for e in evs for b in (e.get("message", {}).get("content") or [])- if b.get("type") == "tool_result"]- assert [c["name"] for c in calls] == ["bash"]- assert calls[0]["id"] == "call_3379114"- assert results[0]["tool_use_id"] == calls[0]["id"] and results[0]["is_error"] is False- assert "process exit code was 0" in results[0]["content"]- assert "FA-E2E-FIRST" in state["final"], "this turn's own answer, which recalls the first"- assert "I can't run that command" not in state["final"], "the turn after it is not this one"---def test_the_session_id_and_the_usage_come_off_the_trajectory_too():- ws = _fa_ws()- evs, _state = _fa_eof(ws, FA_PROMPTS[0])- init = evs[0]- assert init["subtype"] == "init" and init["session_id"] == "2610160220-7kil4q"- res = evs[-1]- assert res["subtype"] == "success" and res["is_error"] is False- # the turn's own step (1863 prompt / 18 completion), not final_metrics' 4524 / 715, which is- # every call of all three turns in this trajectory- assert res["usage"]["input_tokens"] == 1863- assert res["usage"]["output_tokens"] == 18- assert "cache_read_tokens" not in res["usage"]---def test_each_turns_usage_is_its_own_calls():- ws = _fa_ws()- got = [_fa_eof(ws, p)[0][-1]["usage"] for p in FA_PROMPTS]- assert [(u["input_tokens"], u["output_tokens"]) for u in got] == [(1863, 18), (909 + 947, 23 + 339), (805, 335)]- assert sum(u["input_tokens"] for u in got) == 4524 # together, the trajectory's own total---def test_a_turns_cache_reads_are_its_own_and_its_input_is_the_fresh_part():- ws = _ws()- traj = _fast_agent_traj(ws)- traj.parent.mkdir(parents=True, exist_ok=True)- m = lambda p, c, r: {"prompt_tokens": p, "completion_tokens": c, "cached_tokens": r}- traj.write_text(json.dumps({"session_id": "s1", "steps": [- {"step_id": 1, "source": "user", "message": "one"},- {"step_id": 2, "source": "agent", "message": "M1", "metrics": m(2348, 5, 0)},- {"step_id": 3, "source": "user", "message": "two"},- {"step_id": 4, "source": "agent", "message": "", "metrics": m(2393, 80, 2359)},- {"step_id": 5, "source": "agent", "message": "DONE", "metrics": m(2592, 5, 2390)}],- "final_metrics": {"total_prompt_tokens": 7333, "total_completion_tokens": 90, "total_cached_tokens": 4749}}))- u = _fa_eof(ws, "two")[0][-1]["usage"]- assert (u["input_tokens"], u["output_tokens"], u["cache_read_tokens"]) == (2393 + 2592 - 4749, 85, 4749)---def test_an_init_that_only_the_eof_emits_still_records_the_cli_session_id():- """THE BUG THIS BASE'S FIRST COLUMN FOUND (2026-10-20). Its stream carries nothing — the ATIF- trajectory is read at eof — so its `init` event only ever appears in the eof batch, and the- capture that remembers the CLI's conversation id lived in the streaming loop alone. The id was- never recorded, so the gateway had none to send back, so the builder never passed `--resume`,- and every follow-up turn silently began a new conversation. `_resume_lost` stayed quiet because- an EMPTY resume id is not a lost one.-- Four of the five matrix scenarios passed anyway: they ask the model to echo a token and never- test the history. The recall scenario answered the literal word "word"; a clean two-turn probe- with a word that is nowhere in the workspace answered "remember", 993 input tokens against the- first turn's 989. The CLI was never at fault — by hand, `--resume` answered the word and the- trajectory grew from three steps to five."""- ws = _fa_ws()- evs, _state = _fa_eof(ws, FA_PROMPTS[0])- init = next(e for e in evs if e.get("subtype") == "init")- rec: dict = {}- for ev in evs: # exactly what the eof branch now does, in order- _record_cli_session_id(rec, ev)- assert rec["session_id"] == init["session_id"] == "2610160220-7kil4q"--def test_both_places_a_turns_events_are_produced_record_the_session_id():"""The invariant, not the symptom: the streaming loop and the eof loop must BOTH capture it.One of them having the line and the other not is the whole of the bug above, and a reader@@ -873,31 +850,6 @@ def test_both_places_a_turns_events_are_produced_record_the_session_id():assert 'rec["session_id"] = ev["session_id"]' not in body.split("def _record_cli_session_id")[0]-def test_a_cumulative_message_contributes_only_its_new_text():- # measured on this CLI: a two-step turn reported "FAOK" and then "FAOK\n\nDONE"- ws = _ws()- traj = _fast_agent_traj(ws)- traj.parent.mkdir(parents=True, exist_ok=True)- traj.write_text(json.dumps({"session_id": "s1", "steps": [- {"step_id": 1, "source": "user", "message": "go"},- {"step_id": 2, "source": "agent", "message": "FAOK"},- {"step_id": 3, "source": "agent", "message": "FAOK\n\nDONE"}],- "final_metrics": {"total_prompt_tokens": 10, "total_completion_tokens": 2}}))- evs, state = _fa_eof(ws, "go")- texts = [b["text"] for e in evs for b in (e.get("message", {}).get("content") or [])- if b.get("type") == "text"]- assert texts == ["FAOK", "DONE"], texts- assert state["final"] == "FAOK\nDONE"---def test_a_turn_that_wrote_no_trajectory_fails_and_leaves_the_reason_to_stderr():- ws = _ws() # no trajectory file at all: the CLI died before writing one- evs, _state = _fa_eof(ws, "go", rc=1)- res = evs[-1]- assert res["subtype"] == "error" and res["is_error"] is True- assert res["result"] == "", "the run loop's stderr tail is the reason, not a placeholder"--def test_the_tools_offered_are_the_three_with_a_switch():assert set(ALL_FAST_AGENT_TOOLS) == {"bash", "read_text_file", "edit_file"}assert "process" not in ALL_FAST_AGENT_TOOLSdiff --git a/runner/tests/test_dcode_acp.py b/runner/tests/test_dcode_acp.pyindex 3daae15b..95802e89 100644--- a/runner/tests/test_dcode_acp.py+++ b/runner/tests/test_dcode_acp.py@@ -228,7 +228,8 @@ def test_text_and_tool_calls_keep_the_order_the_reader_saw():{"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "then more"}},])kinds = [(e["type"], e["message"]["content"][0]["type"]) for e in evs]- assert kinds == [("assistant", "text"), ("assistant", "tool_use"),+ # each chunk is its own event, streamed as it came (acp_turn.Stream)+ assert kinds == [("assistant", "text"), ("assistant", "text"), ("assistant", "tool_use"),("user", "tool_result"), ("assistant", "text")]@@ -253,7 +254,8 @@ def test_progress_updates_are_not_the_turns_answer():{"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "the answer"}},])assert answer == "the answer"- assert len(evs) == 1+ # the thought is shown as thinking, never as the answer; the plan and the echoed prompt not at all+ assert [e["message"]["content"][0]["type"] for e in evs] == ["thinking", "text"]def test_an_empty_turn_produces_no_events_and_no_answer():@@ -528,3 +530,28 @@ def test_an_agent_that_will_not_exit_is_killed_and_the_turn_still_ends(tmp_path)except ProcessLookupError:alive = Falseassert not alive, f"agent {pid} outlived the turn"+++# ── streamed, not held ────────────────────────────────────────────────────────────────────────+def test_an_update_reaches_the_record_while_the_prompt_is_still_running(tmp_path):+ """THE BUG THIS PINS (Richard, 2026-10-26): the driver held every update until session/prompt+ returned, so a turn showed "Thinking" for its whole length and then everything at once."""+ import subprocess+ agent = pathlib.Path(__file__).resolve().parent / "fixtures" / "batch4" / "fake_acp_agent.py"+ log = tmp_path / "asked.ndjson"+ job = {"argv": [sys.executable, str(agent)], "cwd": str(tmp_path), "prompt": "do it", "model": "gpt-5.4",+ "model_spec": "", "resume": "", "timeout": 60}+ env = {**os.environ, "FAKE_ACP_MODE": "slow_prompt", "FAKE_ACP_LOG": str(log)}+ proc = subprocess.Popen([sys.executable, str(pathlib.Path(D.__file__)), json.dumps(job)], cwd=str(tmp_path),+ text=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL, env=env)+ seen = []+ t0 = __import__("time").time()+ for line in proc.stdout:+ if line.strip().startswith("{"):+ seen.append((__import__("time").time() - t0, json.loads(line)))+ proc.wait(timeout=30)+ first = next(t for t, e in seen if e.get("type") == "assistant"+ and e["message"]["content"][0].get("text") == "FIRST ")+ done = next(t for t, e in seen if e.get("type") == "result")+ assert done - first >= 1.5, (first, done)+ assert seen[-1][1]["result"] == "FIRST THE NEW ANSWER"diff --git a/scripts/support-matrix/ui-tool-rows-live.mjs b/scripts/support-matrix/ui-tool-rows-live.mjsindex bab7d5de..57cad191 100644--- a/scripts/support-matrix/ui-tool-rows-live.mjs+++ b/scripts/support-matrix/ui-tool-rows-live.mjs@@ -1,34 +1,57 @@-// ui-tool-rows-live.mjs: the tool row opens WHILE the turn runs. One console task on HARNESS (model-// MODEL, optional) runs a command that sleeps; while the turn still shows Working…, the shell row-// (ROW, a regex) must be openable and show the command. Env BASE, HR_PASS, HARNESS, MODEL, ROW, SHOT.+// ui-tool-rows-live.mjs: a turn's steps show WHILE it runs, not all at once when it ends. One console+// task on the setup SETUP (its id, chrn_…) runs two shell commands that each sleep 8 s, then answers+// with a fixed word. The page is read every half second: the first command must be on screen at+// least 6 s before the answer, and the second at least 4 s after the first. A base that holds its+// record until the turn ends shows every step in one frame and fails both.+// Env BASE, HR_USER (default harnessrouter), HR_PASS, SETUP, MODEL (optional), SHOT (a mid-turn+// screenshot). Exit 0 on PASS.import { chromium } from 'playwright';-const BASE = process.env.BASE, H = process.env.HARNESS || 'opensquilla', WORD = `live-row-${Date.now() % 100000}`;+const BASE = process.env.BASE, SETUP = process.env.SETUP, TAG = `live${Date.now() % 100000}`;+const ONE = `sleep 8; echo ${TAG}-ONE`, TWO = `sleep 8; echo ${TAG}-TWO`, WORD = `${TAG}-DONE`;const sleep = (ms) => new Promise((r) => setTimeout(r, ms));const b = await chromium.launch(); const page = await (await b.newContext({ viewport: { width: 1440, height: 900 } })).newPage();const rt = (sel, v) => page.$eval(sel, (el, x) => { Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(el, x); el.dispatchEvent(new Event('input', { bubbles: true })); }, v);-const dismissWelcome = async () => { for (let i = 0; i < 4 && (await page.locator('.welcome-overlay').count()); i++) { await page.locator('.welcome-overlay .welcome-wide-close').click().catch(() => {}); await sleep(600); } };+let code = 1;try {await page.goto(`${BASE}/login`, { waitUntil: 'domcontentloaded' }); await sleep(2500);- if (page.url().includes('/login')) { await rt('#sh-user', 'harnessrouter'); await rt('#sh-pass', process.env.HR_PASS); await page.click('button[type=submit]'); await page.waitForURL((u) => !u.pathname.includes('/login'), { timeout: 60000, waitUntil: 'commit' }); }- await sleep(1500); await dismissWelcome();- await page.goto(`${BASE}/harnesses?h=${H}`, { waitUntil: 'domcontentloaded' }); await sleep(3500); await dismissWelcome();- for (let i = 0; i < 10 && !(await page.locator('.wbx-conv-main.is-hero').count()); i++) { await page.click('button:has-text("New task")').catch(() => {}); await sleep(800); }+ if (page.url().includes('/login')) {+ await rt('#sh-user', process.env.HR_USER || 'harnessrouter'); await rt('#sh-pass', process.env.HR_PASS); await page.click('button[type=submit]');+ await page.waitForURL((u) => !u.pathname.includes('/login'), { timeout: 60000, waitUntil: 'commit' });+ }+ await page.goto(`${BASE}/studio/${SETUP}`, { waitUntil: 'domcontentloaded' }); await sleep(4000);+ await page.click('button.tk-newb'); await sleep(1500);if (process.env.MODEL) {- await page.click('.ar2-chip'); await sleep(500);- await page.locator('.wbx-model-opt', { hasText: new RegExp('^' + process.env.MODEL.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '(\\s|$)') }).first().click(); await sleep(300);+ const pick = page.locator('button.nw-pk');+ if (!(await pick.textContent()).includes(process.env.MODEL)) throw new Error(`the composer's model is ${await pick.textContent()}, not ${process.env.MODEL}`);}- await page.fill('textarea.wbx-composer-input', `Run exactly this one shell command and nothing else: sleep 30; echo ${WORD} Then reply with its output.`);- await page.locator('button.wbx-send').click();- const row = page.locator('button.wbx-act-row', { hasText: new RegExp(process.env.ROW || 'exec', 'i') }).first();- let shown = '', running = false, t0 = Date.now();- for (let i = 0; i < 90; i++) {- running = (await page.getByText('Working…').count()) > 0;- if (await row.count()) {- if (!(await row.isDisabled())) { await row.click(); await sleep(600); shown = await row.evaluate((x) => (x.parentElement?.textContent || '').replace(/\s+/g, ' ').slice(0, 400)); running = (await page.getByText('Working…').count()) > 0; break; }+ await page.locator('textarea:visible').first().fill(+ `Use your shell tool to run \`${ONE}\`. After it finishes, run \`${TWO}\`. Then reply with exactly: ${WORD}`);+ await page.locator('button.uac-send').click();+ const t0 = Date.now(); const seen = {}; let shot = false;+ const at = (k) => { if (seen[k] === undefined) seen[k] = (Date.now() - t0) / 1000; };+ for (let i = 0; i < 360 && seen.answer === undefined; i++) {+ // Collapsed activity summaries open, so a command row's own text is on the page.+ for (const s of await page.locator('button.uac-sum[aria-expanded="false"]').all()) await s.click().catch(() => {});+ const text = await page.locator('main, body').first().innerText();+ // The command the agent ran, never the prompt's own copy of it: the prompt holds both commands+ // inside one sentence, so a row is the command text followed by its own line end.+ const rows = text.split('\n').map((l) => l.trim());+ if (rows.some((l) => l.endsWith(ONE) && !l.includes('Use your shell tool'))) at('first command');+ if (rows.some((l) => l.endsWith(TWO) && !l.includes('Use your shell tool'))) at('second command');+ if (rows.some((l) => l === WORD)) at('answer');+ if (process.env.DEBUG && i % 4 === 0) {+ console.log(((Date.now() - t0) / 1000).toFixed(1), JSON.stringify(rows.filter((l) => l.includes(TAG) || /^(Running|Ran|Used|Using)\b/.test(l)).slice(0, 8)));+ }+ if (seen['first command'] !== undefined && seen.answer === undefined && !shot && process.env.SHOT) {+ await page.screenshot({ path: process.env.SHOT }); shot = true;}- await sleep(1000);+ await sleep(500);}- await page.screenshot({ path: process.env.SHOT || 'ui-tool-rows-live.png', fullPage: false });- const ok = running && shown.includes(`echo ${WORD}`);- console.log(ok ? 'PASS' : 'FAIL', H, `${Math.round((Date.now() - t0) / 1000)}s`, 'turn still running:', running, '| row shows:', shown.slice(0, 220));-} finally { await b.close(); }+ const lead = (seen.answer ?? 0) - (seen['first command'] ?? Infinity);+ const apart = (seen['second command'] ?? -Infinity) - (seen['first command'] ?? Infinity);+ const ok = lead >= 6 && apart >= 4;+ console.log(ok ? 'PASS' : 'FAIL', SETUP, JSON.stringify(seen),+ `first command ${lead.toFixed(1)} s before the answer, ${apart.toFixed(1)} s before the second`);+ code = ok ? 0 : 1;+} catch (e) { console.log('FAIL', SETUP, String(e).slice(0, 300)); } finally { await b.close(); }+process.exit(code);diff --git a/ui/package-lock.json b/ui/package-lock.jsonindex e1ac6f61..5b5a7350 100644--- a/ui/package-lock.json+++ b/ui/package-lock.json@@ -67,7 +67,7 @@"react-markdown": "^9.1.0","react-syntax-highlighter": "^16.1.1","rehype-sanitize": "^6.0.0",- "reifyui": "^0.18.0",+ "reifyui": "^0.18.1","remark-gfm": "^4.0.1","tailwind-merge": "^3.3.1","tailwindcss": "^3.4.1",@@ -13111,9 +13111,9 @@}},"node_modules/reifyui": {- "version": "0.18.0",- "resolved": "https://registry.npmjs.org/reifyui/-/reifyui-0.18.0.tgz",- "integrity": "sha512-LicoiWB1yZosBkhtFPN6ImHNiXMY5rXDGQuA4RluDSasDOxozaOvjpcCtfEuI60JBrKnvUciui2vtiSQZyRZzg==",+ "version": "0.18.1",+ "resolved": "https://registry.npmjs.org/reifyui/-/reifyui-0.18.1.tgz",+ "integrity": "sha512-SH3qORwPYaW1lupTu3wYkcDferWwZOku02Oalb1hzsenBq33Q+C2Yn33VKk8GG76Ak6y53bLvXet2ehrIn6lug==","license": "MIT","engines": {"node": ">=18"diff --git a/ui/package.json b/ui/package.jsonindex dfe6995a..0ef3fe0a 100644--- a/ui/package.json+++ b/ui/package.json@@ -74,7 +74,7 @@"react-markdown": "^9.1.0","react-syntax-highlighter": "^16.1.1","rehype-sanitize": "^6.0.0",- "reifyui": "^0.18.0",+ "reifyui": "^0.18.1","remark-gfm": "^4.0.1","tailwind-merge": "^3.3.1","tailwindcss": "^3.4.1",diff --git a/ui/src/components/hrui/setup/agent-chat.scoped.css b/ui/src/components/hrui/setup/agent-chat.scoped.cssindex 056d283d..a0b5e4cd 100644--- a/ui/src/components/hrui/setup/agent-chat.scoped.css+++ b/ui/src/components/hrui/setup/agent-chat.scoped.css@@ -1,4 +1,4 @@-/* Generated by scripts/scope-agent-chat-css.mjs from [email protected] styles/agent-chat.css, file.css, chat.css. Do not edit. */+/* Generated by scripts/scope-agent-chat-css.mjs from [email protected] styles/agent-chat.css, file.css, chat.css. Do not edit. *//* ── agent-chat.css ── *//* reifyui/agent-chat: the agent conversation (AgentConversation, AgentTurnView, AgentComposer …).diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.tsindex 6e9ef4c3..ab01bbad 100644--- a/ui/src/lib/harness.ts+++ b/ui/src/lib/harness.ts@@ -266,13 +266,13 @@ export const OOB: OobHarness[] = [tools: [], skills: [] },{ id: 'fast-agent', name: 'fast-agent', version: 'v0.10.47', backend: 'fast-agent', status: 'ready',// Placeholder only; the chat-completions list, for jcode's reason.- models: ['gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.2', 'claude-fable-5-1', 'claude-fable-5', 'claude-opus-5.5', 'claude-opus-5', 'claude-sonnet-5.5', 'claude-sonnet-5', 'claude-opus-4.8', 'claude-opus-4.7', 'claude-sonnet-4.6', 'claude-haiku-5.5', 'claude-haiku-4.5', 'gemini-4-argon', 'gemini-3.8-flash', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.5-flash-lite', 'gemini-3.1-pro-preview', 'gemini-3.1-flash-lite', 'gemini-3-flash-preview', 'grok-4.6', 'grok-4.3', 'grok-4.20', 'grok-build-0.1', 'muse-wonder-1.0', 'muse-spark-1.3', 'muse-spark-1.2', 'muse-spark-1.1', 'muse-glimmer-30b', 'deepseek-v4.1-flash', 'deepseek-v4-pro', 'deepseek-v4-flash', 'kimi-k3', 'qwen3.8-max', 'qwen3.8-flash', 'qwen3.7-max', 'qwen3.7-plus', 'glm-5.3', 'glm-5.3-flash', 'mistral-medium-3.5', 'step-3.7-flash', 'nemotron-3.5-lightning', 'nemotron-3-super'], defaultModel: 'gpt-5.4', moreModels: 0,+ models: ['gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.2', 'claude-fable-5-1', 'claude-fable-5', 'claude-opus-5.5', 'claude-opus-5', 'claude-sonnet-5.5', 'claude-sonnet-5', 'claude-opus-4.8', 'claude-opus-4.7', 'claude-sonnet-4.6', 'claude-haiku-5.5', 'claude-haiku-4.5', 'gemini-4-argon', 'gemini-3.8-flash', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.5-flash-lite', 'gemini-3.1-pro-preview', 'gemini-3.1-flash-lite', 'gemini-3-flash-preview', 'grok-4.6', 'grok-4.3', 'grok-4.20', 'grok-build-0.1', 'muse-wonder-1.0', 'muse-spark-1.3', 'muse-spark-1.2', 'muse-spark-1.1', 'muse-glimmer-30b', 'deepseek-v4.1-flash', 'deepseek-v4-pro', 'deepseek-v4-flash', 'kimi-k3', 'qwen3.8-flash', 'qwen3.7-max', 'qwen3.7-plus', 'glm-5.3', 'glm-5.3-flash', 'mistral-medium-3.5', 'step-3.7-flash', 'nemotron-3.5-lightning'], defaultModel: 'gpt-5.4', moreModels: 0,systemPrompt: 'You are an autonomous coding agent. You work on a real git workspace with shell and file access, reading and editing files and running commands to complete the task end to end.',tools: [], skills: [] },{ id: 'dcode', name: 'Deep Agents Code', version: 'v0.2.1', backend: 'dcode', status: 'ready',// Placeholder only; the same list the gateway gives it. Unlike the other four this// base drives the Responses API, which is about the wire and not about these ids.- models: ['gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.2', 'claude-fable-5-1', 'claude-fable-5', 'claude-opus-5.5', 'claude-opus-5', 'claude-sonnet-5.5', 'claude-sonnet-5', 'claude-opus-4.8', 'claude-opus-4.7', 'claude-sonnet-4.6', 'claude-haiku-5.5', 'claude-haiku-4.5', 'gemini-4-argon', 'gemini-3.8-flash', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.5-flash-lite', 'gemini-3.1-pro-preview', 'gemini-3.1-flash-lite', 'gemini-3-flash-preview', 'grok-4.6', 'grok-4.3', 'grok-4.20', 'grok-build-0.1', 'muse-wonder-1.0', 'muse-spark-1.3', 'muse-spark-1.2', 'llama-3.3-70b', 'deepseek-v4.1-flash', 'deepseek-v4-pro', 'deepseek-v4-flash', 'kimi-k3', 'qwen3.8-max', 'qwen3.8-flash', 'qwen3.8-27b', 'qwen3.7-max', 'qwen3.7-plus', 'glm-5.3', 'glm-5.3-flash', 'mistral-medium-3.5', 'step-3.7-flash', 'nemotron-3.5-lightning', 'nemotron-3-super'], defaultModel: 'gpt-5.4', moreModels: 0,+ models: ['gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.2', 'claude-fable-5-1', 'claude-fable-5', 'claude-opus-5.5', 'claude-opus-5', 'claude-sonnet-5.5', 'claude-sonnet-5', 'claude-opus-4.8', 'claude-opus-4.7', 'claude-sonnet-4.6', 'claude-haiku-5.5', 'claude-haiku-4.5', 'gemini-4-argon', 'gemini-3.8-flash', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.5-flash-lite', 'gemini-3.1-pro-preview', 'gemini-3.1-flash-lite', 'gemini-3-flash-preview', 'grok-4.6', 'grok-4.3', 'grok-4.20', 'grok-build-0.1', 'muse-wonder-1.0', 'muse-spark-1.3', 'muse-spark-1.2', 'deepseek-v4.1-flash', 'deepseek-v4-pro', 'deepseek-v4-flash', 'kimi-k3', 'qwen3.8-max', 'qwen3.8-flash', 'qwen3.8-27b', 'qwen3.7-max', 'qwen3.7-plus', 'glm-5.3', 'glm-5.3-flash', 'mistral-medium-3.5', 'step-3.7-flash', 'nemotron-3.5-lightning', 'nemotron-3-super'], defaultModel: 'gpt-5.4', moreModels: 0,systemPrompt: 'You are Deep Agents Code, an autonomous coding agent. You work on a real git workspace with shell and file access, reading and editing files and running commands to complete the task end to end.',tools: [], skills: [] },];