From a54770d6062a2a603e06946a2f4564fc9eb9bf80 Mon Sep 17 00:00:00 2001 From: Tim Lingo <1timlingo@gmail.com> Date: Mon, 13 Jul 2026 13:40:07 -0500 Subject: [PATCH] =?UTF-8?q?docs(narrated-runs):=20engine=20notes=20for=20t?= =?UTF-8?q?he=20regen=20=E2=80=94=20compiled-form=20fixes=20+=20debts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- docs/NARRATED-RUNS-ENGINE-NOTES-20260713.md | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/NARRATED-RUNS-ENGINE-NOTES-20260713.md diff --git a/docs/NARRATED-RUNS-ENGINE-NOTES-20260713.md b/docs/NARRATED-RUNS-ENGINE-NOTES-20260713.md new file mode 100644 index 0000000..a5a64cf --- /dev/null +++ b/docs/NARRATED-RUNS-ENGINE-NOTES-20260713.md @@ -0,0 +1,34 @@ +# Narrated runs — engine notes for Will (2026-07-13) + +Source half: commit aa67f86 on feat/agent-phase1-soul (run-progress ledger, +`/api/run-progress/` route, narration on the pause envelope, config display +default). E2E-verified via the compiled test bed on Tim's clean profile. + +Compiled-form-only fixes (in `neuron-container-build/soul-narrated-runs-20260713.patch`, +applies ON TOP of `soul-webfix-20260711.patch` — these need porting to chat.el when the +webfix itself is ported): + +1. **pause_turn + tool_use interleave**: a pause_turn response can ALSO carry a client + tool_use; resuming verbatim leaves it unpaired → Anthropic 400 "tool_use ids were + found without tool_result". Fix: tool-bearing pause rounds are tool turns + (dispatch + pair); verbatim resume only when the round has no client tool. +2. **Agentic toolset scope**: agentic_tools_all() fed EVERY connector/MCP tool (Notion, + code-execution…) into the loop. Code-execution flips the API into programmatic + tool calling, whose pairing protocol the single-tool manual loop does not speak — + source of the dangling-pair 400s AND the bash_code_execution workspace-dodge. + Fix: handle_chat_agentic declares builtins + ONE server web_search only. + Connector tools return when the loop gains real multi-tool/programmatic support. +3. **disable_parallel_tool_use: true** on agentic requests — the loop captures only the + first tool_use per round; Opus-class models parallel-call. Enforce the invariant. +4. **web_search server-tool default variant → web_search_20250305 (GA)**. The 20260209 + variant couples to code-execution ⇒ programmatic mode (see #2, and the June note: + "inert unless code-execution attached"). +5. **Homegrown web_search removed** from the tool catalog (server-side is the one tool). + +Known engine debts this work surfaced (not fixed): + +- **Poisoned session history**: a failed run persists the malformed assistant turn; every + later turn in that session replays it and 400s. Needs history sanitation on load. +- **Huge-history invalid-escape 400** (~346KB request) — likely the same poisoned blob. +- **macOS note**: replacing a binary in place invalidates its ad-hoc signature (instant + silent SIGKILL, looks like exit 0). `rm + cp + codesign -f -s -` is the swap ritual.