@parcha/agentrun-serve 0.0.0-bootstrap.0 → 0.1.0-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/CHANGELOG.md +560 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.md +1724 -0
  5. package/dist/adapters.d.ts +205 -0
  6. package/dist/adapters.js +459 -0
  7. package/dist/agents.d.ts +124 -0
  8. package/dist/agents.js +302 -0
  9. package/dist/app.d.ts +7 -0
  10. package/dist/app.js +324 -0
  11. package/dist/bound-files.d.ts +4 -0
  12. package/dist/bound-files.js +164 -0
  13. package/dist/box/record.d.ts +6 -0
  14. package/dist/box/record.js +41 -0
  15. package/dist/box/sweep.d.ts +53 -0
  16. package/dist/box/sweep.js +193 -0
  17. package/dist/box-image.d.ts +98 -0
  18. package/dist/box-image.js +283 -0
  19. package/dist/box-relay.d.ts +42 -0
  20. package/dist/box-relay.js +222 -0
  21. package/dist/boxes.d.ts +54 -0
  22. package/dist/boxes.js +182 -0
  23. package/dist/cap.d.ts +224 -0
  24. package/dist/cap.js +721 -0
  25. package/dist/catalog.d.ts +20 -0
  26. package/dist/catalog.js +53 -0
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.js +167 -0
  29. package/dist/coding-tools.d.ts +31 -0
  30. package/dist/coding-tools.js +81 -0
  31. package/dist/console/THIRD-PARTY-NOTICES.txt +1141 -0
  32. package/dist/console/assets/index-BN7oVcO4.js +445 -0
  33. package/dist/console/assets/index-By-jkqki.css +1 -0
  34. package/dist/console/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  35. package/dist/console/assets/jetbrains-mono-cyrillic-400-normal-CIEtRijs.woff +0 -0
  36. package/dist/console/assets/jetbrains-mono-cyrillic-600-normal-BB5xRk30.woff +0 -0
  37. package/dist/console/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
  38. package/dist/console/assets/jetbrains-mono-cyrillic-ext-400-normal-BHyURHCj.woff +0 -0
  39. package/dist/console/assets/jetbrains-mono-cyrillic-ext-400-normal-C_uLvvQ5.woff2 +0 -0
  40. package/dist/console/assets/jetbrains-mono-cyrillic-ext-600-normal-Dj6eZy5f.woff2 +0 -0
  41. package/dist/console/assets/jetbrains-mono-cyrillic-ext-600-normal-DpeVePZf.woff +0 -0
  42. package/dist/console/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  43. package/dist/console/assets/jetbrains-mono-greek-400-normal-CNojz0t3.woff +0 -0
  44. package/dist/console/assets/jetbrains-mono-greek-600-normal-3KAm9r92.woff +0 -0
  45. package/dist/console/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
  46. package/dist/console/assets/jetbrains-mono-latin-400-normal-B11XCQ5g.woff +0 -0
  47. package/dist/console/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  48. package/dist/console/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  49. package/dist/console/assets/jetbrains-mono-latin-600-normal-DXv3JcnD.woff +0 -0
  50. package/dist/console/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  51. package/dist/console/assets/jetbrains-mono-latin-ext-400-normal-DHMOLxAi.woff +0 -0
  52. package/dist/console/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  53. package/dist/console/assets/jetbrains-mono-latin-ext-600-normal-DiQlUoE6.woff +0 -0
  54. package/dist/console/assets/jetbrains-mono-vietnamese-400-normal-BeU3T8wf.woff +0 -0
  55. package/dist/console/assets/jetbrains-mono-vietnamese-400-normal-ByoDsISC.woff2 +0 -0
  56. package/dist/console/assets/jetbrains-mono-vietnamese-600-normal-CSpzN4cI.woff +0 -0
  57. package/dist/console/assets/jetbrains-mono-vietnamese-600-normal-Dtizs43-.woff2 +0 -0
  58. package/dist/console/assets/schibsted-grotesk-latin-400-normal-Cph9ettZ.woff2 +0 -0
  59. package/dist/console/assets/schibsted-grotesk-latin-400-normal-DfGZKnlb.woff +0 -0
  60. package/dist/console/assets/schibsted-grotesk-latin-600-normal-BGBUNdzT.woff2 +0 -0
  61. package/dist/console/assets/schibsted-grotesk-latin-600-normal-COje25QW.woff +0 -0
  62. package/dist/console/assets/schibsted-grotesk-latin-ext-400-normal-4l4lq8zr.woff2 +0 -0
  63. package/dist/console/assets/schibsted-grotesk-latin-ext-400-normal-BGzXWJeR.woff +0 -0
  64. package/dist/console/assets/schibsted-grotesk-latin-ext-600-normal-8_E36CQj.woff2 +0 -0
  65. package/dist/console/assets/schibsted-grotesk-latin-ext-600-normal-C27an7Zc.woff +0 -0
  66. package/dist/console/index.html +15 -0
  67. package/dist/daytona-api.d.ts +21 -0
  68. package/dist/daytona-api.js +101 -0
  69. package/dist/decision-rows.d.ts +11 -0
  70. package/dist/decision-rows.js +116 -0
  71. package/dist/decisions.d.ts +94 -0
  72. package/dist/decisions.js +184 -0
  73. package/dist/effort-guidance.d.ts +5 -0
  74. package/dist/effort-guidance.js +14 -0
  75. package/dist/environment.d.ts +5 -0
  76. package/dist/environment.js +11 -0
  77. package/dist/errors.d.ts +72 -0
  78. package/dist/errors.js +66 -0
  79. package/dist/exa-keyless.d.ts +35 -0
  80. package/dist/exa-keyless.js +202 -0
  81. package/dist/fetch-page.d.ts +114 -0
  82. package/dist/fetch-page.js +182 -0
  83. package/dist/files.d.ts +60 -0
  84. package/dist/files.js +153 -0
  85. package/dist/grade.d.ts +96 -0
  86. package/dist/grade.js +348 -0
  87. package/dist/graph-view.d.ts +100 -0
  88. package/dist/graph-view.js +212 -0
  89. package/dist/harness-app.d.ts +38 -0
  90. package/dist/harness-app.js +626 -0
  91. package/dist/harness.d.ts +53 -0
  92. package/dist/harness.js +74 -0
  93. package/dist/home-path.d.ts +27 -0
  94. package/dist/home-path.js +78 -0
  95. package/dist/host-tools.d.ts +20 -0
  96. package/dist/host-tools.js +140 -0
  97. package/dist/host.d.ts +39 -0
  98. package/dist/host.js +81 -0
  99. package/dist/hosted-search.d.ts +27 -0
  100. package/dist/hosted-search.js +129 -0
  101. package/dist/import-sources.d.ts +104 -0
  102. package/dist/import-sources.js +629 -0
  103. package/dist/import-summary.d.ts +25 -0
  104. package/dist/import-summary.js +75 -0
  105. package/dist/import-worker.d.ts +26 -0
  106. package/dist/import-worker.js +41 -0
  107. package/dist/import.d.ts +145 -0
  108. package/dist/import.js +1221 -0
  109. package/dist/index.d.ts +7 -0
  110. package/dist/index.js +6 -0
  111. package/dist/key-check.d.ts +36 -0
  112. package/dist/key-check.js +108 -0
  113. package/dist/key-refusal.d.ts +51 -0
  114. package/dist/key-refusal.js +187 -0
  115. package/dist/learn/check.d.ts +99 -0
  116. package/dist/learn/check.js +259 -0
  117. package/dist/learn/grade.d.ts +79 -0
  118. package/dist/learn/grade.js +433 -0
  119. package/dist/learn/index.d.ts +7 -0
  120. package/dist/learn/index.js +11 -0
  121. package/dist/learn/invisible.d.ts +5 -0
  122. package/dist/learn/invisible.js +42 -0
  123. package/dist/learn/notes.d.ts +59 -0
  124. package/dist/learn/notes.js +146 -0
  125. package/dist/learn/reflect.d.ts +49 -0
  126. package/dist/learn/reflect.js +167 -0
  127. package/dist/learn/secrets.d.ts +18 -0
  128. package/dist/learn/secrets.js +111 -0
  129. package/dist/learn/skills.d.ts +84 -0
  130. package/dist/learn/skills.js +198 -0
  131. package/dist/learning-routes.d.ts +196 -0
  132. package/dist/learning-routes.js +609 -0
  133. package/dist/learning-run.d.ts +304 -0
  134. package/dist/learning-run.js +797 -0
  135. package/dist/learning-words.d.ts +73 -0
  136. package/dist/learning-words.js +171 -0
  137. package/dist/learning.d.ts +377 -0
  138. package/dist/learning.js +801 -0
  139. package/dist/llm.d.ts +40 -0
  140. package/dist/llm.js +37 -0
  141. package/dist/llms.txt +37 -0
  142. package/dist/mcp-servers.d.ts +115 -0
  143. package/dist/mcp-servers.js +445 -0
  144. package/dist/mcp.d.ts +51 -0
  145. package/dist/mcp.js +392 -0
  146. package/dist/model.d.ts +184 -0
  147. package/dist/model.js +484 -0
  148. package/dist/monid.d.ts +74 -0
  149. package/dist/monid.js +277 -0
  150. package/dist/openapi/agentrun-v2.openapi.json +4805 -0
  151. package/dist/openapi.d.ts +10 -0
  152. package/dist/openapi.js +1417 -0
  153. package/dist/owner.d.ts +55 -0
  154. package/dist/owner.js +222 -0
  155. package/dist/packs.d.ts +71 -0
  156. package/dist/packs.js +180 -0
  157. package/dist/page.d.ts +32 -0
  158. package/dist/page.js +133 -0
  159. package/dist/paid-calls.d.ts +46 -0
  160. package/dist/paid-calls.js +110 -0
  161. package/dist/pause.d.ts +68 -0
  162. package/dist/pause.js +97 -0
  163. package/dist/pdf-pages.d.ts +44 -0
  164. package/dist/pdf-pages.js +147 -0
  165. package/dist/place.d.ts +46 -0
  166. package/dist/place.js +105 -0
  167. package/dist/print.d.ts +20 -0
  168. package/dist/print.js +29 -0
  169. package/dist/propose.d.ts +38 -0
  170. package/dist/propose.js +82 -0
  171. package/dist/quiet-sqlite-warning.d.ts +1 -0
  172. package/dist/quiet-sqlite-warning.js +14 -0
  173. package/dist/request-start.d.ts +14 -0
  174. package/dist/request-start.js +226 -0
  175. package/dist/result.d.ts +3 -0
  176. package/dist/result.js +5 -0
  177. package/dist/rows.d.ts +46 -0
  178. package/dist/rows.js +121 -0
  179. package/dist/run-box.d.ts +134 -0
  180. package/dist/run-box.js +440 -0
  181. package/dist/run-manifest.d.ts +27 -0
  182. package/dist/run-manifest.js +60 -0
  183. package/dist/runnable.d.ts +80 -0
  184. package/dist/runnable.js +162 -0
  185. package/dist/runs.d.ts +840 -0
  186. package/dist/runs.js +2279 -0
  187. package/dist/secret-cut.d.ts +27 -0
  188. package/dist/secret-cut.js +109 -0
  189. package/dist/secrets.d.ts +50 -0
  190. package/dist/secrets.js +140 -0
  191. package/dist/server-lock.d.ts +44 -0
  192. package/dist/server-lock.js +140 -0
  193. package/dist/server.d.ts +626 -0
  194. package/dist/server.js +1756 -0
  195. package/dist/sessions.d.ts +4 -0
  196. package/dist/sessions.js +105 -0
  197. package/dist/skills.d.ts +31 -0
  198. package/dist/skills.js +68 -0
  199. package/dist/stats.d.ts +101 -0
  200. package/dist/stats.js +82 -0
  201. package/dist/tool-keys.d.ts +151 -0
  202. package/dist/tool-keys.js +273 -0
  203. package/dist/tool-plane.d.ts +143 -0
  204. package/dist/tool-plane.js +242 -0
  205. package/dist/tools.d.ts +147 -0
  206. package/dist/tools.js +253 -0
  207. package/dist/turn-end.d.ts +23 -0
  208. package/dist/turn-end.js +14 -0
  209. package/dist/turns.d.ts +34 -0
  210. package/dist/turns.js +202 -0
  211. package/dist/uploads.d.ts +104 -0
  212. package/dist/uploads.js +474 -0
  213. package/dist/usage.d.ts +29 -0
  214. package/dist/usage.js +58 -0
  215. package/dist/validate.d.ts +55 -0
  216. package/dist/validate.js +175 -0
  217. package/dist/web-fetch.d.ts +64 -0
  218. package/dist/web-fetch.js +262 -0
  219. package/dist/web-search.d.ts +54 -0
  220. package/dist/web-search.js +136 -0
  221. package/dist/webhooks.d.ts +182 -0
  222. package/dist/webhooks.js +487 -0
  223. package/dist/workspace-paths.d.ts +33 -0
  224. package/dist/workspace-paths.js +104 -0
  225. package/dist/workspace.d.ts +88 -0
  226. package/dist/workspace.js +369 -0
  227. package/launcher/agentrun-serve +109 -0
  228. package/package.json +96 -1
  229. package/skills/agentrun-serve/SKILL.md +128 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,560 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## 0.1.0-beta.29 (2026-11-04)
6
+
7
+ - New held package `@parcha/agentrun-serve`: the Agentrun v2 API (`agentrun.v2/0`, the contract the hosted API serves) on
8
+ your own machine. `agentrun-serve` serves `http://127.0.0.1:7340/v2` over agent homes of `@parcha/pi-durable-agent` in a
9
+ data directory (default `~/.local/share/agentrun/agents`, `--data`), with a bearer token it writes there at mode 0600 and
10
+ prints at start with `AGENTRUN_BASE_URL`. It binds loopback only, refuses a `Host` that is not a loopback name, and sends
11
+ no CORS headers. It serves capabilities, agents (create, list, read), runs (start, list, read, the timeline as JSON pages
12
+ with the change-number cursor and as server-sent events, messages that steer, answer or follow up, stop, cancel), a
13
+ run's files under `work/`, and usage as an estimate. Each run is a child process of `pi-durable-disk run`, read through
14
+ its door while it is live and from its released store after; a run that answered is carried back to its home and is
15
+ finished. A run's tools are the ones its definition names, of `read`, `write`, `edit` and `ask_person`, which ends the
16
+ turn until a message answers it. With an `output_schema`, a run's output is its final answer parsed as a JSON object,
17
+ and an answer that is not one ends it `failed` (`output_invalid`). `--faux MODULE` answers every model request from a module, with no key and no network; without it the model is
18
+ an OpenAI Responses endpoint named in `AGENT_MODEL_BASE_URL` and `AGENT_MODEL`. Home export and import, definition
19
+ updates, uploads, quotes and kill answer `501 unsupported_here`, and capabilities say so.
20
+ - A run that a restarted server adopted now ends final after it answers. The server read the run's store as soon as the run said it was released, while the run's process could still hold the store's exclusive lock until it exited; that read failed with `database is locked`, was not retried, and left the run `completed` but never final until the next start. The server now reads an adopted run's store once its process has exited (it reads anyway, and says so, if the process lives on 30 s after it released the run), retries a store that another connection holds within the same bounded retries as a busy agent home, and writes each wait and a run it could not settle or recover to stderr.
21
+ - `packages/serve`: the recovery tests' stand-in run writes `run.json` whole, through a temporary file and a rename, as a run does. A plain rewrite let the server's 500 ms read land on a half-written record, read it as no record, and settle the adopted run early, which failed "an adopted run that released is read only once its process has exited" about once in a loaded full run.
22
+ - A half-written JSON file can no longer crash agentrun-serve. Reading a run's `run.json` or a `serve.json` caught a failed read but not a parse error, so a half-written file threw out of the adoption timer as an unhandled rejection, which ends a Node process by default. A file that is not whole JSON now reads as no file. An adopted run whose record cannot be read while its process lives is read again at every tick and stays supervised; the server says so once it has been unreadable for 5 s. The server writes its own `serve.json` files whole, through a temporary file and a rename.
23
+ - `agentrun-serve` serves one agent store of `@parcha/pi-durable-agent` instead of an agent home per agent: the data directory holds `store.sqlite` and `runs/<id>/`, and beta.24 agent homes in it are not read. An agent is a row with revisions written once; a definition with `instructions` makes an agentic revision and one with `workflow` (an agentrun-dsl workflow, checked before anything is written) a workflow revision, and an agentic one may name its `model` as `provider/model-id` and its `thinking` level (never off; a run's `effort` outranks it, and `AGENT_THINKING` is the host's default). `PUT /v2/agents/{id}/definition` now commits a new revision whose parent is the current one and makes it current (without `skills`, the current revision's skill files carry over; `If-Match` guards it), `GET /v2/agents/{id}/revisions` lists them, `POST /v2/agents/{id}/current` makes one current again, and `GET /v2/runs` lists every agent's runs, newest first, by agent, revision and status. A run pins the current revision or the one `POST .../runs` names, and the store's row records it; the Agent's ETag is its current revision. A definition's `input_schema`, `output_schema` and `max_cost_usd` have no place in a revision and are refused by name (per-run `max_cost_usd` stays). Capabilities list the `tools` an agentic revision may name and what a workflow's model nodes get (`workflows`).
24
+ A workflow revision's run starts its workflow with `startWorkflowRevision` of `@parcha/pi-durable-agent/workflow` in the run's process, each model node on the host's model of its tier (`AGENT_MODEL_FAST` and `AGENT_MODEL_STRONG`, each falling back to `AGENT_MODEL`, listed in capabilities' `models`), and the server carries it back with `workflowCarry` once the process has exited, as it carries back every run; its output is the run's `result.output`, its rows come when it ends, and it takes no messages; one that escalated is `failed` with `error.code` `escalated` and its summary. A workflow that needs a tool call, a judge or code is not runnable here (`409`), and an input its workflow does not take is `422`. A model comes from `--faux`, from the `AGENT_MODEL_BASE_URL` gateway (every model id through one endpoint), or else from pi-ai's providers with their keys from the environment; `AGENT_MODEL` is the default for a revision that names none, and a model that cannot be reached here is `409 agent_not_runnable`. When the server starts, a run whose process went before the run ended is opened again on its directory and resumes from its store, where it was marked failed.
25
+ - `agentrun-serve` runs in one container: `--listen ADDR` listens on another address than 127.0.0.1 (there every `Host` name is served and the token is the only lock), and `AGENTRUN_TOKEN` gives the token in place of `DIR/.token`'s and is never printed. The repository has `packages/serve/docker/Dockerfile` (the server and the open packages it runs, everything it keeps under `/data`), a compose example that publishes the port on loopback only, and `render.yaml`, a Render blueprint with a persistent disk and a generated token. The image's build context is an allowlist (`.dockerignore`): a `.env`, `.env.*` or `.npmrc` never enters it, wherever it is in the checkout.
26
+ - `agentrun-serve` serves a page at `/`, AgentRun Server, for the person who holds its token: the agent store's page from `@parcha/pi-durable-agent` (agents, revisions with the prompt diff and the workflow graph, runs, a run's timeline) plus every run across agents, forms that create an agent, commit a revision, make a revision current and start a run through `/v2`, and a live run followed until it is final, with an answer box while it waits on `ask_person`. The server prints one more line, `Open` and the page's address with `?token=` and its token; opening it sets an `HttpOnly`, `SameSite=Strict` cookie that stands in for the Bearer header (a write only from the page's own origin with a JSON body).
27
+ `@parcha/pi-durable-agent/serve` exports what another server needs to serve the store's page: `storeApi(store)`, the read-only JSON behind its `/api/*` paths, and `STORE_PAGE_FILES`, its files. The page takes a script loaded before `page.js` that sets `window.agentStoreHost`; `pi-durable-agent serve` loads none. A cost under a cent now shows two significant digits ($0.00014, not $0.000), and a recorded 0 shows as $0.
28
+ - `PUT /v2/agents/{id}/definition` with `If-Match` is compared inside the store's commit, so of two edits that read the same revision exactly one lands and the other answers `412`, where both could land, the second on top of the first. A run's process loads only the model tiers its revision uses, so a workflow of fast nodes runs with `AGENT_MODEL_FAST` and no `AGENT_MODEL`. A run's process no longer gets the server's token: `AGENTRUN_TOKEN`, `AGENTRUN_API_KEY` and any variable holding the token are left out of its environment, and model keys and the `AGENT_MODEL` variables still reach it.
29
+ - The README's Safety section says what holds a run in: its file tools reach its own `work/`, plus reads of its own `tmp/` and writes in a temporary directory made for a tool, and nothing else (pi-durable-disk's confinement in the run's process, since the run and the server share a user), and no path offers a shell, so `bash` stays off. A new suite of real runs probes it: reads of the server's and the door's tokens, `store.sqlite`, another run's `work/` and `tmp/`, `/proc` and a link planted in `work/`, writes and an edit outside `work/` (its own `tmp/` included), and `bash` called by an agent and by a workflow's model node are each refused, with nothing changed on disk, while the same run still reads and writes inside `work/` and reads its own `tmp/`.
30
+ - Through a gateway (`AGENT_MODEL_BASE_URL`), a revision that names its model as `provider/model-id` is now sent to the gateway whole (`openai/gpt-4o`), as a gateway like OpenRouter names its models `vendor/model`; it was sent as `model-id` alone. Who breaks: a gateway that expects the id without its provider. What to do: set `AGENT_MODEL_GATEWAY_IDS=bare` to keep the old behaviour. Unchanged: `AGENT_MODEL`, `AGENT_MODEL_FAST` and `AGENT_MODEL_STRONG` are sent as they are set, and the price is still the named provider's catalog entry for the model, else the highest.
31
+ - Archive an agent or a run: `POST /v2/agents/{id}/archive` and `POST /v2/runs/{id}/archive` (and `.../unarchive`), this server's own routes outside the `/v2` contract, listed in `capabilities.features.archive`. An archived agent and its runs, or one archived run, are hidden from `GET /agents`, `GET /runs` and `GET /agents/{id}/runs` (`?archived=true` lists only those), and kept: every read by id still answers, with `archived_at`, and `/usage` still counts them. A new run of an archived agent is `409 agent_not_runnable`; a run already going keeps going. Nothing is deleted, and `DELETE` stays `405`. The page has Archive and Unarchive on an agent's page and a run's page, and Show archived on the agents and on All runs.
32
+ - `AGENTRUN_PUBLIC_URL` sets the address the printed `Open` link and `AGENTRUN_BASE_URL` name, so a container published on another port, or behind a proxy, prints a link that works; a value that is not an http(s) URL stops the server at start. The compose example's `AGENTRUN_PORT` publishes another port and sets that URL. `render.yaml` and the compose example take `OPENROUTER_API_KEY` (pi-ai's OpenRouter provider, `AGENT_MODEL=openrouter/<model>`) and a gateway's `AGENT_MODEL_BASE_URL` and `AGENT_MODEL_API_KEY`. The root README opens with AgentRun as an open platform to manage your agents (the platform, AgentRun Server and the building blocks), then the two ways to host it: `docker run` with the public image, or Render's Starter with a disk.
33
+ - `GET /v2/openapi.json` serves this API as an OpenAPI 3.1 document, with no credential, as capabilities are, and capabilities link it (`links.openapi`). It is the `agentrun.v2/0` contract, vendored unchanged in `src/openapi/agentrun-v2.openapi.json` with its source (repository, pull request and commit) in `info.x-agentrun-source`. The server marks its own routes outside the contract (`GET /runs`, `GET /agents/{id}/revisions`, `POST /agents/{id}/current`, and the document itself) `x-agentrun-serve: true`, and the six operations it answers `501` (home export and import, kill, the two upload routes and quotes) `x-agentrun-serve-unsupported` with the reason. A test holds the document to the server's route table, both ways.
34
+ - **The page is yours: one owner and a password, on by default**
35
+ - AgentRun Server is for one person, who signs in to the page with a password. This is on unless `AGENTRUN_ACCOUNTS=0`. With no `AGENTRUN_PUBLIC_URL` (as `docker run` gives it; on Render, its `RENDER_EXTERNAL_URL` stands in), the first visit sets the password, 12 characters or more, and signs in. With it, setup takes the code the server prints, or the token as the Bearer. A second setup is a 403. `startServe` takes this as `accounts` and `openSetup` (both off by default for a library caller).
36
+ - The password is kept as a scrypt hash (N 2^15, r 8, p 1, with a 16-byte salt and its parameters) in `DIR/owner.json` (0600). A session is a cookie signed with HMAC-SHA256 under the key in `DIR/.session-secret` (0600). It holds when it was made, when it ends (30 days, checked from the signed payload) and the session epoch. The cookie is HttpOnly, SameSite=Strict and Path=/, `__Host-agentrun-session` with Secure on https. No run's tool reaches either file.
37
+ - `POST /v2/setup`, `POST /v2/auth/sign-in`, `POST /v2/auth/sign-out` and `GET /v2/auth/session` take writes only from the page's own origin with a JSON body. Sign-in tries are limited to 10 per address in 15 minutes, keyed on the connection's peer, never on a header. **Sign out everywhere** ends every session on every browser.
38
+ - `agentrun-serve reset-password --data DIR`, run where the data directory is, clears the password and ends every session; the next visit sets a new one. It is never an HTTP route.
39
+ - The token keeps working for scripts and the CLI. With accounts on, a `?token=` page link sets no cookie and the start's `Open` line holds no token: the page is the owner's session alone, so **Sign out everywhere** leaves no browser in. The sign-in limit keeps up to 10,000 addresses; past that a new one gets a 429 and an address already limited stays limited.
40
+ - Every route but capabilities, the contract and health takes the owner's session or the token. The contract's answers do not change.
41
+ - On pi-durable 1.2 and later, the model's record of an `ask_person` call was empty: the tool returned its text under `content`, which 1.2 renamed to `output`. It now returns both, so every pi-durable serve takes (1.1 to 1.3) reads it. The released image ships pi-durable 1.1.0 and was not affected; builds from source on 1.2 or 1.3 were.
42
+ - AgentRun Server caps its concurrent runs, says whether it can work, and settles runs a full disk left behind.
43
+
44
+ - The most runs at once (each with a live process) is `--max-runs N` or `AGENTRUN_MAX_RUNS`, by default `max(1, floor((memory − 128 MiB) / 72 MiB))` from the container's memory limit or the machine's (5 on a 512 MB instance, which ran out of memory at about 6 before). Over it, `POST /v2/agents/{id}/runs` is `429 rate_limited` with `retry-after`, and nothing starts. `capabilities.limits.max_concurrent_runs` reports it.
45
+ - `GET /v2/health`, with no credential, is `200` when the agent store opens for a read and the data directory's disk has 64 MiB free (`AGENTRUN_MIN_FREE_MB`), else `503` naming the check that failed, and no path, size or version. Compose's healthcheck and `render.yaml`'s `healthCheckPath` use it; before, the health check was `/v2/capabilities`, which stayed `200` on a full disk.
46
+ - A run whose end the agent store cannot write (a full disk) still ends: a cancel makes it `cancelled`, priced from its rows, where before it stayed `queued` or `working` and cancel could not settle it. The server writes the end again every 30 s until it lands.
47
+ - A message to a run whose process was killed opens it again at once, where before it was `503` for up to the 90 s lease: a heartbeat of a process that is gone is no longer trusted.
48
+ - A free-disk reading that fails is `disk: "cannot_check"` (`503`), never room. A data directory serves one AgentRun Server at a time; two on a shared disk are not supported.
49
+ - Through a gateway (`AGENT_MODEL_BASE_URL`) with no `AGENT_MODEL_PRICE`, a model id pi-ai's catalog knows now takes the catalog's list price, so its runs' costs are estimated instead of reading $0. A revision's `provider/model-id` takes that provider's entry when it is paid; a bare id (`AGENT_MODEL` and the tier variables), a provider the catalog does not list for it, or one it lists at $0 takes the highest price any provider lists: one entry's whole price, the most input plus output, never a $0 entry over a paid one, so a named provider's $0 never switches off `max_cost_usd`. A price you set still wins, and an id the catalog does not know is still priced at $0. A behavior change: a run's `max_cost_usd` now applies to these gateway models and stops the run with `spend_cap_reached` once its estimate passes the cap; at $0 it never fired.
50
+ - **A run that ended is never started again, so its place is free once it reads failed**
51
+ - A run's first message waits for the run's process to come up. When that process failed at its start, the settle that ended the run could finish while the wait read the run's `run.json`, and the wait then started the process again: a second process for a finished run, holding its place, so the next start under `--max-runs` could be a 429 `rate_limited`.
52
+ - The wait now checks whether the run ended after each read, and a run that ended or is finishing is never launched.
53
+ - A run whose process fails as it starts is no longer started again while its end is being written. The first message's delivery could start a second process in that window, so the run read `failed` while that process still held its place under `--max-runs`, and the next start was refused (429). Nothing starts a run's process now while a settle of that run is in progress.
54
+
55
+ A run whose first message was still on its way when the server stopped no longer has its end written after the stop, into a store the stop had closed. The next start recovers the run and writes its end then. A run's first message also waits out a process that is slow to come up, up to the ready time (45 s), whatever deadline a later request to the run has.
56
+ - AgentRun Server is easier to run: a stop ends within the platform's grace, the token link takes any token, and stdout says what happened.
57
+
58
+ - `--drain-timeout D` sets how long a busy run may finish its turn when the server stops (default 30s), and the image's command sets 6s, so a busy stop ends in about 7.5 s, inside Docker's default 10 s grace, so a busy `docker stop` no longer ends in SIGKILL (exit 137). Compose sets `stop_grace_period: 15s`. Render waits 30 s and does not let a service with a disk change it, which `render.yaml` now says. A turn cut off resumes at the next start.
59
+ - The page's `/?token=` link signs in with a token holding `+`, `/` or `=` whether it is URL-encoded or not (a `+` sent raw arrives as a space), and the printed link encodes the token. Before, Render's generated tokens often had a `+`, and the documented link answered 401.
60
+ - stdout gets one logfmt line per request (method, path without its query, status, ms), per run start and end (run, agent, status, cost) and per refused credential (route and reason, never the token or any part of it). `AGENTRUN_LOG=quiet` leaves out the request lines. A run whose process failed at its start says why in words, not as the process log's raw JSON.
61
+ - `DIR/.token`'s token is printed only by the start that made it; a later start prints `AGENTRUN_API_KEY=<in DIR/.token>` and `?token=<in DIR/.token>`. `startServe` returns `tokenMade`, takes `log`, and `banner` is exported.
62
+ - AgentRun Server refuses to start on a data directory that holds agent homes from 0.1.0-beta.26 or earlier (`<data>/<agent>/agent.sqlite`), naming each one, instead of starting with none of their agents or runs showing. That includes a volume already started on 0.1.0-beta.27 that still holds one, an agent named `runs`, and a symlinked home. The serve README's "Upgrading from 0.1.0-beta.26" says what to do: keep the earlier version on that directory, or start this one on a new directory, or with the old homes moved out.
63
+ - `POST /v2/agents` and `PUT /v2/agents/{id}/definition` now check a definition for what keeps it from running here, with the checks a run makes before it starts. A definition that can never run here is `422 input_invalid` by field and nothing is saved: a tool this host does not bind (`definition.tools[i]`, `bash` among them), a model pi-ai does not know (`definition.model`), empty instructions (`definition.instructions`), or a workflow that needs a tool call, a judge, code or a node tool other than `read`, `write` and `edit` (`definition.workflow`). Before, these saved (`201`/`200`) and every run was `409`. A definition this host cannot run yet but could (no key for the model's provider, no default model, no model for a workflow tier) still saves, and the answer lists what is missing in `warnings`; the page shows them. Runs of such a revision, or of one saved before these checks, are still `409 agent_not_runnable`.
64
+ - `max_cost_usd` is now a cap, checked before each model request in the run's own process: when what the run has spent plus the request's worst case (its input tokens at the model's input price, its max output tokens at the output price) would pass the cap, the request is not sent and the run ends `failed` with `spend_cap_reached`. Before, it was checked only after each response, so one request could cost any amount over the cap. Spent so far is read back from the run's store when its process starts, so it survives a restart. The server's check after each response stays as a backstop, and a run the cap stopped now keeps the answer it paid for in `result.final_answer` instead of `result: null`.
65
+
66
+ A cancelled run, and any run that made no model request, now costs $0 instead of `null`, and `/v2/usage` adds a run whose cost is unknown as $0, so one such run no longer makes every total and line `null`. The README says what `limits.max_cost_usd: null` means: no ceiling on the cap a run may name.
67
+
68
+ A response of unknown price (one with no cost in its usage) leaves its run's `cost.usd` `null`, never $0, and `/v2/usage` counts such runs in `unpriced_runs`, in its total and in each line, beside the dollars of the runs whose cost is known.
69
+ - A run's spend cap now counts every request's input on every harness, with one bound: a token per UTF-8 byte of what is sent, plus what the provider adds server-side. That bound is at the dearer of the model's input and cache-write prices, plus the request's output ceiling. What the provider adds is documented for Anthropic and OpenAI (their tool-use prompt and per-image maximum). For every other API kind it is assumed: 2,048 tokens for a request with tools, and the largest per-image maximum for each image. So the bound never undercounts as documented for Anthropic and OpenAI, and as an assumed bound elsewhere.
70
+ - codex and claude-agent: before, the cap priced only the output ceiling, so a request with a large input could pass a cap it should not. Each request still in flight now holds its own input bound too, so requests sent side by side cannot pass the cap together. A request whose input could not be measured is refused under a cap.
71
+ - pi: the input was pi's estimate, about 3.5 characters a token. It is now the byte bound, which is stricter, so **a capped pi run can now be refused a request it used to be allowed**, most of all for dense text such as non-Latin scripts and emoji.
72
+ - A model serve has no price for, a gateway model the catalog does not list and no price is set for, is refused under a cap. Before, it read $0 and never reached one. A model the catalog lists at $0 is a known $0 and passes, and with no cap nothing is refused.
73
+ - No API kind is refused for being one: a capped run on Gemini, Bedrock, Mistral or a Chat Completions gateway is priced as above.
74
+ - Uploads work on the first try. `upload.url` in the answer to `POST /v2/files` is now a path from the server's root, `/v2/files/{file_id}`, where it was `/files/{file_id}` relative to `/v2`: a client that appended it to the `/v2` base (`$AGENTRUN_BASE_URL$url`) now sends it to the server's address instead (`${AGENTRUN_BASE_URL%/v2}$url`), or resolves it against the base as a URL; a doubled `/v2` answers a `404` that says so. The route itself, `PUT /v2/files/{file_id}`, is unchanged.
75
+ - A file is sent in one call: `POST /v2/files?path=<its path>` with its bytes as the body (`curl --data-binary @plan.md`), any type but a multipart form, answered `201` with the file `ready`, its length the body's and its hash its own. `content_type` and `sha256` may go in the query too, and `Idempotency-Key` replays the first file for the same bytes. The contract's two-step JSON reservation and `PUT` are kept.
76
+ - `GET /v2/files` lists the server's uploads, newest first, `GET /v2/files/{file_id}` reads one's record, and `DELETE /v2/files/{file_id}` removes it; a run that copied a deleted file keeps its copy.
77
+ - The page's session may send a file in one call with any content type, still only with the page's own `Origin`: `POST /v2/files` is marked to take bytes, beside `PUT /v2/files/{file_id}`.
78
+ - `npx @parcha/agentrun` installs the server it was released with: `@parcha/agentrun-serve` is its one dependency, at the release's exact version, so npx installs the two together and nothing is fetched at run time (no `@latest`). The command passes its arguments through, with its store (`--data ~/.agentrun` unless `--data` names another), and the server's CLI picks what it used to: with no `--port`, `agentrun-serve` takes the first free port from 7340, found by listening, so a port another process takes at the same moment is passed over (`--port N` is still exact and fails at once when taken, `0` any); `--open` opens the console's page in the browser once the server listens (never the banner's sign-in link, so the token stays out of the opener's arguments and the browser's history), except in CI or on Linux with no display (the command passes it unless `--no-open`). The CLI sets no model: with no `AGENT_MODEL`, the server's default is the first provider key it has, set where it starts or saved in the console's Settings → Model keys, so a key saved later moves the default with no restart. The release publishes the command after the server, and `release-preflight` refuses a command whose server pin is not the release version, so every release bumps the command too. This release publishes `@parcha/agentrun` 0.3.4.
79
+ - `boxSlot` (`@parcha/agentrun-kernel/host`) runs one session's harness boxes one at a time, whatever the isolation: how a box starts and how it is reaped are its arguments, in the shapes of the kernel's new `Box` (`host/box.ts`: `BoxSpec`, `BoxRecord`, `BoxRecorder`, `BoxedChild`, `Reaped`, `BoxError`).
80
+ - `start` is synchronous. It is refused with `BoxError` `box_busy` while the session's last box is live, being reaped, or was not counted empty. The box's start writes its record before the spawn (`ahead`) and before its first process is let go (`started`).
81
+ - The box is reaped as soon as its process exits or is never let go. Only the reap's own count frees the slot. The box's exit status and output are never read, since anything in the box can forge them. A box left with processes, or one nothing could count, rejects with `box_not_empty` and keeps the session from starting another. `adopt` reaps the record a session's last box left before anything starts.
82
+ - serve's `writeDurableSync` and `writeDurable` sync the new file and its directory before they return. `boxRecorder` writes a run's `box.json` with them, and refuses a record that names no writer, since such a record could never be cleared safely.
83
+ - A box that exits while its `started` record is still being written is reaped once that write lands, by the record it wrote. A box that has ended records nothing more, so a late write never replaces the next box's record.
84
+ - The durable writes write every byte or fail. A short write (a disk nearly full) is never synced and renamed as a whole record; the recorder refuses it with `box_record_failed` and leaves no part behind.
85
+ - A `claude-agent` run loads the revision's skills through the Claude Agent CLI's Skill tool instead of reading them all in its system prompt. The model is shown each skill as `agentrun:<name>`, loads its `SKILL.md` when it needs it, and reads the skill's other files with `read_skill_file`; the system prompt carries the instructions alone. A skill the adapter does not take (a name that is not lowercase letters, digits and dashes, a `SKILL.md` without front matter giving its `name` and a `description`, a file path that is not plain or is deeper than five segments) stays inlined in the system prompt as before, and so do all of them when together they hold more than 1 MiB. The check is the adapter's own `skillProblems`, so a run is never refused for a skill serve took. `pi` and `codex` runs still inline every skill.
86
+ - An agent's page in the console runs the agent and shows its analytics. A run bar under the header takes an agentic agent's first message, or a workflow agent's input as JSON (prefilled with its example, else its fields empty), and an effort from the server's `features.efforts` ("default" sends none). A started run opens on its page; a refusal (a `409 agent_not_runnable`, a `422` with its fields) is shown in the bar, and sending again is the same request under the same `Idempotency-Key`. An archived agent has no run bar. The Runs tab shows each run's effort, and an Analytics tab, on a server whose `GET /v2/stats` answers `analytics`, shows the agent's tokens, time, success, cost, success by harness and effort, top tools, and runs and tokens per day over the last 7 or 30 UTC days or every run, drawn with Mission Control's analytics components: a token sum says how many runs it holds, unmetered requests are named, and a cost not known is never $0.
87
+ - serve's runs index (`GET /v2/runs`, `GET /v2/agents/{id}/runs`) now carries a run's `effort` as `GET /v2/runs/{id}` does: optional, absent for a run started with none, marked `effort/1` in the served OpenAPI document. The document also lists every other field a run answer carries beyond the contract, marked `serve/1`: `revision`, `kind` and `archived_at` on `Run` and `RunSummary`, and `error` on `RunSummary`. Before, a run or a runs-index answer did not meet the document's closed schemas.
88
+ - `GET /v2/capabilities` names each harness's default model: `harnesses[].default_model`, the model this server runs for that harness when a definition names none (`provider/model-id`), or null where it runs none (the harness does not run here, or no default model here runs on it; claude-agent never takes a gateway's model). It is the model a save and a run resolve, through one function (`harnessModel`, which `blockersOf` now calls too), so capabilities and saves cannot disagree. The console reads it: the editor's Model field and the agent page offer each harness the default the server names for it, so a codex agent behind a gateway is offered the gateway's default, and a claude-agent agent is told to choose a model. A server that does not name them keeps the console's earlier rule, pi alone. Capabilities also name the routing prefix this server puts before a gateway's model ids, `models.route_prefix` (`agent-model`; null with no gateway), and the console takes exactly that off a model's label, never a first segment read off the id, so a gateway id with no routing prefix keeps its provider. The exported `capabilities()` helper resolves each harness's offer itself and returns a promise of the document the route serves, `default_model` included, so a direct caller's document passes the published schema. The published document's `Capabilities.models.source` takes on `gateway` and `providers` (marked `models/2`): it held only the contract's `managed`, `chatgpt`, `env` and `faux`, so every answer of a server without `--faux` failed the schema the server publishes.
89
+ - **A decision Jev answers is booked at TypeSafe's published price, as an estimate**
90
+ - `jevProvider` prices the counted tokens of a TypeSafe call at `JEV_PUBLISHED_PRICING` ($0.042 per million input tokens, output tokens free) unless `pricing` says otherwise, and books it with `cost_basis: "estimate"`. A cost the response reports still wins, booked `reported`. With no token counts, on the OpenRouter route, or for a call that may have been billed, the cost stays `null`, never 0.
91
+ - agentrun-serve: a decision workflow run's `cost.usd` is its decisions' estimated sum, where it was `null` before.
92
+ - agentrun-serve: a run's usage row keeps a decision's cost to the millionth of a cent, so it agrees with the run's `cost.usd`, and a cost above zero but under a hundredth of a cent reads `<$0.0001`, never `$0.0000`.
93
+ - OpenRouter's key alone now runs every harness. With `OPENROUTER_API_KEY` set and none of a harness's own settings, claude-agent uses OpenRouter's Messages endpoint and codex its Responses API, both at `https://openrouter.ai/api` with the key as a bearer token. The OpenRouter model key's defaults are `openrouter/openai/gpt-6-sol` for pi, `anthropic/claude-sonnet-5.5` for claude-agent and `openai/gpt-6-sol` for codex. Anthropic's and OpenAI's keys still give the default first where they are set. A harness's own settings still win: the endpoint the host names (`ANTHROPIC_BASE_URL`, `AGENT_MODEL_BASE_URL`), then the vendor's key. An endpoint the host names never gets the OpenRouter key.
94
+ - claude-agent sends Anthropic's own model id (`claude-sonnet-5-5`) to OpenRouter, as it does direct, and its run is priced by OpenRouter's catalog entry. `claudeProvider` returns `{ origin, credential, auth, modelId, priceModel }` (the `ClaudeProvider` type), so anything else that calls the run's model reads the same answer.
95
+ - A model named `openrouter/<vendor>/<model>` (pi's name for it) runs on claude-agent and codex too. claude-agent used to refuse it as more than one segment.
96
+ - pi now takes serve's gateway at `<base>/v1/responses`, after one trailing `/v1` is taken off the base, as codex and claude-agent do. `AGENT_MODEL_BASE_URL=https://openrouter.ai/api` used to send pi to `/api/responses`, a 404 at OpenRouter.
97
+ - With no model here, the words name `OPENROUTER_API_KEY` first, and claude-agent's name it too.
98
+ - A provider's 401 now fails the run with the key by name and where to set it, on every harness: "OpenRouter refused OPENROUTER_API_KEY (401: User not found): set it where AgentRun starts, or save it in Settings → Model keys." Only the provider's first sentence is kept, and never the key. Anthropic's and OpenAI's keys, and serve's gateway key (`AGENT_MODEL_API_KEY`), read the same way.
99
+ - The server admits runs by the memory their harness takes, not by a count that assumed every run costs the same. Each run with a live process reserves its harness's measured size (pi 128 MiB, codex 192 MiB, claude-agent 288 MiB) out of the container's memory limit, or the machine's, less the server's own 128 MiB. A 512 MB instance holds 3 pi runs, 2 codex runs or 1 claude-agent run at once; before, it admitted 5 runs of any harness, and one claude-agent run there killed the container, server included.
100
+ - A start that doesn't fit in what is left is the same `429 rate_limited` with `retry-after` as before, its message naming the harness and the memory it needs and has free (`details.harness`, `needs_mb`, `free_mb`). There is still no queue, and a message to a run already going is never refused for a place. A run's process the next server adopts after a restart holds its harness's memory there; a run whose harness never fits that server fails with why instead of starting again.
101
+ - A harness whose single run can never fit (claude-agent on a host under 416 MB) is unavailable: its capabilities entry says why, a save warns, and its runs are `409 agent_not_runnable` with that reason, not a 429 to retry. pi always has one place.
102
+ - `--max-runs N` and `AGENTRUN_MAX_RUNS` still cap the count, and both limits apply. By default the count is as many pi runs as fit.
103
+ - Capabilities' `limits.max_concurrent_runs` is pi's count (the smallest run, so the most at once). Each `harnesses` entry adds `run_memory_mib` and its own `max_concurrent_runs`, marked `harness/2` in the served document.
104
+ - Each agent now has a home, a directory of its own under the data directory that stays across its runs, named by its id in lower case and a hash of the id so ids that differ only in case never share one. `GET /v2/agents/{id}/home/files` lists its files in the shape of a run's file list, and `GET`, `PUT` and `DELETE` on a file's path below it read, write and remove one, whole and never through a link, up to `capabilities.home.max_file_bytes`. `learning/` is the server's: the list shows it as one entry with `host_owned: true` and none of its notes, and a read, write or delete at or under it, in any case, is `403 system_file_forbidden`, since its notes are read through `/v2/agents/{id}/learning`. Where the server has no `/proc/self/fd` to hold a write to its directory (macOS), `capabilities.home.writes` is `false` and a home's `PUT` and `DELETE` answer `501`. Runs do not see the home yet, and `GET`/`PUT /agents/{id}/home` still answer `501`.
105
+ - An agent definition can name its place: `{mode: "runner"}`, which has no shell, or `{mode: "sandbox", box}` with `bwrap`, `docker`, `modal` or `daytona`, where the agent's file and shell tools run in the box while its loop, its log and every key stay on the server; any other shape is `422 input_invalid` on `definition.place`. The revision keeps the place it names, an explicit runner included, and a definition that names none keeps none, so existing revisions keep their ids and answers show no place for them. An edit that names no place keeps the agent's. `GET /v2/capabilities` lists `places` (the modes, the default `runner`, and each box with whether this server has it); no box is set up on any server yet, so a sandbox place saves with a warning and its runs are `409 agent_not_runnable` with `details.box`.
106
+ - In a Docker sandbox place on Linux, `read`, `write` and `edit` run on this server, on the `work/` the container binds, instead of as a `docker exec` each (half a second or more per call). `bash` still runs in the container, and a run that never calls it gets no container.
107
+ - The file tools take nothing a command in the box can plant. A link anywhere on the way is refused, one pointing inside `work/` included, and so is a file with another hard link. Every directory is walked on held handles (`/proc/self/fd`), so one swapped for a link between the check and the use is refused too. A write goes through a temporary file renamed over the old one, keeping its mode; a new file is `0644`. A refusal names the box's path and says that `bash`, in the box, can still reach the file.
108
+ - A run whose earlier process left its box (a crash mid-`bash`) has that box's leftover commands killed before its first `read`, `write` or `edit`, so none of them changes `work/` under the file tools. A fresh run still makes no box for them.
109
+ - The model still names and sees the box's paths (`/run/agentrun/run/work/...`), mapped one for one onto the bind's source.
110
+ - Where the server reaches directories by path (no `/proc/self/fd`, as on macOS), or the box binds nothing, all four tools run in the box as before.
111
+ - The server sets up the boxes `AGENTRUN_BOXES` lists and probes each once at start, all at once and each within 5 s. The boxes are `docker`, `daytona` and the VM provider's, and `bwrap` comes later. Every box is available or not, with a short reason that holds no key, and one `event=boxes` log line says which. A box the list does not name is never probed, and a name that is no box refuses the start. No run uses a box yet. The boxes come from `@parcha/pi-transport`, now an optional peer, and the VM provider's SDK is the host's to install.
112
+ - Fixed: a box key set in the server's environment reached every run's process. The launcher now holds these keys with its other secrets (`DAYTONA_API_KEY`, `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET`), and no run's process is handed one, in its environment or on its pipe.
113
+ - A run's Docker box has CPU, memory and process limits by default: 2 CPUs' time, 4 GiB of memory with swap included, and 1,024 processes and threads (`--cpu-period 100000 --cpu-quota 200000 --memory 4g --memory-swap 4g --pids-limit 1024`). Before, `docker run` set none, so one run's fork bomb or runaway build could starve the host. `AGENTRUN_BOX_CPUS` (at least `0.01`), `AGENTRUN_BOX_MEMORY` (a size with its unit, such as `8g`, at least `6m`) and `AGENTRUN_BOX_PIDS` (at most 4,194,304) change them. Any other value refuses the start and names the setting. The CPU limit is a CFS quota, the cap `--cpus` sets, so it holds whatever CPU count Docker's VM has, and Docker ignores it with a warning where the kernel gives it no CPU controller. `--cpus` fails in both cases.
114
+ - `dockerBoxes` takes `cpus`, `memory` (bytes, or Docker's size such as `4g`) and `pidsLimit`. They become `--cpu-period 100000 --cpu-quota <cpus × 100000>`, `--memory` with `--memory-swap` the same, and `--pids-limit`. A spec's own `cpus` or `memoryMb` takes the place of the option's, and a spec's `cpus` is now a quota too, where it was `--cpus`. A spec's `memoryMb` now bounds swap too, and `facts()` reports the limits a box got. A value under 0.01 CPUs, a memory that is not positive or not a size, or a `pidsLimit` outside 1 to 4194304 throws when the provider is made.
115
+ - With a box host given (`startServe({ box })`: the box's reap and, on a shared server, its run cgroups), serve lets go the boxes runs leave.
116
+ - A run's box (its `box.json`) is reaped once the run process that recorded it is gone, by pid and start time, at start and when the run or its agent is archived. Only the reap's own count lets it go: empty, the record is marked reaped and its cgroup removed.
117
+ - A box a reap cannot empty, or whose reap fails, is quarantined in `box-quarantine.json` with its record kept. Every later start tries it again, by its own record, even after its run has opened another box. A run's boxes share its cgroup, so the cgroup is removed only when no box still held names it.
118
+ - A record with no pid and no cgroup (a crash before the box's first process was known) is cleared only once its writer is gone.
119
+ - Run cgroups that no record names are reaped through the cgroup and removed.
120
+ - No run starts or opens again before the start sweep is done.
121
+ - A start sweep that fails is tried again by the next start, open or relaunch rather than kept, so one transient error never holds every run back until a restart. A cgroup the reap already removed counts as removed.
122
+ - Each durable write of a box record goes through its own temporary file, so two settlements of one run's box at once (a run's archive and its agent's) never share or rename away each other's.
123
+ - An agent whose place is `{"mode": "sandbox", "box": "docker"}` runs its `read`, `write`, `edit` and `bash` in a Docker container, on pi, claude-agent and codex alike, while its loop, its log, its model calls and every key stay on the server. The container is made on the run's first such call and labelled with the run's id. It binds the run's `work/` alone at `/run/agentrun/run/work` (a mount source through a link is refused), has no network, gets `LANG` and `HOME` and nothing of the server's environment, and runs as the server's user. It is found again by its label after a crash, the commands the dead process left killed first, and destroyed when the run ends, when it is archived, and by the next start once its run has ended. `bash` takes pi's arguments, with a 300 s default timeout and its output's tail. `read`, `write` and `edit` take a path in the box's work directory only, and their errors name the box's paths, never the server's. This carries the coding-tool source that was proposed on its own (no shell on this machine). `bash` is refused on a runner place, and so is a sandbox place on a workflow, and `browser` in a sandbox place. What the server files in a run's `work/` (monid's long answers, the browser's evidence) is written through held directory handles and never follows a link a box's command planted there. On a host without `/proc/self/fd` (macOS), where a directory is reached by its path, the server files none of these in a sandbox run's `work/`: monid's long answers there say they could not be saved, and the browser's evidence is not filed. A file tool's absolute path under the run's own work directory on this machine names the same file in the box. `AGENTRUN_DOCKER_IMAGE` names the image (default `debian:bookworm-slim`). The console leaves `bash` unticked on a new agent and offers it only on an agent whose place is a sandbox. In pi-transport, `dockerBoxes({ user })` runs a box's programs as that uid:gid, and `endLeftCommands(box)`, from `@parcha/pi-transport/hands`, kills the command groups a gone host left in a box, leaving a tombstone for one not written down yet.
124
+ - A revision may name `browser`: a Browserbase browser on `@parcha/pi-browser`'s durable adapter (`snapshot`, `run`, `screenshot`, `browser_read`, `browser_release`, `browser_relaunch`, and downloads and uploads in the run's `work/`), for an agent and for a workflow's model node. It needs `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID` in the server's environment, which reach the run's process; without them capabilities list it unavailable with the missing names, and a run of a revision naming it is `409 agent_not_runnable`. A session's custody stays in the run's own store, each page read is filed under `work/evidence/` in a file of its own, parallel nodes' reads included, there is no recording or live view, and the sessions a run still holds are released when the run is let go. agentrun-serve now depends on `@parcha/pi-browser` and the `@browserbasehq/sdk` it drives Browserbase with.
125
+ - A spend cap below one request's worst case at its model's output ceiling no longer refuses the run before it starts. Each request is limited to the output tokens what is left of the cap can buy, thinking included, and held at that, so the cap stays exact. A request is refused only when what is left cannot buy its least: 1,024 tokens for its answer, plus its thinking's least when it thinks. A $0.50 cap on Claude Sonnet now runs; before, any cap under about $1.30 could never send a request.
126
+ - A refusal says, in plain words, what the run spent of its cap, what its next request needs and the cap that would run it ("Not sent: ... Raise the cap to at least $0.48 to run it."), on the run's error and its timeline row, after the code `spend_cap_reached (out of budget): `, which pi-ai's retry takes as final. A request the cap refused counts as no model request in the run's usage, on every harness; a run whose only request was refused says "no model request sent". A reply the limit cut short says so on the run's timeline.
127
+ - The model proxy asks the host with a request's own output limit and its least (`outputTokensAsked`, `outputTokensLeast`), and writes the admitted limit (the ticket's `outputTokensMax`) into its body through a policy's new `limitOutput`; it never sends a request unlimited that was admitted with a limit, nor a body longer than the one its input was measured on. The runner's `beforeRequest` may answer `outputTokensMax` beside `holdUsd`, and holds each request in flight at the limit it was admitted with; a limit that is no whole number of tokens above 0 refuses the request, never sends it unlimited.
128
+ - The server answers its console (`apps/console`) at `/console/` on its own origin, with the page's CSP and security headers; `/console` redirects there. The console's files are public, like the page's, and its `/v2` calls hold the owner's session the same way. The page at `/` is unchanged.
129
+ - The server's build copies `apps/console/dist` (its `index.html` and hashed `assets/`, never a source map) into `dist/console` when the console was built first (`npm ci && npm run build` in `apps/console`). It refuses an `index.html` with an inline script or style, which the CSP would block, or an absolute `src` or `href`. A server built without the console answers `/console/` with a 404 that says so.
130
+ - `index.html` is `no-store`; the hashed assets are cached for a year. A path with a dot segment, a percent-encoding or a hidden file, a link out of the console's directory, or a kind of file Vite does not build is a 404.
131
+ - The image builds the console into the server's dist and keeps none of its sources or dependencies. `startServe({ console })` points the server at another built console.
132
+ - `/` is the console (`apps/console`), and the server's own page is retired: its HTML, `serve.js`, `serve.css`, its setup and sign-in pages, and the store page's files it loaded (`/page.css`, `/page.js`, `/graph.js`). The store's read-only JSON under `/api/*` keeps answering as before, for the token or the browser's cookie.
133
+ - The console's assets are under `/assets/`, with the same CSP and headers it had at `/console/`. `/console/`, and the old `/setup` and `/sign-in` that the printed setup link still names, send the browser to `/` with a 303, and a link's `#code` stays with it. The console runs its own setup and sign-in.
134
+ - Without accounts, the printed `/?token=` link still sets the browser's cookie once and sends it to `/`. Without that cookie, `/` is the console, which says to open the link; a wrong token answers 401 and sets nothing.
135
+ - A server built without the console answers `/` with a 404 that says so.
136
+ - A run whose cost isn't fully known now says what it cost so far and how many charges have no price, instead of a bare "unknown". This covers a stop, a cancel, a request a crash cut, a cost still pending, a model with no price, or a paid tool charge no one knows. `cost.usd` stays null, so nothing reads a partial sum as the cost. Beside it, `so_far_usd` is the sum of every charge whose cost is known, and `unpriced` counts the charges that have none: model requests, a workflow's decisions, and paid tool calls. Both are present only while `usd` is null, on the run, the run list and the timeline's usage row (`x-agentrun-serve: "costsofar/1"`). No ceiling is claimed. The usage row's summary reads "Cost so far: $0.0123 known, 1 not priced, over 7 model requests".
137
+ - A run that ended with its cost unknown keeps both figures in its meta file, so its list row says them after the server no longer holds it. The agent store is unchanged, and so are `/v2/usage` and `/v2/stats`.
138
+ - A claude-agent or codex turn stopped while a request was out reads that request as a charge with no price while the run's process is still there, as a settled read does. Live and settled reads agree after a stop.
139
+ - An agent whose place is `{"mode": "sandbox", "box": "daytona"}` runs its `read`, `write`, `edit` and `bash` in a Daytona sandbox, on pi, claude-agent and codex alike, as a Docker place does. The server holds Daytona's key (`DAYTONA_API_KEY`, with `AGENTRUN_BOXES=daytona`) and gives it to nothing else: it makes the run's sandbox on the run's first such call, with its network blocked (`networkBlockAll`; a sandbox Daytona does not report blocked is deleted and the call fails), the fixed environment and the run's labels, and the run's process reaches that sandbox only through the server's box relay on loopback, which takes a run's call only with that run's own door token, adds the key to the calls a run's tools make of their own sandbox (a read of it, and its toolbox's programs and files), refuses every other call, and never follows a redirect (nor does pi-transport's Daytona client): a redirect would carry the key. Each run's door now takes a token of its own, `runs/<id>/door-token`, made at its first launch, and a run's end-of-run notes that hold it are refused like any other secret. A sandbox cannot bind the run's `work/`, so the server copies `work/` into it at `/run/agentrun/run/work` when it makes it, copies what changed back at each turn's end and once more before the run's end is recorded (with pi-transport's safe extractor: nothing outside `work/`, no link, a file the server changed meanwhile kept), and destroys it only once that last copy is whole: a copy that fails is tried again before the end is recorded, and one that stops for good (an archive the server cannot read, a limit it cannot pass) keeps the sandbox, said in the log, its auto-delete turned off and set to stop after 15 idle minutes (its disk kept, its compute stopped), woken and copied back by the next start. A run's sandbox that Daytona stopped, paused or archived (or is stopping, pausing or archiving) is started again, an archived one restored, when the server needs it, never replaced. A read of the run's files waits for a copy its turn's end began, and a start pulls a run it finds waiting. What the server files in `work/` meanwhile (monid's long answers) is copied into the sandbox too, and an edit the sandbox makes to such a file comes back. A start pulls, then destroys, the sandbox of a run that ended while its sandbox was left. In pi-transport, a Daytona box takes `network: "none"` (`networkBlockAll`, and `facts().network` is `none` only when Daytona reports it), a workspace the sandbox's user may not create is made with `sudo -n`, and a paused sandbox counts as not running (a host starts it again).
140
+ - A workflow run's timeline shows its decisions. Each decision its `judge`, `pick`, `sift`, `route`, `ask` and `verify` nodes recorded is a row of kind `decision` once the run has ended:
141
+ - its summary names the node and the provider that answered, then each answer with the probability of what it said (`coi (jev): is_coi yes 0.92`), or for a route the branch it took (`route: review`, with `unsure` or `refused` when that is why);
142
+ - its text lists the sources the provider cited (title, then URL) and the questions it refused;
143
+ - its `usage` carries its own cost, and the run's usage row adds it in once: one unknown cost makes the total unknown, never a lower figure.
144
+ `TimelineKind` gains `"decision"`.
145
+ - AgentRun Server runs decision workflows on Jev. A workflow's typed questions (its `judge`, `pick`, `sift`, `route` and `ask` nodes) run on TypeSafe's System One through `@parcha/agentrun-jev` when the server's environment sets `TYPESAFE_API_KEY` (or `OPENROUTER_API_KEY`, for Jev through OpenRouter). Until now, such a workflow was refused at save.
146
+ - Each question's receipt is a row of the run's store before its answer acts. Jev reports no cost, so a receipt keeps its cost unknown, and so does the run: its `cost.usd` reads `null`, never `0`, while a decision's cost is unknown, and still after the server restarts. An ended run the store kept no cost for now reads unknown too.
147
+ - With no key, such a workflow saves with a `not_set_up_here` warning naming the variable. A run of it is `409 agent_not_runnable` with `details.adapters: ["runJudge"]` and `details.decisions: {jev: {reason: "not_set_up_here", needs: ["TYPESAFE_API_KEY"]}}`, which `/v2/openapi.json` declares among `agent_not_runnable`'s details.
148
+ - `GET /capabilities` lists the decision providers in `workflows.decisions.providers` (`[{id: "jev", available, reason?}]`), marked as the server's own in `/v2/openapi.json`. `runJudge` is among `workflows.adapters` once Jev runs.
149
+ - The TypeSafe key never enters a run's environment, which its tools and its model's provider read. The server drops `TYPESAFE_API_KEY` from every run's process and hands its value to a workflow run's process once, on an inherited pipe, for the judge's runner alone. The pipe is the first descriptor after the run's stdio and its secrets pipe, so a server on macOS, which aborts the parent of a spawn with a pipe at descriptor 16 or above, starts and resumes such runs.
150
+ - AgentRun Server runs decision workflows on Parallel Decisions too. A decision node that says `provider: "parallel"` is answered through `@parcha/agentrun-decisions` when the server's environment sets `PARALLEL_API_KEY`; a node that names no provider is still answered by Jev.
151
+ - In `/v2/openapi.json`, `Capabilities.workflows.decisions` is now marked `decisions/2`, and `info.x-agentrun-serve.fields` lists it. A client that validated against `decisions/1` would refuse the new provider id.
152
+ - `GET /capabilities` lists `parallel` in `workflows.decisions.providers`, `available` where its key is set and with a `reason` naming `PARALLEL_API_KEY` where it is not. `runJudge` is among `workflows.adapters` once either provider runs.
153
+ - With no Parallel key, a workflow whose nodes name `parallel` saves with a `not_set_up_here` warning naming the variable. A run of it is `409 agent_not_runnable` with `details.decisions: {parallel: {reason: "not_set_up_here", needs: ["PARALLEL_API_KEY"]}}`. A node naming a provider the server does not have is refused at save, `422`.
154
+ - The Parallel key never enters a run's environment. `PARALLEL_API_KEY` is on the launcher's list of secrets, so the server holds it out of its own environment and never hands it with a run's secrets. The server drops it from every run's process, and hands it, with Jev's key, to a workflow run's process once on the decision descriptor, now as one object of variable name to value, for its decision providers alone.
155
+ - A run's typed questions go through the DSL's `judgeFromProviders`, to the provider each node names: a node naming one this server does not run is refused before its run, never answered by Jev in its place. Each receipt names the provider that answered.
156
+ - A server with the Docker box makes its image ready at its start, so a sandbox run's first tool call is never a silent pull. The default image is the server's own, `agentrun-box`: python 3.12 (`python:3.12-slim`, pinned by its digest) with git, curl, node and rg (Debian's `nodejs` and `ripgrep`), about 300 MB, built from a recipe in the package on first use, tagged and labelled (`agentrun.box-image`) with the recipe's hash, and built again only when the recipe changes. `AGENTRUN_DOCKER_IMAGE` names another image instead, which the server pulls when Docker has none. The build or pull runs once, in the background, for at most 10 minutes. The build reaches the network; a box never does.
157
+ - Each box in `GET /v2/capabilities`' `places.boxes` has a `state`: `ready`, `preparing` (available while the image is built or pulled, its `reason` `building the box image (python, git, curl, node, rg)` or `pulling <image>`) or `unavailable`, with the reason.
158
+ - A sandbox run whose first box comes while the image is coming waits for it, with one timeline row (`Preparing the box image: building it (python, git, curl, node, rg)…`, or `pulling <image>…`), then goes on. Its box is made once the image is in.
159
+ - A build or pull that fails, or takes too long, makes the box unavailable with a reason that names the kind of failure and the next step, and holds none of Docker's output. A run that was waiting fails its call with that reason, and the next sandbox run is `409 agent_not_runnable`. A restart tries again.
160
+ - The log has `event=box_image` lines: the image's state at the start, and again when a build or pull ends, with how long it took.
161
+ - `@parcha/pi-durable-agent/timeline` exports `HOST_PHASE` (`agentrun.phase`): an entry a host writes with a `summary` shows as one `phase` row with it, no request and no cost.
162
+ - **Workflows on AgentRun Server read documents, call one completion, judge images, and run code nodes when allowed**
163
+ - `pdf_pages`, a workflow call tool: `{ path, maxPages?, dpi? }` draws a document's first pages as PNGs under the run's `work/pages/<stem>/<dpi>/` (long side at most 1568 px, Jev's largest) with its text. A PNG or JPEG passes through, scaled down if larger. `path` is confined to `--documents DIR` (or `AGENTRUN_SERVE_DOCUMENTS`) and the run's `work/`. Needs poppler's `pdftoppm` and `pdftotext`.
164
+ - `llm`, a workflow call tool: one completion on the run's model of the call's tier, no tools and no loop: `{ text, model, usage, cost_usd }`, the cost null when the model has no price.
165
+ - Both are call-only: an agent or a model node naming them is refused (`422`), and `GET /capabilities` marks them `call_only`.
166
+ - Decision nodes' `images` are loaded from the run's `work/`. Nodes naming `provider: "openrouter"` run on OpenRouter's Decisions models, on the OpenRouter key Jev's OpenRouter route reads (`OPENROUTER_API_KEY`, else the gateway's `AGENT_MODEL_API_KEY` on openrouter.ai), handed on the decision descriptor; capabilities list `openrouter` among the providers (under `faux`, startServe's `fauxOpenrouter` fakes it).
167
+ - A call tool that fails on its own fails that item in a collecting `map` instead of the run.
168
+ - `code` nodes run only on a server started with `--allow-code-nodes` (or `AGENTRUN_SERVE_CODE_NODES=1`): they run in the run's process through `new Function`, which is no sandbox. Off (the default), such a workflow saves with a `not_set_up_here` warning and its runs are `409 agent_not_runnable` with `details.code: true`. Calls via a shell or the executor stay refused.
169
+ - Pi's decision rows keep a receipt's images (by digest), the state the judge saw and its cost basis, and a replay returns them.
170
+ - A run's `effort` now also adds a short note on how to work, right after the agent's instructions, on every harness (pi, claude-agent and codex), as well as setting the thinking level as before. `low` says to answer directly, search once only for a fact it lacks, and stop; `medium` to plan briefly, check key claims against a second source, and check the answer once; `high` to plan each part, fill the gaps and review the result against the request. On claude-agent the note is system prompt text, not a skill. A run with no `effort` gets no note, and its prompt is unchanged. The notes are one table in `src/effort-guidance.ts`, and the contract's `Effort` description says so.
171
+ - A revision may name `fetch_page`: one web page from a public host, `{url}` in and a Page out, `{ok, url, status, title, text, links, refused?, error?}` (the text cut at 60,000 characters, at most 200 absolute http(s) links). An agent gets the Page as JSON text, and a workflow's `call` node `via: "tool", tool: "fetch_page"` runs it and gets the Page as its output: workflows now get a tool adapter beside their model nodes, for the table's tools that a call may run, and a call to any other tool is `409`. It needs no key. It reaches public hosts only, on pi-browser's guard: each redirect hop resolved, checked and dialled at the address checked, http(s) only, at most 5 MiB and 30 s. A loopback, private, link-local, carrier-grade or metadata address, a local name, a public name that resolves to one, a redirect to one, a URL on a port other than 80 or 443, and `file:`, `data:` or `ftp:` are refused as a Page with `ok: false` and `refused`, never a thrown error, so a workflow can branch on it. Capabilities show `calls` for each tool.
172
+ - `AGENT_MODEL_BASE_URL` (codex) and `ANTHROPIC_BASE_URL` (claude-agent) now take a gateway under a path, so one OpenRouter key can serve every harness: `https://openrouter.ai/api` for claude-agent, and `https://openrouter.ai/api/v1` or `https://openrouter.ai/api` for codex and pi. codex sends to `<base>/v1/responses` and claude-agent to `<base>/v1/messages`, with a trailing `/v1` on the base taken once. A base that could send a key elsewhere than it reads is refused before any request, naming its setting: one with userinfo, a query or fragment, a `.` or `..` path segment (raw or encoded), a backslash, whitespace, or plain http to anything but this machine.
173
+ - **A definition names its harness: pi, claude-agent or codex**
174
+ - `definition.harness` is `pi` (the default, and what a definition that names none gets), `claude-agent` or `codex`; any other is `422 input_invalid` on the field. Every answer names it. An edit that names no harness keeps the agent's (as it keeps its skill files), and the page sends back the harness it read. The default is never stored, so a revision written before this field and one that names pi are the same revision.
175
+ - `GET /v2/capabilities` lists `harnesses`: each with `available` and, when not, its `reason`. A definition naming a harness this server does not run yet saves with a warning on `definition.harness`, and its runs are `409 agent_not_runnable` with `details.harness`, never run on pi instead. This server runs pi today.
176
+ - `GET /v2/openapi.json` marks every property this server adds to the contract's objects `x-agentrun-serve` with the addition that made it (`harness/1`, and `model/1` and `serve/1` for what it added before), and lists them in `info.x-agentrun-serve.fields`. Without them, the contract is as vendored.
177
+ - The agent store (`@parcha/pi-durable-agent`) keeps an optional `harness` id in a revision's body, so in its id.
178
+ - **Runs on claude-agent and codex, durable in the run's own store**
179
+ - An agentic revision whose `harness` is `claude-agent` or `codex` runs on that harness's adapter in the run's own process, behind the run's door: a message starts a turn, a message during a turn waits for its end, a stop interrupts. The session is kept in the run's store, so a run whose process dies mid-turn resumes on the next one.
180
+ - Every paid request is booked once by the adapters' runner booking and shows in the timeline as one model request with its cost, as for pi; a request cut by a crash, or one whose price is unknown, makes the run's cost unknown, never 0. A run opened again reads the cost of all its openings, unknown included.
181
+ - Such a run gets pi's own `read`, `write` and `edit`, with pi's confinement to the run's workspace; `read` may run again after a crash, `write` and `edit` never. `ask_person` stays pi's: on another harness it is a warning, and its runs are refused.
182
+ - `--faux-harness MODULE` (`fauxHarness` for `startServe`) runs every harness but pi on a scripted faux harness, for tests.
183
+ - AgentRun Server's image build now proves the Codex CLI it ships is the pinned build. `docker/image-check.sh` runs `@parcha/agentrun-harness-codex`'s own check on the final image's tree: the platform package's version, the binary's sha256 and the version the binary reports must all be Codex 0.164.0's for the image's platform. A missing binary, a different binary or another release fails the build with the typed error (`CodexNotInstalled` or `CodexPinMismatch` and the pin it names). The pins already cover both platforms the image is built for, linux/amd64 and linux/arm64.
184
+ - `docker/image-smoke.sh` now checks codex. A built image must list it in `GET /v2/capabilities`. Because the image carries the pinned Codex CLI, codex is never unavailable as not installed or not the pinned build. It is available, or unavailable for a setting its reason names, such as `OPENAI_API_KEY`. Set `IMAGE_SMOKE_CODEX=available` on a run that is given a model key, and codex must then be available.
185
+ - A new test covers what the server offers of codex. It is available on the pinned build with a model key, unavailable for the key it names without one, and unavailable as not the pinned build, with the install line, when the binary is any other build.
186
+ - **AgentRun Server's image has git, on Debian trixie**
187
+ - `packages/serve/docker/Dockerfile` builds both stages on `node:22.23.2-trixie-slim`, pinned by its multi-arch index digest as before, and the runtime installs `git` (2.47) next to `tini`. `pi-git-remote` needs git 2.40 or newer; bookworm's is 2.39, and the bookworm image had no git at all. The build fails if the git it installs is older than 2.40.
188
+ - The base moves from Debian 12 (bookworm, glibc 2.36) to Debian 13 (trixie, glibc 2.41). Node's version is still 22.23.2, but its binary is the trixie build. An image built `FROM` this one gets trixie's packages and glibc: whatever it adds with apt or compiles must suit trixie. A native addon built against glibc 2.41 does not load on bookworm.
189
+ - git and its Debian dependencies (perl among them) add about 36 MB to the compressed image (181 MB to 217 MB) and about 100 MB unpacked.
190
+ - An import cuts the keys [secretlint](https://github.com/secretlint/secretlint)'s recommended rules find in what it reads (Anthropic, OpenAI, GitHub, Slack and Stripe keys, AWS secret keys beside their name, private keys, database URLs with a password, and more), as well as the environment's values and the saved keys. It reads each session file as it is and as its records' strings, so a key in a Codex shell output kept as JSON is found too. The cut reaches everything the import writes: transcripts, run titles and inputs, the agent's name and description, its instructions, its skills' text and their file paths. A key in a folder's or file's name, one split across folders among them, is kept as `redacted-<hash>`, and a skill's files stay one skill.
191
+ - `agentrun-serve import` prints `N secrets removed` after its import line (`N secrets would be removed` with `--dry-run`), counting each distinct key once.
192
+ - Known key formats are removed. Other secrets in your session history, like passwords in config files, are imported as they are.
193
+ - Runs imported before this change are not cut again: a re-import skips sessions it already holds.
194
+ - New dependencies: `@secretlint/core` and `@secretlint/secretlint-rule-preset-recommend`, both 13.1.0 (MIT).
195
+ - `agentrun-serve import` counts what it leaves out by why, on the dry run and the import alike ("left out: 84 sessions from folders that no longer exist (--include-deleted imports them too)", "left out: 2 sessions still being written: they come in next time"), in place of one `skipped <path>: <why>` line per file, which `--verbose` still prints. `--include-deleted` imports the sessions of project folders that no longer exist, such as a deleted git worktree's, each folder its own agent with no instructions or skills to read; `--all` keeps those, temporary folders' and sessions with no message of the person's, as before. Each left-out entry of an import's report carries its `kind`, and `leftOutOf` groups them.
196
+ - `import` brings in every local session with its analytics. Each imported run keeps what its session used, a run its source did not price gets a catalog estimate, and the import ends with a summary of every session it found (the ones it imported before included) and the address to open the console at. So does `--dry-run`, from what it would import:
197
+
198
+ ```
199
+ Found 1,284 sessions Claude Code 911 · Codex 301 · pi 72
200
+ Imported into 37 agents (one per project)
201
+ + 41.2M tokens (78% cached) · 2,310 h of agent time
202
+ + Busiest hour: 02:00 · top tool: Bash (31%)
203
+ ```
204
+
205
+ - What each run keeps: the store's metrics, which are its tokens, model requests, models, tool calls with their errors, the effort or thinking level it ran at, and its time at work (the gaps between the session's records, each capped at 15 minutes). The run's transcript carries each request's own tokens and model, so its timeline and its metrics agree.
206
+ - Claude Code's usage is read once per message, though the CLI repeats it on every record of a message. Its own `<synthetic>` turns are an API error, imported as a request that failed, or a line of its own, which is no request and never the person's.
207
+ - Codex's usage comes from its `token_usage_record`s, or from its `token_count` events in a rollout without them, with OpenAI's cached tokens taken out of the input. A Codex call fails when its output or its completed item says so.
208
+ - pi's usage is read as pi wrote it.
209
+ - A request whose source gave no counts stays unmetered, never 0 tokens.
210
+ - The estimate covers every Codex session, a Claude Code session using a model the CLI could not price, and a pi session with an unpriced request. It is each request at its own provider's catalog list price for its model, in the metrics' `costUsdEst` with `costBasis: "catalog"`, and the run's cost stays unknown. A provider the catalog does not list for that model, or a request whose tokens are unknown, leaves the estimate unknown, never $0. A provider's $0 is $0. A cost the source recorded is kept, with no estimate.
211
+ - The summary: the cached share is cache reads over all input, agent time is the runs' time at work, the busiest hour is the local hour of day with the most model requests, and the top tool is the one with the most calls. A figure with no data behind it reads `unknown`. The address to open the console at is the server's public one when `AGENTRUN_PUBLIC_URL` is set, else this machine's at the port the server listens on, which `import` now takes as `--port`.
212
+ - AgentRun Server runs Jev on the model gateway's key when that gateway is OpenRouter. With `AGENT_MODEL_BASE_URL` on the host `openrouter.ai` (exactly that host) and `AGENT_MODEL_API_KEY` set, a workflow's typed questions go to Jev through OpenRouter on `AGENT_MODEL_API_KEY`, so a server on an OpenRouter gateway needs no second key for decisions. `TYPESAFE_API_KEY` still comes first, then `OPENROUTER_API_KEY`; a gateway on any other host does not run Jev.
213
+ - On the OpenRouter route, jev's `note` in `GET /capabilities` names the variable Jev runs on: `Jev runs on OPENROUTER_API_KEY, ...` or `Jev runs on AGENT_MODEL_API_KEY, ...`. Both are the model gateway's key, which a run's processes already hold; set `TYPESAFE_API_KEY` to keep the decision key out of them.
214
+ - On either OpenRouter variable, the server hands the key to a workflow run's process on the decision descriptor, as it hands `TYPESAFE_API_KEY`. The run's judge reads its key there, never from its environment.
215
+ - With no key, jev's `reason` (and the `not_set_up_here` warning and `409` message) also names the gateway route.
216
+ - A run that learns gets the skills its agent wrote beside its revision's own. Each is a folder `skills/<name>/` on the learning folder's `main`, copied into the run's `work/.agents/skills/<name>/`: pi and codex read its `SKILL.md` in their prompt, and claude-agent loads it through its Skill tool when its adapter takes it.
217
+ - A skill named like one of the revision's is the revision's. Only an active skill is served: one whose `SKILL.md` sets `status: pending` (held for its owner's OK), or any status but `active`, is not.
218
+ - Learned skills get their own budget, 256 KiB of files in all, and never more than the revision's skills leave of the 1 MiB an adapter takes of a run's skills, so they never push the revision's back into the prompt. The one changed last comes first, each whole while it fits; one that does not fit, or that holds one of the server's secrets, is left out.
219
+ - The run's pin (`runs/<id>/learning.json`) names the files laid (`skills`) and the skills left out (`skills_left_out`). A follow-up gets them laid again, fresh. A learned skill the run's work no longer holds whole when its process starts is left out of what the harness gets, and the run goes on.
220
+ - A symbolic link or a submodule at `skills/` or under it is a learning fault: the run starts with nothing learned (`seed_failed`).
221
+ - `@parcha/agentrun-kernel` exports `SKILL_BYTES`, the 1 MiB its `skillProblems` takes of a host's skills in all.
222
+ - A person retires a learned skill or a workflow draft as they retire a note: `POST /v2/agents/{id}/learning/files/{file}/retire` with If-Match on its `skills/<name>/SKILL.md` or its draft's `workflows/<name>/README.md` (percent-encoded). It sets `status: retired` in one host commit (`learning: retired by a person: <file>`), the learning view lists it `retired`, and no later run is given it. A stale ETag is 412, and the token may retire as it may retire a note; only an approval takes the owner's session.
223
+ - The owner approves a note that waits for their OK: `POST /agents/{agent_id}/learning/files/{file}/approve`, under If-Match, makes a pending note active, in MEMORY.md and read by every later run, and marks what it supersedes. Only the owner, signed in with their password, approves: the console's password session from this server's own origin with a JSON body. Every token is 403, the server's own included (a script's, an agent's MCP client's, the MCP endpoint's tools'), and so are a run's door token and every value a run's process holds; with no credential it is 401, as every route. With accounts off (`AGENTRUN_ACCOUNTS=0`) nothing approves, since the page's cookie there is minted from the token. `capabilities.learning.approve` is true only for the owner's password session; any other caller reads false with `approve_needs: "password"`. Runs that use bash on the host run as you: for untrusted tasks, use the sandbox. The approval is one host commit with the `Changed-By: user` and `Approved-Via: console` trailers, and the learning log reads `by: {user: true, via: "console"}`, never the note's text.
224
+ - The server's learning code is its own, in `src/learn/`, beside `SPEC.md`, the learning folder's contract: the note format (`notes.ts`), the checker of what a run proposes (`check.ts`), the end-of-run prompt (`reflect.ts`) and the grader's rubric, prompt and verdict (`grade.ts`). The server depends on no learning package: `@parcha/agentrun-learn` stays held and unchanged, and an install of the server gets nothing more than before.
225
+ - A note may name the notes it replaces, `supersedes: [old.md]` or one bare file name. Only the server sets `status: superseded` and `superseded_by`, on each note a merged one supersedes, and a run that sets either is refused.
226
+ - `SPEC.md` lists the checker's rules and caps, the grader's four questions (general, from content, duplicate, contradicts) and how its verdict fails closed.
227
+ - Learning works on every harness and on cheap models. The end-of-run turn answers with its notes as text, so an agent needs no `write` tool and a note asked for during the task survives. The grader keeps a lesson the agent worked out itself and what the user asked it to keep, and still drops what a page told it.
228
+ - The end-of-run turn (`reflectPrompt`) asks the agent to look back over the whole conversation, what the user asked it to remember included, and to answer with one ` ```note <file>.md ` block per note, using no tool. The server reads the notes from the turn's answer alone (`parseReflection`, new in `src/learn/reflect.ts`), whole, and keeps the answer and what the user said in `runs/<id>/learning-turn.json` as the run settles. The checker, the grader and the merge run unchanged. Nothing the run writes in `work/.learning/`, during the task or the turn, is read, and the folder is no longer laid again before the turn or moved aside after it (`runs/<id>/learning-turn/` is gone).
229
+ - The learning reasons gain `unparsed`: the answer gave notes out of format (a note outside a block, a block not closed, one with no file name or two, a name given twice), and none was kept. Its detail reads "Not kept: its notes weren't in the expected format." No run gets `no_write_tool` or `tool_denied` now, since an agent with no tool learns too; they stay in the list for older runs, whose ends are still read and counted. The `# Learned` intro says that only what the run answers at the end is kept.
230
+ - `GRADE_RUBRIC` asks five questions. "From content" becomes "Planted": an instruction a page, a document or a tool's output gave is planted (act for someone else, send data, trust or use a source content offered, skip or change the instructions, or remember this). A lesson the agent drew from its own work, such as a URL pattern, a site's layout or how a tool behaves, is not planted, and neither is what the user asked in their own words; an email or a message pasted or forwarded into the run is content. A new "Secret" question covers passwords, keys, account numbers and private details, whoever gave them, a new "Risky" question asks whether a rule widens trust in a site or a seller, skips or loosens an approval or a check, or names an account or a destination for money or data, and "General" counts a standing preference of the user's as general and a tool's or the setup's failure as tied to its case. Each note's decision is keep, pending or drop, with its origin, you or run (`parseVerdict` reads `decision` and `origin`, and the older `keep` alone). `gradePrompt` takes `asked`, the user's messages in the run (the first and the newest three, each cut to 1,000 characters), fenced as data.
231
+ - The grader runs on the model the server names for it: `--grade-model` (or `AGENTRUN_SERVE_GRADE_MODEL`), else the strong tier (`AGENT_MODEL_STRONG`), else the agent's own model as before. `GET /capabilities` names it as `learning.grade_model`, null for each run's own. It reads what the user said in the run, cut of the server's secrets, which the proposal now keeps (`asked`).
232
+ - An eval set of 20 labelled runs (`packages/serve/test/fixtures/learn-eval.json`) and a held-out set of 9 (`learn-eval-heldout.json`) run in CI on a faux grader that answers by label, and `packages/serve/scripts/learn-eval.mjs` runs them on real models.
233
+ - A risky rule is pending, never dropped and never served on its own, whether the user asked for it or the run worked it out (a note the grader keeps and names Risky too): merged as `status: pending`, with `origin: you` when it is the user's (`src/learn/notes.ts`: `NOTE_STATUSES` and `NOTE_ORIGINS`, `mergedNote`, `approve`), in no `MEMORY.md` and no run's copy, and named on the run's learning: `pending`, `[{file, name}]`, on `GET /v2/runs/{run_id}`, in run lists and on the run's whole learning, never among `learned`, and in its detail ("Waiting for your OK: <name>.", after "Learned: <name>." when the run kept a note too); `GET /capabilities` says so (`learning.pending: true`). It waits for its owner: a person can retire it or approve it (serve-learning-approve). An edit keeps it waiting: a `PUT` that drops or changes its status is 400 with the rule `status`. A run's note that sets `origin` is refused as `status`.
234
+ - An agent with learning on remembers, on pi, claude-agent and codex: when a run answers or fails, the server asks the same session one end-of-run turn to add notes to its copy of the agent's learning folder; what it adds is checked, graded by one grader on the agent's own model, and merged into the folder's `main`, where the next run reads it.
235
+ - The turn goes through the run's door under a fixed request id, at most once, sent with the origin `reflect` that only the server sets, under the run's cap; the run's answer stays the job's, and the turn's rows are labelled `learning`. `startServe` takes `reflectTimeoutMs` (default 5 minutes).
236
+ - As the run settles, before it reads ended or a follow-up can open it again, the turn's `work/.learning/` is moved whole (one rename) to `runs/<id>/learning-turn/`; what it wrote is read from there alone, without following a link, and checked by the server's `checkProposal` before anything is written; a follow-up finds `work/.learning/` laid again from the seed; `MEMORY.md` as the turn left it is ignored. The grader is the server's `gradePrompt` and `parseVerdict`, fail-closed, over each active note's index line and only the superseded notes in full; a call cut off at its bound (`startServe`'s `gradeTimeoutMs`, default 3 minutes) has an unknown cost, never $0; an injection screen runs first only with Jev's key. The merge is one host commit: new notes, superseded ones marked, `MEMORY.md` rebuilt, a `Run-Id` trailer, compare-and-swap on `main`, never twice.
237
+ - The run's `learning` gains the states `reflecting`, `proposed` and `merged` and the drop reasons of the console's closed list; a learning timeline row (kind `learning`) is shown for every outcome, `seed_failed` included. Each run's learning end is one line of the learning ledger, `DATA/learning-usage.jsonl` (`{run, agent, state, reason, at, cost, tokens}`), written once its `serve.json` holds it; `GET /usage` reads the grades' cost from it under the meter `learning`, and `GET /stats` gains `learning: {runs, merged, dropped, in_progress}` over its filters, from the ledger and the runs the server holds, never a run's files.
238
+ - `@parcha/pi-durable-agent`: `TimelineKind` gains `learning`.
239
+ - A run that learns reads its notes whole in its instructions under `# Learned`, so an agent with no `read` tool follows what it learned. Before, `# Learned` held only the index's one line per note, and the notes were files in `.learning/` that such an agent could never open.
240
+ - Each active note is there whole (`## name (file.md)`, its description, then its text), the one changed last on `main` first, while they all fit the learning budget: `--learning-budget BYTES` (or `AGENTRUN_SERVE_LEARNING_BUDGET`), 8000 bytes by default. Past it, the run reads the index, then the notes changed last, whole, while they fit; an agent with the `read` tool is told the rest are in `.learning/`, and one without is not. `0` gives the index alone.
241
+ - Only active notes are served. A note with any other status is never in the instructions, whole or by an index line a hand edit left in `MEMORY.md`, nor in the copy in `.learning/`, and it is not counted toward the budget.
242
+ - Every name, description, text and index line the run reads is cut of the server's secrets as they are when the run is made, in its instructions and in its copy in `.learning/`.
243
+ - A run's pin (`runs/<id>/learning.json`) keeps what it reads as `section`. A pin an earlier server wrote, the index alone as `learned`, is read as that server gave it.
244
+ - A person sees and controls what an agent has learned, through the API (`learning/1`): `GET /v2/agents/{agent_id}/learning` (the index, the notes, the log of changes by run or by person, and the runs' counts), its `notes` and `log` pages, one note as text with its `ETag`, and `GET /v2/runs/{run_id}/learning` (with the grader's verdict and its item for each new note: kept or not, the rubric's question it failed, and why) and `.../learning/diff` for one run.
245
+ - `PUT /v2/agents/{agent_id}/learning/files/{file}` takes the note's whole text (as text, or as JSON `{text}` from the console's page) and edits a note (`If-Match`) or creates one (`If-None-Match: *`), and `POST .../retire` retires one; a stale ETag is 412, a write with no precondition 428 (`precondition_required`, a new error code). A person's note passes the same structural checks as a run's, with no grader, and lands as one host commit on `main` with a `Changed-By: user` trailer and `MEMORY.md` rebuilt. A refused note is 400 with `problems` on the error; a retire checks only the note's format (its front matter, and the cap with the status line on top), never its secrets, so a leaking note can always be revoked. The view and the pages read a commit's notes once (kept for the few commits last read), and a log page reads only its own commits. A file name holding one of the server's secrets (a value made secret after the note was written) reads `[redacted]` in the notes, the log and a run's diff.
246
+ - The server's learning code (`src/learn/`) gains `checkNote(path, bytes, refuseValues)`, which checks one note by itself, as a person writes it, and `retire(text)`, which marks a note retired.
247
+ - An agent whose definition says `learning: true` starts every run from what it has learned, on pi, claude-agent and codex alike. Learning is off unless the agent says so, and the server's `--learning off` (or `AGENTRUN_SERVE_LEARNING=off`) turns it off for every run; capabilities report the switch as `features.learning`.
248
+ - The agent's learning folder, `learning/` in its home (`DATA/homes/<key>/learning/`, the key as the home's), is in Claude Code's auto-memory format: `MEMORY.md`, one line per active note (`- [name](file.md) — description`), and one `<slug>.md` per note with `name`, `description`, `type` (`user`, `feedback`, `project`, `reference`) and optionally `status: superseded | retired` with `superseded_by`. It is plain git with `main` checked out, made by the agent's first run that learns with an empty `MEMORY.md`, and the server is its only writer, with hooks, fsmonitor, lazy fetches and system and global config off.
249
+ - Each run pins `main`'s commit in `runs/<id>/learning.json`, kept through a resume or a follow-up. The first 200 lines of that commit's `MEMORY.md` go into the run's instructions under `# Learned`, and `MEMORY.md` and the active notes are copied into the run's `work/.learning/`.
250
+ - A learning fault never blocks a run: a folder that cannot be made or read starts the run with nothing learned. The run's `learning` reads `{state: "seeded"}`, `{state: "dropped", reason: "seed_failed"}`, or `null` for a run that does not learn; run lists carry `{state, reason}`. A server that goes down while it copies the notes into a run has saved the run's input first, so the next one relaunches the run with its first message and nothing learned; a copy it finds there unsaved goes, and the run's learning reads `seed_failed`.
251
+ - `@parcha/pi-durable-agent`: an agentic revision keeps `learning` when its input sets it, so a definition that leaves it out keeps its revision id.
252
+ - Learning you can see, through the API (`learning/2`, additive): a run's `learning` block, on `GET /v2/runs/{run_id}` and in every run list, gains `used` (the notes the run's job read from `.learning/`, found once as it settles from its timeline on any harness and kept in `serve.json`, never `MEMORY.md` nor a read of its end-of-run turn) and `learned` (the notes its merge added, with the notes each superseded), each absent when it holds no note and cut of the server's secrets as they are now. `GET /v2/agents/{agent_id}/learning` gains `impact`: the agent's completed runs before its first note against those that started from one, each side's run count, median time to the answer (before the run looks back), median job cost without the look-back (with `cost_runs`, the runs whose cost is known) and median of what learning itself cost a run (`median_learning_usd`: its look-back and its grade), from the runs' rows and the learning ledger (whose line now carries `seed_notes`, `answered_at`, `job_cost_usd` and `look_back_usd`), null unless both sides count 2 runs. Each note in the agent's view and its pages carries its `etag`, the one its file's GET answers, and each run list's row carries the run's learning `detail`, cut to 140 characters. Every learning `detail`, and the run's learning row in its timeline, which now says the same, is in a person's words ("Started from 2 notes.", "Learned: Check units (replaces 1 older note)", "Nothing new to remember from this run.", "Not kept: <the grader's reason, its first sentence>"); the reason codes do not change. The end-of-run turn's message reads "Looking back on this run." in the timeline, never the prompt the model is sent, and `GET /v2/runs/{run_id}/learning` carries `used` and `learned` too.
253
+ - The MCP tools `agents_create` and `agents_revise` take an optional `definition`: any other definition field, passed through as it is to `POST /v2/agents` or the definition `PUT`, whose own checks answer for each. A field the server takes later (an agent's `place` now) needs no change to the tools, and a field the route refuses is its own `422`, by field. A field named outright wins over the same one in `definition`, and `agents_revise` keeps every field neither names.
254
+ - A coding agent can set up AgentRun Server and drive it. `POST /v2/mcp` is an MCP endpoint, Streamable HTTP in its simplest form: one JSON-RPC message per POST, answered as JSON, with no stream and no session. It has ten tools: `whoami`, `agents_list`, `agents_create`, `agents_revise`, `runs_start`, `runs_get` (with a waiting run's question and its console link), `runs_events`, `runs_files`, `runs_respond` and `runs_cancel`. Each calls the `/v2` routes in process with the caller's token, so it checks and answers as they do: the route's JSON is the result, and a refusal is a tool error holding the route's `error`. A run is started, then polled; no call is held open for one. The endpoint takes the Bearer token only, never the page's session cookie, refuses a browser `Origin` other than the server's own (`403`), and refuses any method but POST (`405`). `GET /v2/runs/{id}/timeline` takes `limit` (1 to 500 rows a page). `GET /llms.txt`, public, gives the server in brief, and the package ships `skills/agentrun-serve/SKILL.md` for a coding agent: check the server, the token, connect with `claude mcp add` or `codex mcp add`, create an agent, run it and answer it. The served OpenAPI document lists the endpoint as `callMcp` (`mcp/1`) and the timeline's `limit` as `timelinelimit/1`.
255
+ - Remote MCP servers can be previewed and saved through `/v2/settings/mcp-servers`. `POST .../preview` connects over Streamable HTTP with the official MCP SDK client (2026-07-28 first, 2025-era servers by their `initialize`), lists every tool and stores nothing; it answers `422 auth_required` with `details.auth` `bearer` or `oauth`, `422 not_mcp`, or `424 upstream_failed`, and never follows a redirect. A server is kept with at most 500 tools and 1 MiB of them; past either it is `422` and nothing is kept. `PUT .../{name}` previews, then keeps the URL, the tool snapshot and the credential (`none`, `bearer` or named `headers`), each value sealed under `AGENTRUN_SEAL_KEY`; with no seal key a server that takes a credential is `409 no_sealing_key`. Reads say `credential: sealed | seal_key_missing | unreadable` and never show a value; a `PUT` without the credential keeps the sealed one while the auth type and the URL's origin are unchanged. `POST .../{name}/refresh` answers what was added, removed and changed; `DELETE` forgets the server. A saved-servers file that does not read is never written over: reads say `file_unreadable`, and writes are `409 store_unreadable`. Capabilities gain `features.mcp_client`. OAuth sign-in (`auth.type: "oauth"`) is refused with reason `not_yet`. Agents do not use these servers' tools yet.
256
+ - A model provider's key is saved from the page like a tool key: `PUT /v2/settings/tool-keys/{anthropic|openai|openrouter}`, rows of `kind: "model"` in `GET /v2/settings/tool-keys` (the tool keys are `kind: "tool"`), kept sealed the same way. Every run gets it, as every run gets the launcher's model keys. With no `AGENT_MODEL`, such a key, saved or the server's own, now gives the default model, the first of `anthropic/claude-sonnet-5-5`, `openai/gpt-6.1-sol` and `openrouter/anthropic/claude-sonnet-5.5` whose key is here: each its provider's capable everyday model, not its dearest. claude-agent takes only the Anthropic one, codex only the OpenAI one, each harness's `default_model` in capabilities shows the one it gets, and `AGENT_MODEL` still wins for a harness that runs it: one that can't (claude-agent on a gateway's own id) takes its own key's default. Capabilities' `models` gain `ready`, whether a revision that names no model runs here, and `needs` (`key` or `model`, null when ready); both change with a key's save or delete, with no restart. A run or a save that finds no model says what a person does, in place of operator flags: "No model yet: add a model key in Settings → Model keys, or set ANTHROPIC_API_KEY, OPENAI_API_KEY or OPENROUTER_API_KEY where AgentRun starts." (and for a named model whose provider has no key, that provider's key).
257
+ - A monid key saved through the settings API puts monid's catalog in an agent's hands on every harness, with no restart, only in the runs that name a monid tool, and monid's charges in the run's cost and under its spend cap.
258
+
259
+ - A tool key saved through `PUT /v2/settings/tool-keys/{id}` is read by name like a secret the launcher hands over, the launcher's value winning for a name it holds. Each run gets the saved keys at its launch, over the same pipe as the launcher's secrets (a workflow run's `PARALLEL_API_KEY` on its decision descriptor), and never in any process's environment; no run gets the seal key. A value that does not open is treated as not set: it never crashes the server, and nothing unsealed stands in for it. A `PUT` or `DELETE` needs no restart: capabilities, the harnesses' offers, a save's checks and a run's checks see the change at once. A run already running keeps what it was handed, and the next launch takes what is saved then. Capabilities give each tool's key as `tools[].key`, a `GET /settings/tool-keys` id (`browserbase` for `browser`). `BROWSERBASE_PROJECT_ID` joins the launcher's list of secrets, as every field a tool key holds does. `agentrun-serve import` reads the launcher's secrets by name and opens the saved keys in its data directory, and cuts both out of what it writes. Before this, the launcher's secrets were not cut, because the import read them from an environment they had already been moved out of.
260
+ - A run's process gets a tool key's fields (`MONID_API_KEY`, `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`) over its secrets pipe only when its revision names a tool the key unlocks, as `GET /v2/settings/tool-keys` lists them: an agentic revision's `tools`, or the tools a workflow's model and call nodes name. Until now every run's process held every tool key the server held, whatever its tools. The tools are read from the revision the run is pinned to, at every launch: a relaunch, and a run opened again after a server restart, get the same keys as its first launch. The model keys still reach every run, and the decision keys go as before. A `typesafe` key (`TYPESAFE_API_KEY`) is saved the same way and unlocks Jev's decisions (`decisions.jev`). Each key row has a kind: only a `tool` row's fields are scoped this way, and a key of any other kind reaches every run.
261
+ - `monid.discover`, `monid.inspect` and `monid.run` run on claude-agent and codex too, as host tools in the run's process: the same calls and answers as on pi, on the key the run's process gets over its pipe, a long answer filed under the run's `work/evidence/monid/`. The harness calls and journals each under its wire name (`monid_discover`, `monid_inspect`, `monid_run`), as pi does, and the run's timeline shows it so. A `monid.run` call a crash cut off is answered interrupted, never sent again; `discover` and `inspect` may run again. Capabilities and the monid key's row list every harness for the three, and a claude-agent or codex revision naming one saves with no warning that it runs on pi only.
262
+ - What a `monid.run` charged is the run's spend, on every harness. It is booked once in the run's own records as a tool cost (`agentrun.tool_cost`, `TOOL_COST` from `@parcha/pi-durable-agent/timeline`: `{tool: "monid.run", charged_by: "monid", usd}`), which the timeline adds to the run's cost and shows on a `phase` row of its own (`Tool cost: monid charged $0.0030 for monid.run`); the usage row counts it apart from the model requests. A run that may have charged and reports no cost books an unknown charge, never $0: the run's cost reads `null`, and under a cap every later request is refused. Each run is marked before it is sent (`agentrun.tool_started`, `TOOL_STARTED`), held at the price an earlier `monid.inspect` in the run quoted, else at a $1 allowance; its charge settles the mark, and a mark a crash left unsettled leaves the run's cost unknown, as a cut model request does, while the cap counts it at its held figure, never $0. `GET /v2/usage` grouped by meter shows the charges as their own meter, `tools` (capabilities' `usage.meters`). Under a `max_cost_usd`, each `monid.run` is held as a model request is: unless the run's spend plus what the run is held at (the quote, else the $1 allowance) fits the cap, or when the spend is unknown, the call is refused with a `spend_cap_reached` error the model reads, naming its price and the cap (and that an inspect gives a quote when the allowance was used), and monid is not called. Runs go one at a time under a cap; on claude-agent and codex the check also holds each model request still in flight at its worst case. `discover` and `inspect` cost nothing and are never refused.
263
+ - `monid.discover`, `monid.inspect` and `monid.run`: with `MONID_API_KEY` set, an agent on pi gets monid's whole catalog of paid data endpoints through three tools in the tool picker. It finds an endpoint in plain words, reads its input schemas and price, and runs it, paid per call from the monid wallet. A run is sent once and never retried; an async one is read until it ends (about two minutes at most) and stopped at monid when the run stops. An answer over 60,000 characters is cut, the whole of it filed under the run's `work/evidence/monid/`. The launcher hands `MONID_API_KEY` to the server and each run's process over their pipes, like the other secrets. pi only for now: a revision naming one on claude-agent or codex saves with a warning and its runs are refused.
264
+ - A profile pack (version 1) and its resolver, not yet wired to any route. A pack maps each effort (`low`, `medium`, `high`) to an ordered list of skill names and an optional thinking level, and each output type to its writer skills, the workspace file the output lands in, and optional per-effort writer skills. `packIssues` returns every issue with a pack as `422` field issues pointing into it (`effort.low.skills[0]`), refusing unknown keys, skill names that are not 1 to 64 lowercase letters, digits and dashes starting with a letter or digit (the Agent Skills name rule, so nested, spaced, dot-leading and uppercase names are refused), output files that are not plain relative workspace paths, and lists or output maps over 32 entries. `resolvePack` reads a checked pack for one run: effort defaults to `medium`, the output to the pack's `default_output`, and the skills are the effort row's then the writer's, each once in first-seen order.
265
+ - AgentRun Server is published to npm, and `@parcha/agentrun-decisions` with it, which the server uses: `npx @parcha/agentrun-serve` starts the server with nothing else installed, its console included. pi runs; the Claude Agent SDK and Codex stay optional peers a person installs beside it, and capabilities say for each that it is not installed and the line that installs it. The archive carries the console with `dist/console/THIRD-PARTY-NOTICES.txt`, which the console's build writes from the bundle's own module list (each bundled package, its version, license and license text), and the server's `NOTICE` points to it. The release builds the console and stops when the server's archive lacks the console or its notices.
266
+ - An agentic run is told of the files given to it. Its first message, on every harness, is the input's `content`, then a blank line and one line naming each file in its `work/inputs/` by the path its tools take, with its size: `Files for this run: inputs/notes.txt (32 B), inputs/docs/plan.md (1.5 KB).`, at most 20 and then how many more, and never past what the run's door takes in one message. A run asked to "summarize the attached file" used to be given the file but never its name. The run's `input` is stored as it was sent; the timeline's first `user_message` is the message the harness got, the line included. A run given no files is sent its `content` as before.
267
+ - **A workflow run on AgentRun Server is drawn live, pauses and resumes, and a workflow is checked before it is saved**
268
+ - `GET /v2/runs/{id}/graph`: the run's workflow and graph, each node's state (map items labelled from the run's input, with the branch each route took for them; a route's branch), the decisions with their receipts (state seen, images, evidence, cost basis, error), the calls with their input and output, and totals. While the run goes it reads a live view the run's process writes (`live.json`), so a poll never waits on the run's store or answers `home_busy`.
269
+ - `POST /v2/runs/{id}/pause` and `/resume`: what is in flight finishes, and nothing new starts until the resume; a paused run stays paused across a restart. Run status gains `paused` (marked `pause/1`), `GET /runs?status=paused` lists them, and `GET /stats` counts a paused run as active.
270
+ - `POST /v2/workflows/validate { workflow, tools? }` answers `{ ok, issues: [{ path, code, message }], warnings }` and writes nothing. A refused save's `422` lists every issue as a field (`definition.workflow/<path>`) with its `code`.
271
+ - A workflow run's title is its agent's name and a few words of its input, never its JSON. A run's `llm` calls count in its cost.
272
+ - pi-durable-agent: `workflowIssues(workflow, tools?)` lists every issue a save would refuse; `checkWorkflowBody`'s refusal carries them, each with its message.
273
+ - dsl: the recovery driver's `pinJson()` gives its frame as it stands, for a host's live view.
274
+ - A run's end writes its metrics to the agent store, each time it is carried back: its tokens, model requests, models and tool calls over every conversation of its store (a workflow's model nodes and a harness's session included), the effort its newest process ran at (the run's `effort`, else its revision's `thinking`, else the `AGENT_THINKING` that process started with, else medium; codex's max is xhigh), and on claude-agent or codex the model its revision names, since their journal names the harness. A follow-up's end replaces them, and a run whose process died gets them from what its store holds. Metrics the store refuses (a tool name past its limit) leave the run ended without them, never unended. A workflow's decisions are not in its token counts yet.
275
+ - A run, and its row in `GET /v2/runs` and `GET /v2/agents/{id}/runs`, carries `pending`: what it waits on, as one field told apart by `kind`, or null. A run waiting on a person carries `{kind: "question", question, asked_at}`. It is read from the run's own last row, the one its status reads, never from a scan of its timeline, so a list shows what each run waits on without a request per run, and the MCP tool `runs_get` returns it as the route does: a run with any number of timeline rows reports its current question. The served OpenAPI document gives `pending` as a union on `kind` (`pending/1`), so a later kind, a tool call waiting on approval, is one more variant of it.
276
+ - A run's timeline says when its process resumed it: "Resumed after a crash" when its last process died holding it and the server relaunched it, or "Resumed after the server stopped" when it drained at a stop and the next start opened it again. The row comes from an entry the new process writes on the run's root as it opens (`RUN_RESUMED`, exported by `@parcha/pi-durable-agent/timeline`), so it stays once the run ends, on pi, claude-agent and codex alike. A first open, a follow-up and a wake from a park write none. A reader from before this ignores the entry.
277
+ - An escalated workflow run reads as waiting for a person, not as failed. Its `status` is `completed` (state `idle`), with `error` and `result.output` null, and a new nullable `review` on the run and on the runs list: `{kind, node, reason, at}`. `kind` is the escalation's kind as its escalate node names it, `node` is the label of the node it escalated at, `reason` is the escalation's summary, and `at` is when it ended. Every other run's `review` is null. The field is this server's own on the `/v2` document (`Run.review`, `RunSummary.review`, marked `x-agentrun-serve: review/1`). A run ended before this kept no review: it reads its row's summary as the reason, with kind and node null. A workflow run still takes no messages (501 `unsupported_here`). `readWorkflowRun` gains `escalation: {kind, label, summary}`.
278
+ - `web_search` and `web_fetch` work on pi, `claude-agent` and `codex` with only a model key. Each resolves in one order: the provider the user picked (the agent's own `definition.tool_settings` over the server's `PUT /v2/settings/tools`), then the native tool, then the kernel's keyless fallback. `web_search` is `auto` by default, native where there is one: Claude's own WebSearch (its adapter is opened with it, and no `web_search` host tool is offered), and on pi one request to the run's own model provider with its hosted search (Anthropic's `web_search_20250305` at 5 searches, OpenAI's Responses `web_search`), read from the provider's events and booked as one of the run's requests, its tokens plus $0.01 a search. On codex it is Codex's own search, each search booked at $0.01, except behind a gateway or under a spend cap, where it is keyless Exa; on claude-agent under a spend cap it is keyless Exa too, since Claude's own search has per-use fees a cap cannot reserve yet; a pi model behind a gateway or on another provider likewise searches Exa's public MCP endpoint with no key (`exa-keyless`, at most 8 results; a 429 at its free limit, or a 403 for a connection that is not direct IPv4, answers `{error}`, never retried). Every provider answers one shape, `{provider, query, results: [{url, title, snippet, published?}], text?}`, snippets cut at 3,000 characters, and the model's copy ends with a line asking it to cite the URLs it relies on; Parallel's search answers it too. `web_fetch` is the kernel's guarded fetch by default, and a page whose text it cuts at 60,000 characters says `truncated: true` with `original_chars` ; Parallel (search and extract) runs only where it is picked, and only then is its key handed to the run; a picked Parallel that gives no page leaves the direct fetch's page saying why (`parallel`), never a silent fallback. A pick of Parallel without `PARALLEL_API_KEY` resolves `unavailable`, and a run naming the tool is refused (`409`). Settings are `{web_search?: {provider: auto|native|exa-keyless|parallel|off}, web_fetch?: {provider: kernel|parallel}}` (`off` turns `web_search` off: nothing is searched, and a run naming it is refused, `409`), kept in the data directory (`tool-settings.json`, 0600); a `permission` is refused (`422 not_yet`) until the tool gate, and `capabilities.features.tool_permissions` is false. `GET /v2/capabilities` gives the two tools a `resolves` per harness, with the providers offered, the server's (`provider`) and the default (`default_provider`): capabilities is the one tool catalog (an unavailable tool says why, `reason`: a provider pick's own words such as `web_search is turned off in settings`, or `Needs` and the variables it is missing), and `GET /v2/agents/{id}` projects it onto the agent as `tools` (each granted tool in the same order; for one with a choice the provider in force, `provider_from`, `default_provider` and `resolved` on its harness and model). Under a run's cap pi's own search request is bounded at its context plus 125,000 input tokens and its most fee (Claude's and Codex's own searches do not run under a cap), its booked cost stops the next request, and a run whose booked spend passes its cap shows one timeline row saying by how much. In `@parcha/pi-durable-agent` a revision keeps `toolSettings`, and the timeline counts any request marked with a string `request` label as a side request, as it did a compaction's summary, and a `web_search` that answers `{error}`, or a `web_fetch` page followed by its line for the model that is `ok: false`, reads as a failed call, in its row and in the run's tool counts. With no key and no native search, web_search falls back to Exa's public keyless MCP endpoint, a third-party service with its own unpublished rate limits (a 429 past them) and terms (https://exa.ai/terms), reached over direct IPv4: set `web_search` to `native` (native only) server-wide or in an agent's `tool_settings` to turn it off, or pick `parallel` with `PARALLEL_API_KEY` to search with a key. `auto`, the default, is native where there is one, else keyless Exa. Upgrading: a server holding `PARALLEL_API_KEY` used to read every `web_fetch` page through Parallel's extract on its own; now it is the guarded direct fetch unless Parallel is picked, so set `PUT /v2/settings/tools {"web_fetch": {"provider": "parallel"}}` to keep that. A run keeps the tools its first launch resolved for its life, and a workflow's model and call nodes' tools resolve whether or not its revision lists them. `claudeAgentAdapter` takes `webSearchAllowance`: with its web search on, a search request is bounded at its body plus that many input tokens, instead of having no bound. `fetch_page` leaves the tool table: it is a legacy name for `web_fetch`, so a revision or call node naming it still saves and runs `web_fetch` under that name, resolved as `web_fetch` is.
279
+ - **`agentrun-serve import`: your Claude Code, Codex and pi sessions as agents and their runs**
280
+ - `agentrun-serve import [--data DIR] [--from claude-code,codex,pi] [--dry-run] [--all]` reads the sessions in your own home (`~/.claude/projects`, `~/.codex/sessions`, `~/.pi/agent/sessions`) into the agent store, once, when you run it. Nothing leaves the machine.
281
+ - Each project directory becomes one agent. Each harness seen in it becomes one revision: `claude-agent`, `codex` or `pi`, on that harness's latest model. Its instructions are the project's `CLAUDE.md` or `AGENTS.md`, and its skills are the project's skill folders (`.agents/skills`, `.claude/skills`, `.codex/skills`, `.pi/skills`), file by file. Every file is read through no link and within a size cap. A link, a binary file, an oversized file or a folder with no `SKILL.md` is left out, and the report names it.
282
+ - Each session becomes one run, ended as it ended (`completed`, `failed` or `stopped`), at its own times, with its transcript as the run's timeline. Its cost is the source's when it records one (Claude Code's session cost, the sum of pi's request costs); otherwise it is unknown, never 0.
283
+ - An imported run is history. A message to it is `409 not_continuable` with `details.reason` `imported`. A stop or a cancel answers as for an ended run and writes nothing. The run and its summary carry `imported_from` (`x-agentrun-serve: imported/1`).
284
+ - The values of key-shaped environment variables (`*_API_KEY`, `*_TOKEN`, `*SECRET*`) are cut out of everything written, and each run's files are the owner's only (0600 in a 0700 directory).
285
+ - Run again, it imports only the sessions it does not hold. A session written in the last 10 minutes waits for the next import. Subagent sessions are not imported. Projects whose directory is gone or temporary are left out unless `--all`. `--dry-run` lists each project and writes nothing.
286
+ - Setup can import this machine's Claude Code, Codex and pi sessions. It runs only on a server on that machine: listening on loopback, with no public address.
287
+ - `GET /v2/setup/import`: before the owner exists, this server's own page reads at once that it can import. It is `202 { counting: true }` while the count runs, then `{ projects, sessions }`, or `null` for each when the count failed. Any other read is a `403`. A server the CLI starts with no owner counts as it starts, so the numbers are usually ready when the page opens. Once the owner is set, the signed-in owner reads how the import asked for at setup stands: `{ state: "running" }`, `{ state: "done", agents, runs, skipped }` or `{ state: "stopped" }`. Everyone else, and a server at a public address, gets a `404`.
288
+ - `POST /v2/setup` takes `import: true` to import once the password is set, and then answers `importing: true`. Agents arrive as the import goes. A server at a public address, or one listening off loopback, refuses it with a `422` (field `import`) and sets no owner.
289
+ - The owner's yes is kept in the data directory (`.import-at-setup`) until the import ends, so a server stopped mid-import goes on with it at its next start. Closing the server stops the import between two sessions and waits for it, so nothing writes the store after close.
290
+ - A session imported before this change whose id held a saved Tool key keeps that raw id: a re-import adds a second run under `redacted-<hash>` and leaves the first. There is no migration; delete the old run to clear it.
291
+ - `GET /v2/stats` answers a dashboard's first page in one request: how many agents there are, the runs in all and how many are active, need input, failed or have a status this server cannot tell, each agent's run count, the total cost, and what is archived. It is this server's own route, outside the contract, marked `x-agentrun-serve: "stats/1"` in `/v2/openapi.json` with a closed schema. A running run is counted in exactly one of `active`, `needs_input` and `status_unknown`; one this server does not hold is `status_unknown`. The total cost sums only the runs that ended with a known cost and is null when none did, never $0. `unknown_runs` counts the rest. Archived agents and runs are left out of every number and counted on their own. Every number comes from SQL aggregates over `store.sqlite`, and no run's files are opened.
292
+ The agent store gains `stats()`, which answers those counts and sums, and an index on `runs` (`runs_by_state`) added without a new store version. An earlier version still opens the file.
293
+ - The tools a revision may name are one closed table: each name is how the run's process binds it and the environment variables it needs, and nothing outside the table can be named or loaded. `GET /v2/capabilities` now lists `tools` as objects, `{name, summary, nodes, available}` with `missing` (the variables' names) when a tool is not available here, where it listed names; a run of a revision that names a tool whose variables are not set is refused with `409 agent_not_runnable` and `details.missing`. `read`, `write`, `edit` and `ask_person` are the table's first entries, unchanged, and the page marks a tool the server cannot bind with the variables it needs.
294
+ - Uploads: `POST /v2/files` reserves a file and `PUT /v2/files/{file_id}` takes its bytes, and a run's `file_ids` reach its workspace. Both routes answered `501` before. The bytes are streamed to disk (the 1 MiB JSON body cap does not apply), checked against the reserved `size_bytes` and `sha256` (`422 input_invalid`), and capped at `limits.max_upload_bytes`, 50 MiB (`413`). A run names up to `limits.max_files_per_run`, 20, ready files; an unknown, pending or repeated one is `422` at `file_ids` before anything starts. Each is copied into the run's `work/inputs/` at its `path`, folders kept, before the run's process starts; a name already taken gets a suffix (`notes-2.txt`). Capabilities now say `features.files.upload: true`.
295
+ The page's session cookie may send a file's bytes with any content type to `PUT /v2/files/{file_id}`, still only with the page's own `Origin`. A route takes that rule only by a `raw` mark in the route table, which only a `PUT` may carry; every other write from the page still needs `application/json`, and the token is unchanged.
296
+ - A revision may name `web_fetch` on pi, `claude-agent` and `codex`: `fetch_page`'s Page plus `via`, `"parallel"` or `"direct"`. With `PARALLEL_API_KEY` set it reads the page through Parallel's extract (about $0.001 a URL); without the key, or when Parallel lists the URL in its errors, answers 5xx or times out, it is `fetch_page`'s guarded direct fetch. A URL the public-host guard refuses is never sent to Parallel, and a 401 or 403 stops Parallel for the rest of the run. An agentic run gets the Parallel key, on its decision descriptor and in memory only, when its revision names `web_fetch`; `fetch_page` is unchanged and never calls Parallel.
297
+ - `web_search` searches the web on pi with no key, through Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`). Only the query and the number of results leave the server, over IPv4, nothing else from the run. Past Exa's free rate limit the search is a tool error naming the 429 and its Retry-After; a search ends at 60 s. Keyless Exa is the default for a harness with no native search when no search key is saved; turning it off comes with Settings → Tools, as the provider pick for each capability. The Parallel key no longer lists `web_search` in what it unlocks. claude-agent and codex do not bind `web_search` yet.
298
+ - `web_search`'s default, `auto`, uses your Parallel key when the server has one (`PARALLEL_API_KEY`, or a key saved on
299
+ Tool keys), and bills it. That applies wherever the run has no native search on auto: pi behind a gateway or on a model
300
+ with no hosted search, codex behind a gateway or under a spend cap, a workflow, and claude-agent. On claude-agent, `auto`
301
+ now skips Claude's own search, which is an explicit `native` pick (refused under a spend cap, as before). Otherwise it is
302
+ keyless Exa. The order is the pick, then native (not on claude-agent), then Parallel, then keyless Exa. A pick of
303
+ `native` stays native only, a pick of `exa-keyless` stays keyless Exa, and `web_fetch` stays the kernel's fetch by
304
+ default.
305
+ Capabilities' `web_search` and `web_fetch` now say `why` beside `resolves`, one sentence per harness.
306
+ Keyless Exa is also sturdier:
307
+ - It is dialled over IPv4 alone, so a host whose default route is IPv6 no longer gets Exa's 403.
308
+ - Past Exa's free limit (a 429, or the rate-limited notice Exa sends inside a 200), the search is tried once more after
309
+ a short jittered wait, then answers "Free web search is rate-limited right now. Try again in a minute, or add a
310
+ Parallel key in Settings → Tool keys to search with a key."
311
+ - Exa's own failure text reaches the model as its first sentence only, quoted. Exa's instructions to update an MCP URL
312
+ never do.
313
+ - A webhook tells you when a run needs its person and when it ends. `PUT /v2/settings/webhook` with `{url}` sets one URL; `run.needs_input` (the run is `input_required`, `data.pending.kind` `question` or `stopped`) and `run.ended` (completed, failed or cancelled) are POSTed to it as thin `{type, timestamp, data: {run_id, agent_id, status, title, url}}` messages, signed by the Standard Webhooks spec (`webhook-id`, `webhook-timestamp`, `webhook-signature: v1,<base64 HMAC-SHA256 of "{id}.{timestamp}.{body}">`) so any of its libraries verifies them. The `whsec_` secret is made at the first PUT, shown once, and kept sealed under `AGENTRUN_SEAL_KEY`, as tool keys are. A try not answered 2xx in 15 s fails, and no redirect is followed; a failed message is tried again on the spec's schedule cut at about a day, then logged as failed, and a 410 turns the webhook off. Pending messages survive a restart (`DIR/webhook-outbox.json`). `GET /v2/settings/webhook/deliveries` lists the last 50 attempts, `POST .../deliveries/{webhook_id}/redeliver` sends one again under the same `webhook-id`, and `POST .../test` sends a `webhook.test`. The routes are in the OpenAPI document as this server's own (`webhook/1`), and capabilities say `features.webhooks`.
314
+ - `GET /v2/stats` answers `analytics`: the runs' tokens, requests, time and tool calls summed from the metrics the agent store keeps, over the runs not archived that the new optional `from`, `to` (RFC 3339 date-times) and `agent` query parameters pick (400 when one is malformed). It gives `totals` with coverage (`runs` beside `runs_with_metrics`, so a run with no metrics never reads as 0 tokens), `time`, `by_harness_effort`, `by_day` (UTC), `by_source` (`live` or the source an imported run came from) and the top 20 `tools`. Every other field of the answer is unchanged and stays the whole store's. The store reads it with `store.analytics({ from?, to?, agent? })`, SQL over `store.sqlite` alone in one snapshot; a store without the metrics tables answers with none. The served document marks the addition `stats/2`.
315
+ - A key saved through `PUT /v2/settings/tool-keys/{id}` is checked against its provider before it is kept, with one call that costs nothing and a 5 s deadline: monid's discover, Parallel's list of monitors, Browserbase's list of projects, TypeSafe's list of models. A key the provider refuses (401) is `422 input_invalid` (reason `refused_by_provider`), in plain words with the provider's first sentence and never any of the key, and is not kept. Otherwise it is kept, and `GET /v2/settings/tool-keys` gives the row of each key stored here a `check`: `{state: "accepted", at}`, or `{state: "not_checked", reason, at}` when the provider would not answer the check (403: a key scoped away from that call may still work for its tools), did not answer in time, could not be reached, answered a redirect (never followed) or something else, or has no free call. A key saved before this change reads `not_checked` until it is saved again.
316
+ - A tool's key is saved by name through the settings API and kept only as ciphertext, opened only by the server on its host. `GET /v2/settings/tool-keys` lists the keys (`parallel`, `monid`, `browserbase`), what each unlocks and each field's `set` and `source`, never a value; `PUT /v2/settings/tool-keys/{id}` with `{values: {NAME: "..."}}` seals each value with AES-256-GCM, bound to its field's name, into `DIR/tool-keys.json` (0600), and `DELETE` forgets it. The seal key is `AGENTRUN_SEAL_KEY`, which the launcher takes from the environment or keeps in `agentrun/seal.key` under `$XDG_CONFIG_HOME` (or `~/.config`), made the first time, outside the data directory; a run's process never gets it. With none, nothing is saved (`409 no_sealing_key`) and `capabilities.features.tool_keys.at_rest` is `unavailable`. A field the server is started with is `409 key_set_by_server`. A stored value that does not open (no seal key, another one, a damaged file) never stops the server: GET marks it `stored_unreadable` and `reenter` says why, and the log says so once, naming the file. `MONID_API_KEY` joins the launcher's secrets. pi-durable-agent exports the vault's `seal` and `unseal`, unchanged, for a host's own secrets.
317
+ In a container, pass `AGENTRUN_SEAL_KEY` or mount a directory at `XDG_CONFIG_HOME`: the container's own `~/.config` goes with it, and a new one's fresh seal key does not open the keys the volume holds.
318
+ - Claude and Codex runs keep their token counts and their model in the run's journal, as pi runs do. A `runner.turn` record now keeps its request's tokens (`usage: {input, output, cacheRead, cacheWrite}`), so a request re-booked when the run opens again keeps them; a cost written late (`agentrun.request_cost_late`) and a compaction's cost (`agentrun.request_cost`) carry the request's tokens in `data.usage`; and an adapter answer's `pi.assistant` entry names the model its request asked for, its provider still the harness. Tokens that are not known are left out, never written as counts. Journals written before this change open and re-book as before, with no tokens. No cost changes.
319
+ - A capped `claude-agent` or `codex` run goes on after one of its requests was cut, by a stop or by a crash, while its cap leaves room: the cut request counts at the worst case the cap held for it, not as a spend no one knows. Before, the model proxy booked a response cut short at an unknown cost and a crash left a request with no booking, so the run's spend became unknown and every later request was refused with `spend_cap_reached`.
320
+ - A harness runner's `beforeRequest` may answer `{ holdUsd }`, what the host holds for the request. The runner writes it on the request's `runner.request` record (`heldUsd`) before the request leaves, and the spend it shows the host (`spentUsd`) counts a request at that figure when the request's own cost never comes in: a response cut short, or a request a crash cut off, read by a later process. A request with no such figure (a session written before this release, or a host that holds none) leaves the spend unknown, as before. The cost booked for the request is still unknown, so the run's shown cost is unchanged.
321
+ - serve's cap holds each request it admits at its worst case (its measured input bound and its model's output ceiling, at the model's price) and hands that figure to the runner. A capped run whose process died mid-request is opened again and goes on at that figure, and is refused with the cap's message once the figure leaves no room.
322
+ - A run whose follow-up turn ends without showing an answer now ends completed, with `result.final_answer` `""`: the turn's own answer, which has no text. The earlier answer stays in the timeline. The Claude CLI's `/compact` is one such turn: a summary request and no text. Before, the run sat `working`/`idle` until another message came, because serve ended a run only when its newest row was an answer. Now a claude-agent or codex turn writes its end on the run's root, and the run ends when every message it took has had its turn, whatever the door said meanwhile. A follow-up placed while a turn works is still waited for, on every harness. A claude-agent or codex run whose process died after a turn's last writes, before the turn's end was written, ends once its next process opens: that process writes the missing end when the session holds the turn as over, completed when the turn's answer is on the run's root and interrupted when it is not, so a turn that showed no answer leaves the run waiting for the person (`input_required`). When a message the person sent meanwhile is still waiting, that process starts the message's turn first and writes the missing end inside it, so the run completes only once that message is answered, also when the server restarted with it. A message accepted and not sent yet keeps the run open on any server, also when its process died just after the turn before it ended. A follow-up whose answer stops at its length (max output tokens) is the run's answer, as its timeline shows it.
323
+ - A run cancelled while it works now reads `cancelled` as its first terminal status even when the turn the cancel cut puts it over its cap. Before, the server's check over the run's cost came ahead of the cancel: a cost that came in with the cut turn's end published `failed`, and the run then ended `cancelled`. A cancel the server took now decides the run's end before anything else does.
324
+ - A cancel means cancel: once a run is cancelled, its process sends no model request, however the cancel and the process's start interleave. serve marks the cancel in the run's directory before it reaches for the run's process, and the run's process refuses, before it is sent or counted, any request it would make after that mark. A cancelled run sends no compaction summary either, and a request it refused is not counted as one: the timeline skips pi's error entry for it (`REQUEST_REFUSED`). A request is checked against the cancel twice: once before its start is marked, and again after, right before it leaves. A cancel that lands while the mark is being written still stops the request, and its start is then withdrawn (`REQUEST_ENDED` with `unsent: true`), so the run's cost counts only what was sent.
325
+ - A run's cost includes pi's compaction summaries. A summary is a paid model request that pi books only in its own usage document, never as an entry the run's timeline sums, so a run that compacted under-counted its cost and its requests, and /usage with it. serve now marks a summary's request like a generation's (`request: "compaction"`) and writes its cost (`REQUEST_COST`, `agentrun.request_cost`), which the timeline counts and sums; one aborted before its answer, or open when the run settles, makes the cost unknown. A run that compacts also completes again: serve counted the messages still to arrive from the number of user rows the run showed, and a woken run's compacted conversation shows fewer, which read as messages still waiting, so the run stayed working; they are now counted by id.
326
+ - **A run's cost reads unknown once a model request was cut, never $0**
327
+ - The timeline's cost row counts a request cut before its end (a stopped turn, a killed process) as unknown, so the run's sum reads "unknown" from then on. Before, the cut request added its stream's reported usage: $0 on the OpenAI Responses API, which reports usage only at the end, and only the input and first output token on Anthropic's Messages API. Either way the provider charged more than the sum showed.
328
+ - serve's run cost takes the timeline's usage row as it is. A run opened again by a follow-up whose rows say unknown no longer shows the cost the agent store kept from its earlier end.
329
+ - A request cut before it streamed any content leaves no assistant entry in the store, so it is not counted at all; that is unchanged here.
330
+ - A workflow's decision requests (its judge, pick, sift, route, ask and verify nodes on Jev or Parallel) count in its run metrics, so `/v2/stats` and Mission Control no longer undercount a workflow's tokens. `runMetricsWithDecisions(records, decisions)` takes the run's decision receipts beside its entries (`runMetricsOf(records)` keeps its one parameter, so `.map(runMetricsOf)` is safe): each is a request, by `provider/model`, with its `usage` (`input_tokens`, `output_tokens`) in the token sums; a receipt with no usage, or a cancelled one, is counted in `unmetered`, never as 0 tokens. serve passes a workflow run's receipts at its end.
331
+ - A pi run whose model ends its turn with a stop that holds only an empty text block (and perhaps an empty thinking block), with no tool call, now completes. Before, the timeline showed no row for it, so the run read `working` and `idle` until it was cancelled and its timeline never turned final. The timeline now shows a `final_answer` row with empty text for that answer, and the run completes with `result.final_answer` `""`. A message with no text block at all, such as a request the Claude or Codex bridge writes without content, still shows no row.
332
+ - A follow-up to a run that answered, or that the person stopped, no longer shows "Resumed after the server stopped" in the run's timeline. Once a run answers, its server lets its process go, and the process recorded that the same way as a server stop, so the next open read it as one. The server now tells the run's process when it opens the run for such a follow-up, and that open writes no "resumed" row. A run a server stop or a crash cut still shows its row when it resumes.
333
+ - Checking a harness's binary against its pins no longer reads the whole binary into memory, and runs once per binary in a process. `verifyCodexBinary` (the codex binary, 294 MiB) and `verifyClaudeAgentCli` (claude-agent's CLI, 231 MiB) each read the file whole to hash it, and agentrun-serve checked each again for every model it resolved: twice per harness in its start's probe, then once per save and once per run check, and a run's own process once more when it made its adapter. One start probe peaked at 395 MiB of memory, 675 MiB with a default model, past a 512 MiB container's limit. The hash now reads 1 MiB at a time, and a check that passed is kept for the process while the binary stays the same file (its path, device, inode, size, and modification and change times, with the pins); touched or replaced, it is checked again, and a failed check is never kept. The kernel's `@parcha/agentrun-kernel/host` exports both parts, `sha256OfFile` and `checkedOnce`.
334
+ - A claude-agent or codex run works in the run's workspace, the directory its file tools write to. Before, the CLI's working directory was an empty one beside it (`runs/<id>/harness/work`): Claude told its model that path, so a file written at its absolute path was refused as "outside the workspace", and the answer quoted the server's data directory. In QA this happened in 3 of 4 Claude runs that wrote a file.
335
+ - `SessionIO.cwd`: a host may name the session's working directory, its workspace. The Claude and Codex adapters run their CLI there, and keep their own state in the session's private directory as before. git stops at the workspace's parent. serve passes the run's `work/`.
336
+ - A file tool's refusal, an error such as ENOENT, and a write's or edit's result on claude-agent and codex name paths in the workspace relative to it (`notes/a.md`, `../escape.md: outside the workspace`), never by the server's data directory. A read's result is the file's own text and is not changed.
337
+ - A host tool's result reaches the model whole on claude-agent and codex. The Claude Agent CLI saved an MCP tool's result past 50,000 characters (a long `web_fetch` page, a `monid` answer, a 50 KB `read`) to a file under its own config directory and told the model to read it, which the run's confinement refuses, so the model could not read the page; Codex kept only the two ends of a result past its truncation policy (10,000 tokens for the models its catalog holds, about 12,000 characters for another). `@parcha/agentrun-kernel` states the bound once, `HOST_RESULT_MAX_CHARS` (120,000 characters, over every host tool's largest result); the Claude Agent adapter lists each host tool with it as `anthropic/maxResultSizeChars` and sets `MAX_MCP_OUTPUT_TOKENS` to it, and the Codex adapter sets `tool_output_token_limit` to it as Codex counts it (four bytes of UTF-8 a token: 90,000).
338
+ `web_fetch` (and `fetch_page`) reads a page a part at a time: `offset` and `max_chars` (20,000 by default, at least 200, at most 50,000; a smaller one or an offset below 0 is refused before anything is fetched, saying so; a workflow's call node reads 50,000 by default) name the part, the Page gives `chars`, its length, and a part that is not the whole page has `truncated` while more follows, `next_offset` where it begins and `original_chars` where the whole length is known; an agent reads a line after the JSON saying which characters these are and the offset that reads on. A page whose HTML pi-browser cut at 1,000,000 characters before reading it gives `html_chars`, its whole length, on every part and no `original_chars`, and the line after its last part says `The page was cut at 1,000,000 characters of HTML before reading; the rest wasn't read.`; `converted: "text"` says its text is plain text, its conversion to markdown having run out of time. The text was cut at 60,000 characters with no way to read the rest. A page's links come with the part at offset 0, at most 200 in 20,000 characters, and a URL longer than 4,096 characters is refused before anything is sent.
339
+ `web_search` leaves out its least relevant results when its answer would pass 100,000 characters, and `omitted` counts them.
340
+ - A learned rule that changes what an agent trusts or skips now always waits for its owner's OK, whichever model grades it. Before, the hold rested on the grader's reading alone, and models read the same rule differently: "refunds up to $250 need no manager" was held by one grading model and used at once under another. The end-of-run turn now marks such a note `risky: true`, and a note is held when either the run's turn or the grader says it is risky. The grader reads each note without that mark, so it still judges the note on its own (a planted instruction is still dropped). The mark is never kept: a held note says so by its status. The grader's rubric also names a limit or threshold under which someone may go ahead alone as risky, however it is phrased.
341
+ - A workflow's `llm` call is paid once and its tokens count. Each call completes on the run's marked models, so its cost is already a `REQUEST_COST` entry the run's cost sums, and serve added it again from the node log. The run's cost, the cost its end stored, its graph's total, `/v2/stats` and Mission Control all showed it twice; now each counts it once, and the cap, which already counted it once, is unchanged. That entry now also carries the completion's tokens as pi counts them (`input`, `output`, `cacheRead`, `cacheWrite`; none when pi counted none), so an `llm` call's tokens and a compaction summary's are in the run's metrics, once, rather than unmetered.
342
+ - `GET /v2/settings/tool-keys` names, for a model key, every harness its key runs that this server could run, before the key is saved: OpenRouter's row lists pi, claude-agent and codex, Anthropic's pi and claude-agent, OpenAI's pi and codex. Before, a harness waiting on a model key dropped out, so with none saved OpenRouter's row read pi alone. A harness left out is one this server cannot run for another reason: not installed, not the pinned build, or more than this host's memory. Where the host names claude-agent's endpoint (`ANTHROPIC_BASE_URL`), OpenRouter's row leaves claude-agent out, since that endpoint takes Anthropic's key alone. An `ANTHROPIC_BASE_URL` claude-agent refuses is now its reason before a missing key, and no key row lists claude-agent behind it. Capabilities' `harnesses` are unchanged.
343
+ - On a server started with `npx @parcha/agentrun`, a harness that is not set up (claude-agent without the Claude Agent SDK, codex without Codex) now says the one command that starts the same AgentRun again with it, on the same data: `npx -p @parcha/agentrun@<version> -p @parcha/agentrun-serve@<version> -p @anthropic-ai/claude-agent-sdk@0.3.286 agentrun --data ~/.agentrun` (with the store's absolute path). It keeps any other harness package already there, so setting up one never takes the other away. A server started with `npx @parcha/agentrun-serve` says the same with `agentrun-serve`, and adds `--data` only when its data is not in its default place. `npx @parcha/agentrun` keeps its data in `~/.agentrun` and hands it to the server, `import` and `reset-password` as `--data`, and its hint names that store as an absolute path, so the pasted line opens the same store from any directory; `agentrun-serve`'s own default, `~/.local/share/agentrun/agents`, does not change. When the server can't be downloaded, the command says so ("Couldn't download the AgentRun server (@parcha/agentrun-serve: not on npm). Your network or the release is the problem; nothing was started.") and exits 1, instead of saying the server did not start on a port.
344
+ - A pi run's model request is counted when it leaves, not when its answer starts. serve marks each generation request on the run's root before sending it (`agentrun.request_started`), and again if its stream ends aborted (`agentrun.request_ended`, with the provider's `responseId` when it named one before the cut). The timeline (`REQUEST_STARTED`, `REQUEST_ENDED` from `@parcha/pi-durable-agent/timeline`) counts every marked request: one with no `pi.assistant` entry (cut before its first content, by a stop, a cancel or a crash), other than the latest still in flight while the run works, makes the run's cost unknown (once the run is settled, a last request with no entry was cut by the process that ended), with every request counted, never the sum of the others. A run's rows are as before otherwise: no usage row appears for a request still in flight, and one with no marks reads as it did. A request the cap refuses is never sent and never marked; pi's compaction is not marked. A model stream that throws while it is read ends the request as an error instead of leaving the turn waiting.
345
+ - A process that exited and was never reaped (a zombie, as an orphan becomes under a PID 1 that does not reap, such as a container started without an init) is no longer counted as running. `processAlive(pid)` (from `@parcha/agentrun-kernel/host`) reads the process's state on Linux and falls back to `kill(pid, 0)` elsewhere; serve uses it to watch a run's process, so a server that restarts after its run's process died relaunches the run instead of waiting on the zombie forever.
346
+ - A claude-agent or codex run that a stop or a crash cut off mid-tool, and that the next process resumed, completes once it answers. The cut call's "interrupted" row used to be made at the end of the timeline, after the answer, when the next process's turn ended, and the server reads a run's last row to know it answered: the run stayed Working until another restart. The row now sits right after its call, in the live timeline and in the stored one.
347
+ - A message sent while a server ends a stop that the server before it saved is no longer lost. That server died after saving the stop and before its abort reached the run, so the turn still ran. The next server aborts the turn once it sees it, and the run reads stopped (`input_required`) at once. A follow-up sent in that window could reach the run before the abort. pi then withdrew it with the turn, so the message was accepted as a follow-up and never ran, and the run read `working` from then on. A message now waits for that abort as it waits for a stop in flight, then starts the run's next turn.
348
+ - A run's Docker box drops every capability, and a Docker daemon on another machine never binds this machine's `work/`.
349
+ - `dockerBoxes({ dropCapabilities: true })` runs each box with `--cap-drop ALL` and `--security-opt no-new-privileges`. Serve's run boxes always use it. Without it, a server run as uid 0 made boxes that were root with Docker's default capabilities, so `bash` could `mknod` a device node in `work/` (`c 10 130`, the watchdog) for the file tools on the host to open. With it, `attach` ends a box made without it (an older version's, its run resumed) instead of taking it, so a fresh hardened box replaces it. The option is off by default in pi-transport, because a launcher that drops from root to another user needs Docker's default set.
350
+ - `dockerBoxes`' `mounts` is now false when `DOCKER_HOST`, or the docker context (`DOCKER_CONTEXT`, else the config's `currentContext`), names a daemon on another machine (tcp://, ssh://, or a context whose record names no unix socket). With `DOCKER_HOST` and `DOCKER_CONTEXT` both set, both must be this machine, and each create checks again, so a `docker context use` after the provider was made refuses the next spec with mounts. A spec with mounts is then refused as `unsupported`, naming the setting and how to undo it. In serve, a run's box on such a daemon is not bound, so `read`, `write` and `edit` go through the box, never this machine's `work/`.
351
+ - A server killed or stopped while it builds or pulls the Docker box's image no longer leaves a run waiting on it for ten minutes and then failing with Docker's own error. The image's record names the server that wrote it (its pid and start time, as the box sweep checks a box record's writer). A run whose first box finds that server gone fails its call at once: `its image … is not ready: the server stopped while building it: restart the server to build it again`. The next start builds it again, as before.
352
+ - A build or pull that fails is tried once more, 5 seconds later, by the same server. Meanwhile the box stays `preparing`, its `reason` saying what failed (`trying once more: <the failure in words>`). One that fails again is `unavailable` with the reason, as before. One that ran out of time is not tried again.
353
+ - The serve README's recipe says `out.txt` names the image's Debian, with no version.
354
+ - A pi run with a spend cap no longer reads back more than it can have spent after its process restarts, which could refuse its next request with `spend_cap_reached` though the cap had room. A request a crash cut counts at the worst case its start mark holds. The spend read back took the largest such figures in the whole run, including requests an answer or a stop had already closed: a request answered at $0.20 (held $0.30) followed by one cut (held $0.10) read as $0.50, not $0.30. The marks are now read in order. Each request still open counts at its own start's figure. Where requests overlap and an answer could have closed either, it counts at the larger, so the spend is never read as less than what can have been billed.
355
+ - An older start with no figure that an answer closed before the cut request started no longer makes the spend unknown.
356
+ - pi's error for a request whose start mark could not be written, which never left, no longer counts as answering another request in the spend read back. Before, it could close a request still in flight, so the spend after a crash could be read as less than what that request can have cost.
357
+ - Under a spend cap, a model request whose response had begun and that then ended on an error counts at the worst case the cap held for it, as a request stopped before its end does. Before, it counted at its own usage, which is what had streamed when the error came (an overloaded event or a reset part way through: the input, and little or none of the output the provider can have billed), so a run could pass `max_cost_usd`. This holds in the run's process, where the next request is judged against the hold, and after a crash: the request's end mark says it ended on an error and holds the figure, and a summary that failed after it began writes its cost mark with `failed` and the hold. An error before any event of the response (refused at the HTTP level: a 429, a 5xx, which the provider does not bill and pi retries) still counts at its own usage, normally $0, and a request that never left (refused by the cap, its mark not written, a cancelled run's) counts nothing. The run's shown cost is unchanged.
358
+ - Under a `max_cost_usd`, a `monid.run` under way holds what it is held at (the price an inspect quoted, else the $1 allowance) until its charge is in, and a model request checked meanwhile counts it beside what the run has spent, on pi and on claude-agent and codex. Before this, a model request sent while a paid call was out was checked against the spend alone, so the two together could pass the cap. A paid call that fails without an answer counts at its held figure in the run's process, as its unsettled mark already counts once that process is gone.
359
+ - Under a `max_cost_usd`, a `monid.run` that may have charged and says no cost (stopped by the run's stop, past its wait, `TIMED_OUT`, `FAILED`, or one whose sending failed) now counts at what it was held at (the price an inspect quoted, else the $1 allowance), the same bound the cap let it go at. Before this it made the run's spend unknown, so every later model request and paid call was refused with `spend_cap_reached`, in the run's process and in one opened again from its store. A capped run whose monid call is stopped or times out now goes on while its cap allows, on pi, claude-agent and codex alike. Its cost still reads unknown (`null`), and `/usage`'s `tools` meter does too: the hold is the cap's bound, never a charge.
360
+ - A pi run's spend cap refuses once what the run has spent is unknown, as claude-agent's and codex's already did, prices a request stopped mid-answer at the most it can have cost, and refuses a model whose output is priced but that names no output ceiling on every harness.
361
+ - The spend a pi run's process reads back from its store at start follows the run's own timeline cost, so every rule the timeline keeps for an unknown cost holds: a cost that is not a number, a cost still pending, a request marked as sent with no answer and no figure for it. Before, each of these counted as $0, and a capped run kept spending past what it could count. Now every later request is refused with `spend_cap_reached`, and so is every request after an answer in the same process whose cost is unknown.
362
+ - A request stopped before its end (`POST /runs/{id}/stop`, or a summary that failed) counts at the worst case the cap held for it, never at the cut stream's own usage, which is not what the provider charged (the Responses API reports none until the end). Its end mark (`agentrun.request_ended`) carries that figure as `heldUsd`, so a later process counts it the same. A capped pi run that is stopped and sent another message goes on while its cap allows, and is refused with the cap's message once it does not. A request a crash cut (its process gone mid-request, so no answer and no end) counts the same way, from the figure its start mark (`agentrun.request_started`) carries as `heldUsd`: a capped pi run opened again after its process died goes on while its cap allows. A stopped or cut request from a store written before this release has no figure and still reads unknown. The run's shown cost is unchanged: a stopped or cut request shows unknown.
363
+ - A request the cap refuses gets a start mark of its own (`agentrun.request_started` with `capRefused: true`) before pi writes its error entry, so that entry no longer stands for an earlier request a stop or a crash cut, and the run's cost shows unknown there, never $0.
364
+ - A model with no output ceiling (no max output tokens and no context window) was priced at no output, or at a worst case that was not a number and passed every check. Under a cap it is now refused with `spend_cap_reached`, unless its output costs nothing at every price tier, which keeps a known worst case. No model in pi-ai's catalog, and no gateway model serve builds, is affected.
365
+ - The README's "Spend cap" section says what the cap does on every harness: the input bound (UTF-8 bytes plus what the provider adds, not pi-ai's estimate), a model listed at $0 as a known $0, and what is refused under a cap.
366
+ - claude-agent runs on a model named the way OpenRouter names it. A revision naming `anthropic/claude-sonnet-5.5` sent Anthropic the bare dotted `claude-sonnet-5.5`, an id neither Anthropic nor OpenRouter knows, and its runs failed. claude-agent now sends Anthropic's own id, the model id with its dots as dashes (`claude-sonnet-5-5`), which Anthropic takes and OpenRouter takes too, and prices the run by the same id, so its cost is the catalog's estimate rather than unknown. The run's `max_cost_usd` reads the same id, so a capped run named the dotted way is held to its cap like any other. The doubled `anthropic/anthropic/claude-sonnet-5.5`, once the workaround, is now refused with `422` on `definition.model`, naming the form to use: `anthropic/claude-sonnet-5.5`. The `LOOPBACK` allow-list carries the key gate's loopback marker.
367
+ - When claude-agent can't run here, its reason now names the missing Claude Agent SDK, with its install line, before any missing key. A server with no SDK and no `ANTHROPIC_API_KEY` used to say only that the key was missing. Setting the key would then not have made claude-agent available, and the image's smoke check failed on that reason. The key is still named once the SDK is in place.
368
+ - A server stopped while setup is still counting this machine's sessions now exits at once. Before, its close waited for the count's worker to finish listing every session file, because the listing never checks for a stop. On a home with many sessions that held the exit for seconds, past the drain window. The count writes nothing, so close now ends its worker and waits for it to exit, and the next start counts again. An import under way still stops between two session files and is waited for, so nothing writes the store after close.
369
+ - Every agentic run's system prompt now starts with one line that says today's date and where the run works: "Today is 2026-11-03 (UTC). You are running on AgentRun; your workspace is your working directory, and file paths are relative to it." pi, claude-agent and codex get the same line. Before, pi was never told the date, so a question about the latest release was answered from the date its model was trained on ("As of March 8, 2025, ..."). The line is made again as each turn starts: on pi it is a prompt section rendered before every model request, so a run resumed on a later day is told that day; claude-agent and codex get it in the session's instructions each time the run's process opens the session.
370
+ - The decision keys are held like the server's other secrets. `TYPESAFE_API_KEY` and `PARALLEL_API_KEY` are on the launcher's list, so started by its launcher the server gets them over the secrets pipe and holds them out of its own environment. A workflow run's process gets a decision key on its decision descriptor alone, never with the secrets it is handed over its own pipe, which are its tools' environment. The server chooses Jev's key from the secrets it holds, so a key the launcher handed over, the OpenRouter gateway's included, still reaches the run's judge.
371
+ - A workflow's typed questions honour the node's own decision settings, and a decision's unknown cost survives a restart.
372
+ - A run's judge goes through `judgeFromProviders` over the server's providers (Jev here), and the run's checks before any node runs take the same providers. A workflow naming a provider the server does not run is refused at save, `422` on `definition.workflow`, naming the provider, instead of being asked of Jev; a node asking what its provider cannot give (evidence required of Jev, which gives none) is refused before the run, naming the node. A node's `timeoutMs` bounds its request, and each receipt names the provider that answered.
373
+ - A workflow run a restarted server adopts as ended reads its decisions' cost from its store again, so a run with a decision of unknown cost reads `cost.usd: null`, never the model's priced usage alone.
374
+ - A workflow run's decision rows are now cleaned and cut like every other timeline row. Each URL in a row's summary or text keeps its origin, path and query keys and loses its query values, fragment and credentials. The summary is cut at 500 characters and the text at 2,000. A decision stored before receipts kept their status now reads as answered or failed from its rule and error instead of `undefined`, and an old route names the branch it took. When a run's decisions can't be read, its timeline's usage row reads unknown instead of showing the model nodes' cost alone. `GET /v2/openapi.json` now lists `decision` in `TimelineKind`, marked `decision-rows/1`, so a client that validates rows against it accepts them.
375
+ - `PUT /v2/agents/{agent_id}/definition` takes the contract's body: the definition itself, as hosted takes it, with the contract's preconditions. `If-Match` is required (`412 precondition_failed` without it), and `definition.version` must be greater than the current one (`422` on `definition.version`). Any greater version is taken and always makes a new revision, the same definition saved again included. This server numbers its revisions in order, so the answer's `definition.version` is the next number, whatever larger one the body named. A client written to the contract can now edit an agent here. This server's own body, `{definition, skills?, note?}` like `POST /agents`, still works with `If-Match` optional, and the served document now describes both bodies as exactly one of the two, marked `definition-body/1`, plus the `note` that `POST /agents` takes.
376
+ - `GET /v2/openapi.json` now says which definition fields serve takes, and what a run it refuses holds. `DefinitionInput` showed the contract's `input_schema`, `output_schema` and `max_cost_usd` as fields, though serve refuses each with `422 not_allowed`. Each is now marked `x-agentrun-serve-unsupported` with the reason its 422 gives, and listed in `info.x-agentrun-serve.unsupported_fields`. `ErrorBody.details` gains `x-agentrun-serve-details`: the shape of `agent_not_runnable`'s details here: what keeps the revision from running (`unbound`, `missing`, `harness`, and for a workflow `adapters`, `code`, `tier`), or, for an archived agent, `archived_at`. `harness`, `model` and `thinking` were served already, as `x-agentrun-serve` additions.
377
+ - An edit sent without `If-Match` that another edit overtakes while it is being checked is built and checked again on the new current revision. What it leaves out (skill files, harness, place) now comes from the revision it is committed on, never from the one it first read, so it cannot undo the other edit.
378
+ - serve's test hooks (`AGENTRUN_SERVE_FAUX`, `AGENTRUN_SERVE_FAUX_HARNESS` and every name after that prefix) are set from `startServe`'s options alone. A name in the server's own environment is dropped from what the server reads and from every run's process. Before, a published server honoured these names from its environment with no option: a leftover export gave every run fake answers or loaded a module by path.
379
+ - `fetch_page` now runs on `claude-agent` and `codex`, not only on pi. A revision naming it on either harness used to save with a warning that it was not bound yet, and every run of it was refused `409 agent_not_runnable`, so those agents could not read the web here. It is bound as the file tools are: pi's own tool, public-host guard included, may run again after a crash since it only reads. Capabilities' `tools[].harnesses` now names the harnesses that run each tool here (`x-agentrun-serve: tool-harness/1`), so a client can offer exactly the tools the chosen harness runs.
380
+ - **A completed run takes a follow-up, as the contract says**
381
+ - `POST /runs/{id}/messages` to a completed agentic run is a `follow_up`: the run opens again on its own store and session, under its spend cap, answers, and completes again. It used to be `409 not_continuable`. It is the same run, before and after a server restart.
382
+ - A follow-up sent while the run's end is still being written (its process closing, or its carry back waiting on a busy store) waits for it, up to a request's deadline, then continues the run; past the deadline it is `503 unavailable`, to try again.
383
+ - Opening it takes a place under `--max-runs`: with none free the message is `429 rate_limited`, and the run stays completed.
384
+ - A failed or cancelled run, an archived run and a run of an archived agent stay `409 not_continuable`: archiving closes a run.
385
+ - The agent store has `reopenRun`, which opens a completed run again (running, no end); its cost and summary stay until the next `carryBack`.
386
+ - On codex and claude-agent, a request's cost is written with its answer even when it is booked after the harness has the answer: the harness's proxy answers before it books the response. A turn's end now waits up to 2 s for those costs. A cost that comes after the wait leaves the answer written with its cost pending (`REQUEST_COST_PENDING`): the run's cost reads unknown until it comes in, as a `REQUEST_COST_LATE` the timeline adds to the cost without counting another request. So the run's spend, its spend cap and `/usage` count it once, and one paid request is one request. If the process goes before it can, the next open writes it from the session's booking, and never writes the request twice. Through a gateway (`AGENT_MODEL_BASE_URL`), codex now sends the model id as the gateway was configured with it, provider-qualified or not, and no longer strips `openai/` from it. On pi, a run's spend cap now also counts its compaction summaries' cost, read back from its store when its process starts, which it did not count before: a run near its cap can be refused a request it used to be allowed.
387
+ - A cancel holds on every harness. A run on codex or claude-agent whose cancel serve has marked sends no further model request, as a pi run already did. Each request the harness's session asks for is refused before it leaves: the turn ends on the refusal, with nothing sent or paid. That holds whatever started the turn, a message or a recovery the run's process starts itself. A cancel that lands after a request's check and before its record is written is caught too: the booking reads the cancel again at both points. A request withdrawn that way is not counted when the run opens again: no answer is written for it, and it costs nothing.
388
+ - A codex or claude-agent run's model proxy now reports to the run's log. serve gave neither adapter a log, so the proxy's lines were dropped: a refused request, a response whose ids could not be written, a usage or a price that could not be read. Each is now one JSON line in the run's `process.log` (`event: "harness"`, with the harness's id). A request's path is written without its query string, and every value of the environment's key-shaped variables (`*_API_KEY`, `*_TOKEN`, `*SECRET*`) is cut out of the line, so a key a caller sent, or one serve holds, never reaches the log. A failed run's message is never taken from such a line: it comes from the process's own last line before them.
389
+ - A run on codex or claude-agent marks each model request on its root as the request leaves, as a pi run's are. A run that ends with a request still out and never opens again then carries back a cost that reads unknown, never the sum of the others without it. That is a run cancelled, or failed, mid-request.
390
+ - An unavailable `claude-agent` or `codex` now says when a restart is part of the fix. The server checks each harness's package and pins once, at its start, so a harness installed after it, or put back on its pinned build, stays unavailable until AgentRun restarts. Its reason in `GET /v2/capabilities` (and in a save's warning or a run's `409`) now ends with `once it is installed, restart AgentRun to pick it up`, or `once the pinned build is installed, restart AgentRun`. Run from npx, a reason whose install line is already the npx line that restarts the server with what is missing is unchanged, as is a reason a setting fixes, such as a missing model key.
391
+ - An agent's home matches its host-owned names by identity: a path's first segment is compared folded (compatibility form, any case, no combining marks) and, where it and `learning/` are both on disk, by device and inode. Home paths take only plain segments, each its own NFC form with no default-ignorable code point; any other is `400 invalid_file_path`. The home path checks are in their own module, `home-path.ts`.
392
+ - A host tool's long output (another harness's `bash`, `read` and the rest) is cut at a character boundary. A cut that fell inside a multi-byte UTF-8 character used to show as `�` at the start of a kept tail or the end of a kept head; the character is now left out whole, and the text stays within the tool's byte limit. A character whose bytes arrive in two output chunks is decoded as one.
393
+ - AgentRun Server's image carries no Claude Agent SDK until its licence is reviewed for the image. The SDK (with its platform packages, which hold the Claude CLI) is a dev dependency of the Claude Agent adapter, so the image's `npm ci` installed it. The Dockerfile now removes it after the build, and `docker/image-check.sh` fails the build if any copy is left in the final tree, nested ones and a bin link included. Until then the image reports claude-agent as not installed, with the line that installs it. The Codex CLI is not held back.
394
+ - `docker/image-smoke.sh <image> [docker run arguments...]` checks that a built image serves. In a container published on a loopback port only, `GET /v2/health` answers 200 ok and `GET /v2/capabilities` answers with the contract. Where capabilities list harnesses, pi is available; claude-agent is never available: it is unavailable as not installed, with its install line, or as a harness this server does not run yet; and any other harness is available, or unavailable with a reason a person can act on, not an import error. On a failure it shows the container's log with keys withheld, and it always removes the container.
395
+ - `agentrun-serve import` imports sessions from current Codex versions. These write the person's turns only as user messages, with no `user_message` event, so the importer found no message of the person's and skipped every such session unless `--all` was passed. The person's turns now come from the session's `user_message` events when it has any, as older versions wrote both, and otherwise from its user messages, so each turn is counted once. A user message's blocks that the CLI adds are left out: its own elements such as `<environment_context>`, an AGENTS.md heading over `<INSTRUCTIONS>`, and the tags around an image. A prompt the person wrote as a tagged element stays theirs.
396
+ - `agentrun-serve import` cuts the server's own keys (the launcher's secrets, such as `OPENAI_API_KEY`) out of what it keeps. The server's start moves those keys out of its environment, so the import's cut never saw them, and a session that held one kept it in the store. They are now read back in for the cut and replaced with `[redacted]` wherever they appear. A session's id is cut too: one named after its file, when the file's name held a key, no longer keeps it, and a later import still finds the run it made.
397
+ - An imported run's page and its stored metrics give one number, and every subagent request counts once. Each of a run's subagents' requests is written into its transcript as a request with no answer of its own there, its usage and cost with it, so the timeline's usage row, the run's cost and its metrics count the same requests and tokens; the timeline shows no extra row. A session written in several files under one id (a Codex thread resumed later, a Claude Code session resumed in another directory and copied into that project's folder) is one run, its files merged in order through the same record count; the import used to keep only the first file while the dry run counted them all. Each subagent's file counts once: a Codex child in its thread's run (it used to count once per file of the thread), a Claude Code subagent with the session file beside its folder. A record a file copies moves no time at work, whatever its type (a copied system or meta record used to add its gaps again), and a file holding only copies adds nothing to its session. The import reads a project's files in one order, Claude Code's by folder and oldest written first, so the first file holding a copied record keeps it whichever way the import is run. A session's files sit in the project of its first file by start. A subagent tied to no session brings its own subagents' usage into the summary's totals. Merged, a session's cost is counted once (Claude Code writes a running total, which a moved copy carries on), its turns follow the order its files ran, and its state and answer are those of the file that ended last. A subagent's failed request keeps its known zero tokens: a `REQUEST_COST` mark with `failed: true` has its counts taken as they are, as a failed answer's are.
398
+ - An import (`agentrun-serve import` and setup's import) now cuts the secrets this server made and keeps out of everything it writes and prints, by their exact values: its API token (`ar_local_...`), its door token, its sign-in secret, and its webhook's signing secret (`whsec_...`) when the seal key opens it. Before, one pasted into a session was imported as it was. Each counts once in "N secrets removed", as the other keys do. Still imported as they are: a key-shaped value this server did not make (a `whsec_` secret from another service) and a run's own door token.
399
+ - `agentrun-serve import` (and its `--dry-run`) now says once, on stderr, when it cannot open this server's webhook signing secret to cut it: with no `AGENTRUN_SEAL_KEY`, or one the secret was not sealed under, it prints `event=webhook_secret condition=seal_key_missing` (or `condition=unreadable`) `name=AGENTRUN_SEAL_KEY`, the file, and that the import does not cut it, in the same log-line form as the tool keys' `seal_key_missing` line. The import goes on as before. Before, it left the secret uncut and said nothing. What the CLI says on stderr (this line, and the tool keys' line) now goes through the same cut as its printed lines, so a key in the data directory's path prints as `[redacted]`.
400
+ - A `PUT /v2/settings/tools`, and a tool key's `PUT` or `DELETE /v2/settings/tool-keys/{id}`, answers in milliseconds: each one used to check every harness again (each CLI's package and pins, codex's binary hashed), which took seconds, though neither a tool setting nor a tool key changes what a harness offers. The server checks the harnesses once at its start and remakes only what a write changes, so capabilities, a save's checks and a run's checks read right after the answer show it: what a web tool resolves to, a tool's `available` and `missing`, the decision providers. A start logs the check's length as `event=harness_offers why=start ms=<n>`. A save or a run check no longer checks the harnesses again after a key write either.
401
+ - A claude-agent or codex run's cost no longer reads unknown until the run is opened again when bookings come in late or out of order. The proxy books a response when its stream closes, which can be after the harness has its answer, after its turn has ended, and after a later request's booking.
402
+ - A late cost for a request written at unknown cost goes on the root as soon as it comes in, wherever it sits among the costs still to write. Before, it was written only when it was the oldest of them, so behind a later request's cost it waited for the next open.
403
+ - A cost that comes in with no turn running is written then. Before, a request still unbooked at its turn's end, whose cost came only after the turn, had no root entry until the next open.
404
+ Each request is still written once, and each cost once. The cap reads the session's own bookings, as before.
405
+ - A run whose launch takes the server down no longer takes it down again at every start. serve writes a launch mark in the run's directory before it spawns the run's process, and removes it once that process serves or exits. A start that finds the mark fails the run once, with `run_failed` and `error.details.reason` `server_lost_at_launch`, instead of launching it again. Before, a spawn that aborted serve itself (as on macOS) was repeated by the next start's recovery, so serve went down at every start until the operator removed the run. `RunError.details` is this server's own field, marked `x-agentrun-serve` in the served OpenAPI document; the vendored contract is unchanged. A run whose process came up and then died still opens again as before. If the mark cannot be removed (a read-only or failing disk), serve logs `launch_mark_kept` with the run and keeps serving; the mark left behind fails that run at the next start.
406
+ - An `llm` call whose tier the state fills in (`tier: "{requestedTier}"`) now runs on the model of the tier it asks for. Before, the run registered a model only for tiers written literally, so such a call asking for `strong` or `fast` was answered by the default model (`AGENT_MODEL`) without a word, and billed at its price. A templated tier now registers all three tiers, and their models are checked before the run as a literal tier's is; and a call naming a tier the run has no model for fails with `llm: tier <tier> has no model in this run` instead of falling back. A call that names no tier still runs on the default model.
407
+ - `POST /v2/runs/{id}/messages` no longer answers `409 home_busy` for a message it has already taken. Its answer read the run's stored row after the message went in. So while another connection held the agent store, a message that ran was answered `home_busy`, and a client that retried sent it twice. The answer's `status` and `state` now come from the run itself. `POST /v2/agents/{id}/runs` had the same shape: its answer read the stored row after the run was written and its first message counted. A busy store answered `409 home_busy` for a run that ran, and a retry without an Idempotency-Key started a second one. A run's start now answers from the run itself, and so do a stop and a cancel, which read the store after they took effect only for their status.
408
+ - A message sent while a stop is in flight is no longer lost. `POST /v2/runs/{id}/stop` sets its mark, then saves it and aborts the turn through the run's process. A message that came in that gap read the run stopped, went in as a follow-up to the turn the abort was cutting, and was dropped with it: pi withdraws the inputs it had queued, and a harness door hook drops its own queue. Its row never came, so the run read `working` for good and kept its place under `--max-runs` until a cancel or a restart. A message now waits, up to a request's deadline, for a stop in flight to answer, including one that began while the message itself was waiting (on the run's end, its reopening, or the agent store), then goes in as a follow-up to the stopped run and starts its next turn. `startServe` takes `beforeAbort`, a test's seam awaited by a stop between its mark and its abort.
409
+ - A claude-agent or codex run whose model asks for two or more tools in one answer completes. A harness reports each call as it runs it, and serve wrote the answer at its first call's end, so each later call of that answer went into the next answer's entry, after its own result: the closing answer then held a tool call, the call read as interrupted though it had succeeded, and the run stayed `working` until it was cancelled. Such a call is now written as a continuation of its answer (`agentrun.request_continued`), before its result. The timeline shows it under the answer it continues, and counts it as a tool call but not as a model request.
410
+ - A run's process no longer registers pi's `bash` tool. Every run now installs pi's `read`, `write` and `edit` without `bash`, and a run on another harness takes its host file tools from the same set. Models were never offered `bash` here; now the run's process does not hold it at all.
411
+ - A missing Codex now names the line that fixes it for how the server was started, as claude-agent's SDK does. Run from npx, its reason gives `npx -p @parcha/agentrun-serve@<this version> -p @openai/codex@0.164.0 agentrun-serve`; installed in a project, the `npm install --save-exact @openai/codex@0.164.0` line, as before.
412
+ - claude-agent's missing Agent SDK names the line that fixes it for how the server was started. Run from npx (`npx @parcha/agentrun-serve`), where there is no project to install into, its reason in `GET /v2/capabilities` and in a refused run gives `npx -p @parcha/agentrun-serve@<this version> -p @anthropic-ai/claude-agent-sdk@0.3.286 agentrun-serve`, which runs the same server with the SDK beside it. Installed in a project, it gives the `npm install --save-exact …` line, as before. The server tells npx by where its own files are: under npm's `_npx` cache.
413
+ - A refused read, write or edit of a path outside the workspace no longer names a host path. pi's file tools resolve a path against the workspace before the confinement checks it, so the refusal named the resolved path (`../../.token` read as `<data>/runs/.token`), the workspace's own directory, and, through a link, where the link points. `PathOutsideWorkError`'s message now names no path (`outside the workspace`); a caller tells a refusal from any other error by its type and its `reason`. agentrun serve names the refusal by the path the call gave, as it gave it (`../../.token: outside the workspace`), on pi and on the other harnesses alike, on the runner and in a box (where the refusal named the box's work dir too), so neither the model nor the run's timeline reads the server's data directory.
414
+ - Parallel's fees for `web_search` and `web_fetch` are now the run's spend. Each search ($0.001 for up to 10 results,
415
+ $0.001 for each one past them) and each page Parallel extracts ($0.001 a URL), at Parallel's published price, is booked
416
+ as a tool cost (`agentrun.tool_cost`, `charged_by: "parallel"`): a line of its own on the run's timeline, part of its
417
+ cost and of `/usage`'s `tools` meter. Under a spend cap each is a paid call, sent only when it fits what the cap has
418
+ left; past it a search answers the cap's refusal and a page is the guarded direct fetch, and nothing reaches Parallel.
419
+ One sent holds its price until Parallel answers, and a model request checked meanwhile counts it beside the spend, so
420
+ the two never pass the cap together. Before, these calls were billed by Parallel but counted nowhere, and a cap did not
421
+ hold them.
422
+ - `pdf_pages` draws each document under a page directory of its own. Before, the directory was named by the document's file name alone, so `company-a/certificate.pdf` and `company-b/certificate.pdf` drawn in one run both answered `pages/certificate/<dpi>/1.png`, and the second draw replaced the first: a judge about company A could be shown company B's page. The directory is now the document's path below `--documents` (or the run's `work/`) made one path-safe name and ended with 12 hex characters of its hash, such as `pages/company-a_certificate-56c2fc556c26/110/1.png`; the layout `work/pages/<stem>/<dpi>/<n>.png` is unchanged, and the same file always draws under the same name. Pages a run drew before keep their old `pages/<name>/` directories, and refs to them still load; a new draw goes under the new name.
423
+ - A run that has ended (failed, completed, cancelled) gives its place back once its process exits, and a start that needs that place now waits for it, up to that process's drain and kill, instead of being refused `429 rate_limited` for a place already being given back. Under load, a failed run's process can outlive the moment the run reads failed; the next start no longer depends on which comes first. A completed run's follow-up waits the same way. Two follow-ups that reach a completed run while it waits for a place share its one reopening, and both are sent to the run; the second is no longer refused with 429 or `unavailable`.
424
+ - A model key set for one of pi-ai's other providers (`GEMINI_API_KEY`, `DEEPSEEK_API_KEY`, `XAI_API_KEY`, Bedrock's `AWS_*` keys, about forty in all) is now held like `OPENAI_API_KEY`: the launcher takes it out of the server's environment, and a run's process gets it over its pipe only when its model is that provider's. Every model key now goes only to the runs whose model needs it: a pi run its model's provider's (per tier for a workflow), or `AGENT_MODEL_API_KEY` through the gateway; a codex run `OPENAI_API_KEY`, or the gateway's; a claude-agent run `ANTHROPIC_API_KEY`. Before, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY` and `AGENT_MODEL_API_KEY` went to every run. Before, the launcher named four providers' keys, and every other one stayed in the server's environment and in every run's, where Codex's process, a program a run started or any process of the same user could read it. Operators set the same variables.
425
+
426
+ - No run's environment, nor docker's probe's, holds a variable named like a key, on the launcher's list or not: one of its `_`-separated segments, in any case, is `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `PASS`, `PAT`, `CREDENTIAL`, `CREDENTIALS` or `DSN`, or its last is `PWD` after another (never `PWD` or `OLDPWD`). It is pi-durable-disk's rule, and the import's cut and a harness's log take it too. A credential an SDK finds through such a variable (Bedrock's web identity token file or container role, `GOOGLE_APPLICATION_CREDENTIALS`, `ANTHROPIC_IDENTITY_TOKEN_FILE`) is not supported for runs.
427
+ - A run on Bedrock passes the AWS keys its process holds to each request, as pi-ai's Bedrock request reads them, instead of from an environment.
428
+ - The decision keys go only where a run needs them, still on their own descriptor: Jev's (by its route) to a workflow with a node that names Jev or none, Parallel's to one with a Parallel node or to a run that binds `web_fetch`, OpenRouter's to one with an OpenRouter node. A workflow with no decision node, like an agentic run without `web_fetch`, gets no descriptor; before, every workflow got every decision key the server held.
429
+ - Not covered: a key-shaped variable the launcher's list does not name stays in the server's own environment; Bedrock credentials by container full URI with `AWS_CONTAINER_AUTHORIZATION_TOKEN` are not supported for runs; a pi run on a `typesafe/` model does not get `TYPESAFE_API_KEY`, a decision key.
430
+ - Every refusal and reason about places, boxes and the agent's home now names the next step.
431
+ - A place's `422` on `definition.place` carries a `fix`: the place it most likely meant, to copy (`"place": {"mode": "sandbox", "box": "docker"}` for `"place": "docker"` or `{"mode": "docker"}`), or the field to remove. `bash` on a runner agent gets the sandbox place as its fix; the browser in a sandbox, `Remove "browser" from definition.tools.`; a workflow in a sandbox, `"place": {"mode": "runner"}` (an edit that leaves the place out keeps the agent's).
432
+ - A box that `AGENTRUN_BOXES` does not list says `not enabled on this server: start AgentRun with AGENTRUN_BOXES=docker`, keeping the boxes the setting already lists. The same reason is in capabilities, a save's warning and a run's `409`.
433
+ - A `docker` whose daemon does not answer says `docker version failed (exit 1): start Docker, or add this server's user to the docker group, then restart this server`. A missing CLI says to install Docker. A save's warning and a run's `409` end in one full stop (no more `?.`).
434
+ - `capabilities.tools`' `bash` is `available: false`, with a `reason` naming each box's own, when no box this server has can run it.
435
+ - The start banner adds a line saying which boxes are ready (`Boxes: docker is ready, so sandbox agents run their tools there.`), or why none is. `startServe` returns it as `boxesLine`.
436
+ - A read under the home's `learning/` names `/v2/agents/{id}/learning` only on a server that has that route. Otherwise it says `the server keeps learning/ for itself; this server has no learning API yet`.
437
+ - The browser's sandbox refusal is in plain words.
438
+ - (`@parcha/pi-durable-agent`) A timeline row for a call answered only by the harness's diagnostics block (a tool that threw or is not offered) is summarized by its error (`Ran \`true\` failed: Tool bash is not available`), not by the block's `<harness>` tag.
439
+ - A server started on a data root whose server is still stopping now waits for that stop instead of refusing. A stop keeps the data root until its runs' processes have drained and exited, which takes up to the drain timeout and a second (31 s by default), and the API keeps answering, with runs `working`, meanwhile. A start in that window used to exit at once with "another server holds this data root: stop it". Now a stopping server prints `agentrun-serve: stopping: waiting up to N s for N runs to finish their turn` as its close begins, when runs' processes are left to finish, and records in `<data>/server.state` when its stop is over at the latest. A server writes that file once as it starts (its pid, running) and its stop rewrites it in place, so a stop adds no entry to the data root: a caller that removes the directory right after it signals the stop meets nothing new there. A start that finds the lock held reads that file, prints `agentrun-serve: the server on this data root (pid N) is stopping; waiting for it, up to N s`, takes the lock once the stop is over, and opens the runs the stop cut again. A start on a data root whose server runs is refused at once, as before, and so is one whose record names a process that is gone or a time that has passed. `startServe` takes `notice`, called with both lines in place of standard error. A server's `close()` runs once: a second call returns the first one's promise, and never rewrites the record of a server that started on the data root since.
440
+ - A run's timeline no longer loses rows when its end is carried back. The live "Run started" and "Run finished" rows, which no agent-store entry records on any harness, are never served, so the rows a reader pages through once a run reads `completed` are the rows it ends with. A cancel sent while a run that answered is finishing is refused (`cancel_requested: false`, `already_terminal: true`), and the run ends `completed` instead of `cancelled`.
441
+ - A run's files line quotes each name as a JSON string, with any control, format or line-separator character as its `\uXXXX` escape: `Files for this run: "inputs/notes.txt" (32 B).` A name holding `", ` could forge another entry, and an RTL override or a zero-width character could reorder what the model read. The line also reads only `work/`'s own `inputs/`, walked from `work/` as the run's file list is: a link at `inputs` names nothing from where it points, and the run starts as before.
442
+ - A run runs where its agent's definition puts it: a run request names no place, and `POST /agents/{id}/runs` with `place` is `422 input_invalid` at `place`, as with any field the body does not keep. The served OpenAPI document has no `RunCreate.place`, and the console's run bar and playground offer no "Run on the server instead".
443
+ - The server's secrets are out of every process's environment. `agentrun-serve`, the bin and the image's entrypoint, is now a small launcher. It hands the server each secret it names over a pipe and starts it with `env -u` for each, so none is in the server's `/proc/<pid>/environ` or command line. The secrets are the API token, `AGENT_MODEL_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `BROWSERBASE_API_KEY` and `OPENROUTER_API_KEY`. Before it starts any other process, the launcher moves each secret out of its environment into its own memory. The server reads the pipe first thing and closes it, and hands each run's process the run secrets over a pipe of its own, never its environment, which the run's process reads in a preload before anything else loads. In the image, PID 1 is still tini, started by the launcher. Capabilities' `secrets` says how secrets are held and the limit: in memory, they rely on the kernel refusing a process of the same user to attach (Yama `ptrace_scope` 1 or more). Operators still set the same variables. Started as `node dist/cli.js`, the server reads them from its environment, as before. The bin needs a POSIX `sh` with a builtin `printf`: Linux or macOS, not Windows.
444
+ - A data root serves one server at a time, and the server now enforces it instead of the README only saying so. A server takes `<data>/server.lock` (mode 0600) and holds it until it closes. It takes the lock after the checks that only read and refuse, such as agent homes from 0.1.0-beta.26, so a start they refuse still creates nothing. It takes it before anything that writes. A second server on the same root, in another process or in the same one, is refused before it opens a store, adopts a run or binds a port. The CLI exits 1 with one line: `agentrun-serve: another server holds this data root (<data>/server.lock): stop it, or start this one with another --data`. A crashed server's lock is released by the kernel, so the next start reuses the file. `takeServerLock(dataRoot)` and `ServerLockHeldError` are exported.
445
+ - **`/v2/stats` counts an escalated run as completed and needing review, never as failed**
446
+ - An escalated workflow run is `completed` on `/v2/runs`, with a `review`, but `/v2/stats` counted it as failed: `runs.failed` added the escalated runs, and each analytics group counted them in `failed`. Now `runs.failed` counts failed runs alone, and `runs.needs_review` counts the escalated ones. Each analytics group (totals, by harness and effort, by day, by source) counts an escalated run in `completed`, with `needs_review` beside it, under the agent and date filters too. The new fields are marked `stats/3`.
447
+ - The agent store's `AnalyticsGroup` gains `needsReview`, and its `completed` includes the escalated runs, which its `failed` no longer counts.
448
+ - A client that showed `failed` as "failed or escalated" should show `needs_review` beside it.
449
+ - A capped run that the person stops can go on. A request you stop now counts what it streamed, plus up to 1,024 output tokens the provider may have produced after the last word we read, and never more than it was held. Before, it counted at its whole hold. Since each request is limited to what is left of the cap, that hold was the rest of the cap. So a $1 run stopped after $0.004 of spend read $1 spent, and its next message failed with `spend_cap_reached`.
450
+ - **On pi:** a stopped request counts its input bound, each byte of text, thinking and tool calls it streamed as a token, and `STOP_ALLOWANCE_TOKENS` (1,024) of output, at the model's price, at most its hold. Its end mark (`agentrun.request_ended`) carries that figure as `heldUsd`, so a later process counts it the same.
451
+ - **On `claude-agent` and `codex`:**
452
+ - The model proxy reports a response its client left part way, its cost unknown, with the bytes it had sent (`stoppedAfterBytes`).
453
+ - A runner `beforeRequest` may answer `stoppedUsd(streamedTokens)` beside `holdUsd`. The runner counts such a response at the lesser of the two and writes the figure on its `runner.turn` (`heldUsd`, `stopped: true`).
454
+ - A response the provider ended early, or one cut by a crash, still counts at its hold.
455
+ - **Unchanged:** a request that ended on an error after its response began, a failed summary and a crash cut still count at the hold. The run's shown cost is unchanged: a stopped request reads unknown, beside its cost so far.
456
+ - A stopped run stays stopped until the person sends another message, whatever happens to the messages it shows. The stop is kept as a place in the run's store (`stopped_at` in the run's `serve.json`: the stopped message's id, or place 0 when the stop came before any message), and the run reads stopped while no message shown is newer. Before, it was a count of the messages shown, which a compaction changes. Now a run stopped and then compacted stays stopped, even when the compaction summarized the stopped message itself. A run that was sent a new message and then compacted back to the stop's count no longer reads as stopped. A stopped run whose compaction summarized every message it showed reads `input_required`, not `queued`. A run with no rows shown yet still reads `queued`. A stop the run refuses leaves nothing saved. A run stopped by an older server (`stopped_after`, a count) reads as before.
457
+ - A stop works on a run that is working but still reads `queued`. A message sent to a run shows in its timeline only once the run's process reports it, so right after a start, on a loaded machine, a run well into its turn could still read `queued` (state `working`), and `POST /v2/runs/{id}/stop` answered `stopped: false`. The stop now waits, up to a request's deadline, until the run's timeline shows every message sent to it, then stops the turn as it stops any working run: `stopped: true`, and the run reads `input_required`. It waits for the timeline first so that what the stop records as the person's last message is the one the turn was answering, and the stop holds once that message shows. A run that ends, is cancelled or loses its process while the stop waits answers `stopped: false`, as before.
458
+ - A stopped run stays `input_required` and `idle` across a server restart. It used to read `working` and `idle`, and when its process was gone the next server opened it again as if it still had work to do. The server now keeps the stop in the run's `serve.json`, as the count of messages the person had sent when it was stopped, so the next message ends the stop with nothing to delete.
459
+ A server that stopped between saving a stop and its abort reaching the run left the turn working while the run read stopped; the next server now finishes that stop, aborting the adopted turn once.
460
+ - **serve no longer stalls while another process holds the agent store**
461
+ - Every read and write of the agent store waits for a busy store without blocking the server, so other requests are still answered meanwhile. Before, one write could hold up every request for up to 5 s.
462
+ - A request waits up to about 2 s for the store, then answers `409 home_busy` with `retry_after_ms`. A run's end keeps trying until it is written.
463
+ - Creating an agent while the store was busy answered `409 agent_exists`, and a read answered `500 internal`. Both now wait, then answer `home_busy` if the store stays busy.
464
+ - An edit that waits for the store is checked against the revision current when it commits, so two edits held up together cannot both write: the second gets `422` at `definition.version`, or, being the same edit, the revision the first made.
465
+ - A workflow run that ends while the store is held waits for it as long as a run's end does, and one still held after that is settled again every 30 s, not left until the next start.
466
+ - A run's answer is read at one moment: a run that ends while its read waits answers ended, with its result.
467
+ - A pi run on a gateway model that has no price (an id pi-ai's catalog does not list, with no `AGENT_MODEL_PRICE` or tier price) now reads its cost as unknown, `cost.usd: null`, where it read a known $0. Each answer of such a model is written with no cost total, as a harness run's unpriced answer already was, so one such answer makes the run's cost unknown, a compaction's summary included. A model the catalog lists at $0, and a set price of `0,0`, stay a known $0. Priced models are unchanged.
468
+ - A run whose `file_ids` holds something that is not a file id is now told what it sent and where a file id comes from: `file_ids[0] is "", not a file id: use the file_id an upload answered (POST /v2/files answers it under file.file_id).`, where it said `file_ids[0] is a file id`. What was sent shows as its JSON, cut to 40 characters (never inside a surrogate pair). The README and llms.txt say the upload's answer holds the id under `file`.
469
+ - Uploads: a reservation that names no `content_type` takes its path's extension's type, as a run's files are served (`plan.md` is `text/markdown; charset=utf-8`; an unknown extension stays `application/octet-stream`; a named type still wins). `upload.expires_at`, which the contract requires, is documented as advisory and not enforced in this release: a later `PUT` is still taken. The refusals that point at an upload route name it in full: `POST /v2/files`, `PUT /v2/files/<id>`. The extension table resolves only its own extensions: a run's file named `x.constructor` or `x.__proto__` is listed with no type and served as `application/octet-stream`, where it was listed without a `content_type` and could not be read, and an upload so named takes its bytes.
470
+ - A start clears the temp files a crashed upload left: a file sent in one call leaves `.incoming.<pid>.<hex>.tmp` in `DIR/files/`, and a PUT leaves `bytes.<pid>.<hex>.tmp` in the file's folder. The sweep runs under the data directory's lock, before the server answers anything, so no upload of its own is in flight. It matches only those exact names and removes only regular files: a link named like one is not followed or removed, a `DIR/files/` that is itself a link is not swept at all, and a file's bytes and record stay. A start that removed any logs `event=uploads_swept removed=N`.
471
+ - The usage row (`Cost so far`) is always a run's last timeline row. It used to keep the place it first appeared, after the run's first answer, while its count and timestamp moved on with every answer after, so it sat above rows it postdated. When a row is served after it, it now moves to the end with a new `seq`, a change a cursor sees.
472
+ - The workspace walk no longer leaves out what it cannot look at. In a directory that lists but cannot be searched (mode 0444, say), each entry's own look failed and the walk skipped it without a word, so a caller read the directory as holding nothing and could infer its files were gone. Each such entry is now reported refused as `unreadable`, and the rest of the run's files are still walked. An entry removed between the listing and its look is still left out, as it is gone.
473
+ - A run's `run.ended` webhook is no longer lost, or sent twice under two ids, across a crash or a refused write. The server now chooses a run's end time once and gives it to the agent store, so the store's `ended_at` and the message's `webhook-id` name one time (`carryBack` takes it as `endedAt`, an ISO time in UTC; with none it stamps now, as before). `run.ended` is queued only once the agent store has the end, and the webhook outbox keeps which end of each run it queued in the same write as the message; a server that starts queues any end of the last day that the agent store holds and the outbox does not, under the same id, so neither a kill nor a crash of the machine loses it; the first start after this change records when it began (`DIR/end-notices-since`), and an end before it, or before the webhook was set, is never sent. Behaviour changes: while the agent store refuses a run's end, `run.ended` waits until the end is stored (a later try or the next server), where it used to go out at once, and a receiver that reads the run back on its message reads it ended; a run is continued only once its end's `run.ended` is in the outbox, `503` with a retry meanwhile, so the continued run's next end has its own id.
474
+ - A run that comes to need its person while no server is up now sends its `run.needs_input` once a server takes it over: the webhook outbox keeps which wait of each run it queued in the same write as the message, and a server that adopts a run queues a wait it stands at that the outbox does not name, under the wait's one `webhook-id` (its stop's, or its question's row's). A wait the previous server already queued is not sent again; one whose outbox write failed before a kill is queued again by the next server. A run waiting when a server is first upgraded to this has no record yet, so its `run.needs_input` is sent once more, under the id it had.
475
+ - What serve reads out of a run's workspace never goes through a link, and never reads a file hard-linked in. That covers the files endpoint (`GET /runs/:id/files/:path`), the file listing, and each skill's `SKILL.md` at a run's start.
476
+ - Before, the file view checked each component with `lstat` and then opened the file by its path, so a name swapped for a link in between could hand it a file outside the workspace. The listing likewise `stat`ed by path.
477
+ - Now every read goes through pi-durable-disk's confinement, which walks on held directory handles without following links. The path must be the workspace joined with its own names, so a link anywhere on the way is refused, even one pointing inside the workspace. Only regular files with a single link are read.
478
+ - A file serve cannot read is listed with `unreadable: true` (a serve extension on `RunFile`), and reading it answers 403 `system_file_forbidden` with `details.reason` `unreadable`, never a 500. A tool in the run's box creates such a file when it makes it owner-only.
479
+ - A directory the walk cannot read is reported as refused, never read as empty, and the workspace itself unread is an error (no working copy).
480
+ - pi-durable-disk exports `Confinement`, its types (`Pin`, `PinSpec`, `RootName`), and its test seam as `confineTestHooks`, from `@parcha/pi-durable-disk/internals`.
481
+ - `GET /v2/setup/import` answers `200 { "offer": false }` where it answered `404`: to the signed-in owner when no import was asked for at setup, and to the setup page of a server that cannot import (a public address, or open setup off loopback). The console reads that answer as no offer, so its first page no longer logs a failed request in the browser; it still reads a `404` from an older server the same way. An offer, its count and an import's state answer as before, and a browser that is not signed in still gets `404` once the owner is set.
482
+ - A message sent after a stop reads as the person's next message in the timeline ("You: …"), never as a steer ("You (steer): …"). The timeline took any message right after a tool round as a steer into the running turn, but a stop or a cancel can cut a turn right there. The timeline now reads two marks a cut leaves:
483
+ - an aborted call's result (pi-durable's `aborted` diagnostic);
484
+ - the end mark of a model request that had left and was aborted (`agentrun.request_ended`, neither `unsent` nor a compaction's).
485
+
486
+ After either of these, the next message starts a new turn, in the stored view and the live one alike. A message placed between a tool round and the next request is still a steer.
487
+
488
+ agentrun-serve's README, `llms.txt`, the serve skill and the MCP tools `runs_respond` and `runs_cancel` now say what can be continued. A stopped run can: a follow-up starts a fresh turn on its history, and the cut turn is not replayed. A cancelled run cannot: a message to it is `409 not_continuable`, so start a new run.
489
+ - A Claude or Codex turn the person stopped stays stopped when the run's process is replaced. Before, the next process found the stopped turn still open in the session and resumed it: it ran its tools and paid for its model requests again, and its answer came before the person's follow-up. Now serve's open reads the run's stop record and settles that turn, ended `interrupted`, with nothing sent, and the follow-up is a turn of its own. A turn a crash or a drain cut is resumed as before.
490
+ - A stop that lands before the harness took the person's message withdraws that message too, so it is never sent later: not with the follow-up in the same process, and not by a process that replaces it.
491
+ - `AdapterSession` has `settleOpenTurn()`: it records the open turn as ended, interrupted, withdraws the input the turn never placed, and sends nothing. The Claude Agent, Codex and faux adapters implement it. A harness that runs as a child process does both with `settleTurn(drive)` from `@parcha/agentrun-kernel/process`. An adapter written outside this repository without it keeps the old behaviour: its stopped turn is resumed.
492
+ - After `interrupt()`, the Claude Agent and Codex sessions read `open_turn` while the stopped turn is still open in their records. serve's stop settles it there; a runner's pause leaves it for the next process to resume.
493
+ - When the earlier process died before it wrote the stopped turn's end, the next one writes it, `interrupted`, before the follow-up's turn starts.
494
+ - The person's answer to an agent's question is no longer shown as a steer. `ask_person` ends its turn, so the answer is the person's next message, but the timeline labeled every message that came straight after a tool result `You (steer): ...`. The timeline gains `registerTurnEnding(tool)`, for a host's tool that ends its turn, and serve registers `ask_person` with it. A message after a round whose tools all end the turn reads `You: ...`; a steer into a running turn reads as before. A call to such a tool that failed (an agent asking with no `ask_person` bound gets an error and goes on) ends nothing, so a message after it is still a steer.
495
+ - A run's timeline only grows: a row it has shown stays, in its place, across a woken run's processes. A woken run rebuilds its live rows from the conversation's current view, which after a compaction no longer holds the messages the summary replaced, so those messages and their answers used to disappear from `/v2/runs/{id}/timeline`. Only live rows (a stream, a wait, a run phase) are dropped when they end. `timelineReducer` gains `isLive(id)`, which tells such a row from one a committed entry made. The server remembers which rows were shown live over every connection to a run, so a wait that ended while the connection was down goes with the next snapshot, never staying beside newer work.
496
+ - A run's tool counts read a call's outcome as its timeline does, and analytics name each tool in plain words. `runMetricsOf` counted a tool error only for an error result, so a refused or failed fetch (a result with `ok: false`) counted as a success while its row read failed. One rule, `callFailed(tool, result)` in the timeline's labels, now decides both. The label registry also keeps a tool's display name (`registerLabel(tool, label, fold?, { name })`, read with `nameOf`), and serve's `GET /v2/stats` sends it as `label` beside each `tools` row's `tool` (`stats/3`). The console shows the label, with the name the tool was called by as its title, so `monid_discover`, the browser's `run`, `browser_release` and `submit` read "Search monid's catalog", "Open or act on a page in the browser", "Release the browser session" and "Submit the answer". monid's tools also get timeline labels of their own.
497
+ - A run's timeline names a file by its path in the run's workspace (`Wrote hello.md`, `Saved hello.md`), even when the call named it by an absolute path there, as the Claude CLI does. Before, a claude-agent run's write rows read `Wrote <data>/runs/<id>/work/hello.md`. A path outside the run's directory stays as the call gave it, and the call's arguments, its input preview and what the store keeps are unchanged.
498
+ - `@parcha/pi-durable-agent`: `TimelineOptions.path`, how a row names a file path a call gave (`path`, `file_path`) or saved. Both the stored view (`timelineOf`) and the live one (`timelineReducer`) take it. Default: as given.
499
+ - `renderText` takes the same `path` option for folded calls ("Read 2 files: a.md, b.md"), and a fold spec says which of its subjects are file paths (`FoldSpec.path`; read, write and edit set it). The input preview stays the call's own.
500
+ - serve names a row's file as a whole path against the run's `work/`, by `path.relative`: relative to it inside the run's directory (`hello.md`, `../work 2024/a.md`), and exactly as given elsewhere.
501
+ - `GET /v2/settings/tool-keys` lists in each key's `unlocks` only what this server binds, as capabilities show it: the tools of `tools`, and a decision provider of `workflows.decisions.providers` as `decisions.<id>`; `harnesses` is the union of those tools' harnesses. The Parallel key no longer promises `web_search`; a name in the key table shows once the server binds it, as the monid tools do on pi.
502
+ - A run now ends on the record its turn writes as it ends, never on the order of its timeline rows or on when its door last read idle. On pi that record is the settlement of the person's message, which pi-durable writes in the commit of the turn's answer. On claude-agent and codex it is the bridge's turn end, now written in the commit of the turn's last entries, naming the message it took and the entry of its answer. A message the run took stays open until its turn's end closes it, so a follow-up queued behind a turn keeps the run open after a crash and a server restart too.
503
+
504
+ What this changes:
505
+ - A turn that ends showing no text completes the run with `result.final_answer` `""`, never an earlier turn's answer. That covers a pi stop with only a thinking block or no content, a Claude `/compact`, a cost-only request, and two parallel calls that fail before the turn stops. Before, some of these runs read `working` until they were cancelled.
506
+ - A turn the harness ends interrupted on its own, with no stop or cancel asked for, leaves the run `input_required`: it waits for the next message instead of reading `working` for good.
507
+ - A run's first terminal status is its last. An agentic run reads `cancelled` from the cancel's 202 on, and nothing its cut turn writes later, an answer or a cost over its cap, moves it to `completed` or `failed`. A server that took the cancel and went down before it carried the run's end back leaves the next server to end it `cancelled` too.
508
+ - A claude-agent or codex turn whose process died before its end was written ends as the run's records show it on the next open: failed when its error is there, completed when its answer is, and otherwise interrupted, so the run waits for the person (`input_required`) instead of completing with `""`.
509
+ - A run's status is its last turn's end: a turn that fails with a message queued behind it leaves the run open, and when the queued turn completes the run completes with its answer, the failed turn kept in its timeline.
510
+ - A server restart that drains a claude-agent or codex turn mid-way no longer reads that turn as stopped: the next process resumes it, and the messages that were waiting are sent then. pi-durable-disk's door tells its hook why an abort comes (`reason`: `request` or `stop`).
511
+ - `GET /runs/{id}` has `last_progress_at`: while a message is open, when its turn last wrote anything, so a run working through a long tool phase shows whether it is moving.
512
+ - pi-durable-disk's door `GET /events?inputs=1` adds `inputs` to its snapshot: pi's input submissions from the newest settled one on, so a server adopting a live pi run knows how its newest turn ended. Without the parameter the stream is as before.
513
+
514
+ No agentic run ends on its rows any more. A run whose records hold no turn end, an import or a workflow, still reads its answer from its rows as before. A claude-agent or codex message an older server sent and wrote no end for is closed by the run's next process, which writes that turn's end as it opens; until then a live process of an older server keeps its run open.
515
+ - `web_fetch` fetches a page once a run. The first call for a URL reads the page, through Parallel's extract or the direct fetch, and the run keeps what it read of its last 8 pages, by the URL asked for: every later part of that URL comes from it, with no request. Through Parallel, each part used to be one more billed extract, asked for the page's text up to that part's end with no ceiling. Now a page costs one extract a run, asked for its first 1,000,001 characters, and its parts never mix the two providers' text. A page is read to its first 1,000,000 characters from either provider. An `offset` at or past them is refused before anything is fetched, and the last part a read reaches of a longer page has `beyond_read`. A page's links left out past their caps are counted, `links_omitted`.
516
+ - On OpenRouter (OPENROUTER_API_KEY alone, or a model named `openrouter/<vendor>/...`), `web_search` on `auto` no longer picks Codex's own search, which OpenRouter does not run: a codex agent searches through Parallel on the server's key, else keyless Exa, and every model request is priced. A pick of `native` there resolves `unavailable: no native search for codex on OpenRouter` (likewise for claude-agent), saying why.
517
+ - **serve's box archive test writes a later box's record only once the start sweep has marked the old one**
518
+ - The test wrote the later record right after a `GET /runs`, which is answered while the start sweep still settles. A sweep still inside its reap of the old record then wrote that record's reaped mark over the new one, so the archive found a record already let go and reaped nothing.
519
+ - It now waits for the sweep's mark on disk before writing the later record, as a run process would (no run starts before the sweep is done), and checks that the record the archive marks is the later box's own.
520
+ - Two launcher tests in `secret-custody.test.mjs` read what the launcher said once its process ends on `close`, not `exit`. `exit` can come before the child's stderr pipe is read to its end, so the refusal of secrets past a pipe's 4096 bytes could read as an empty string and fail the test intermittently.
521
+ - serve's recovery tests wait on what they wait for, not on a count of polls. A server started in a process of its own is ready when it prints its banner (its address and key lines), and one that exits before that fails the test at once with what it printed; a run is working, adopted or stopped when its timeline, long-polled, says so, and one that ends in another status fails the test at once. Before, both waits gave up after a fixed number of 50 ms polls (about 10 s for a server, about 15 s for a run), which a slow start on a loaded machine could pass, failing a test whose behaviour was right.
522
+ - Code that was written more than once in serve and the timeline now has one copy, with no change to any request, answer or message:
523
+ - serve builds the test switches a run's process gets once, at start, instead of passing each one through the run manager as a separate option. `startServe`'s options are unchanged.
524
+ - One helper builds the "The body keeps no field" refusal that 8 routes wrote by hand; one per-key queue serves both uploads' commits and the learning folder; one wait-until-deadline serves both waits in a run's start; the inline file types come from the same table as the file types; the install hint for a harness that cannot load is built in one place for claude-agent and codex; the count of a workflow run's answered llm calls is one function for its record and its cost.
525
+ - The timeline reads a tool result's text only for a tool that reads its outcome from that text.
526
+ - A recovered run with nothing learned no longer removes two paths that are not there.
527
+
528
+ One wait ends sooner, and nothing else about it changes: a stop that waits for a run's rows to catch up wakes when the rows change, not on the next 100 ms tick. It still ends at the same deadline.
529
+ - A test pins a stop across a restart of a compacted run, end to end. The run compacts and its turn is stopped, then the server closes and the next server reads the run from the compacted snapshot. The run still reads `input_required`/idle, and a follow-up then completes it. With the stop kept as a count of the messages shown, as before, the restart read the run as not stopped.
530
+ - serve's test of a workflow run ending while another connection holds the agent store now decides when the run ends. Its model node answers once the test makes a file, which the test does after it takes the hold, and the test lets the store go once the run's end has been refused 21 times, 100 ms apart: more than a request's 2 s wait. Before, the run ended on the faux model's 1.5 s timer and the store was held for a fixed 4.5 s from whenever the timeline first said `working`. On a loaded machine the run's end could come after the hold was let go, so the test failed although the server behaved right.
531
+ - serve's cost, cap and harness tests drop the cases another test already runs on the same path, and the ones that waited on a clock now wait on the run's own state. `request-start.test.mjs` goes: the capped stop in `cap-unknown.test.mjs` now also checks that the stopped request is counted (two requests, cost unknown), and `spend-cap.test.mjs`'s cancel checks the same for a run with no cap. Four `spend-cap.test.mjs` cases go into the ones that run the same refusal or read: the $0 of a run refused before its first request is checked on the final-refusal case, the $0 of a run whose first request is out on the cancel case, and every `/usage` line being a number on the unpriced case; the earlier-spend refusal was already run, with more checks, in `cap-unknown.test.mjs`. The claude-agent rows of `harness-cap`, `harness-cancel` and `harness-multi-tool` go, since under the faux harness the two ids run one path and the codex rows stay. Waits that slept or bounded a wall clock now wait on state: the steered capped run answers once a file exists, made after the steer is in; the late-booking cases and the refusal backstop run on mocked timers; the door cases wait on what the adapter was sent and on the door going idle; the resumed llm call waits for its node's end in the node log. `markRequests` loses its `refusalWaitMs` option, which only a test passed: the backstop stays a minute. A capped claude-agent run on a $0 model now checks that each request was held at $0, and two asserts that only checked an export went.
532
+ - serve's workflow, decision, store, file and box tests drop the ones that replayed a sibling's setup to check one more field, and keep each check inside the test that already proves the same contract. 20 tests go, and what each one checked moved into its keeper first.
533
+
534
+ - Decisions: Jev's request and receipt are checked in the estimate-pricing test, the no-key save warning and 409 in the test that checks the 409 against the served document, every capability reason and the Parallel-only server in the capabilities test, and the route's timeline row in the judge's timeline test. The receipt-provider test is gone because the Parallel-and-Jev test already checks both providers.
535
+ - An escalated run's `state` (idle), its missing output, its review against the served schema and the 501 on a message are checked in `workflow.test.mjs`'s escalation test. A plain run's `review: null` is checked in the happy-path test.
536
+ - PUT definition's two bodies are checked in `openapi.test.mjs`'s changed-operations test. The agentic-agent commit race runs in `store-busy.test.mjs`'s held-commit test, which now holds commits of any kind. A healthy volume's restart is checked in `upgrade.test.mjs`'s already-started-volume test.
537
+ - Files: the U+2060 and U+034F segments are checked by the home routes, a directory link by the run-files test, and a link inside work/ by the walk's refusal test. `file_ids: []` is checked in the file_ids refusal test. A box record's 0600 rides on the uploads and tool-keys keepers, both now run under umask 022.
538
+ - Box sweep: a record with no writer is checked through `settleBox`, and an agent archive's teardown in the archive-scope test. The cgroup-reap test went because it only checked what its scripted host returned.
539
+
540
+ Tests that passed without testing anything now check the real thing. The pause test waits for the run's live view before it checks that nothing started, not for 3 s, and drops a check on a file nothing writes. The mid-map pause test waits until every sent decision has its receipt, not for 3.5 s. The OpenRouter judge test checks the receipt's provider and model and the key the request carried. The workflow-agent test lists a run with its kind. Two store-busy tests let go of the store once the run's end has met it, not after a fixed sleep. The upload test checks that a message during the copy is answered "still being copied" with no process started. The box-sweep ordering tests fail at once when a run is answered or spawned while the sweep holds its reap. The /proc start-time test checks the field against the boot time and the process's uptime.
541
+
542
+ `writerGone`, `plainSegment` and `sameEntry` are no longer exported, and the box sweep's unused `startOf` parameter is gone.
543
+ - serve's test helper `follow()` returns as soon as the run's timeline reaches the status it waits for. For a status that is not an end (`working`, `input_required`), it used to ask for one more page to confirm the status, and that long poll only answers early on a change, so each such follow waited out its whole 2 s. A page already carries the run's status and every row up to it, so the first page with nothing more to come is enough. Ends still wait for the final page. About 25 follows across the run, capacity, cap, recovery, stop, box and webhook tests are each about 2 s faster. Two tests that leaned on the extra 2 s now wait on state: the webhook test of a run adopted while it waits reads the outbox until every notice is sent, instead of sleeping 500 ms before counting ids, and the test of a reply that resolves only after its stop also checks the rows the next server reads after a restart, where the turn's process has ended, so a kept reply cannot be missed.
544
+ - When the recovery test for a stop saved before its abort reached the run fails because the follow-up never completes, its failure message now carries the run's timeline, so a one-off failure in CI can be told apart from a run that never ended.
545
+ - serve's run and lifecycle tests drop 11 tests that rebuilt a setup another test already runs, and move their checks into that test. timeline-append.test.mjs is gone: stop-compacted.test.mjs's six-message compacted run now checks that its timeline holds every message in order, plus each answer. A run whose process served and then died with its server is opened again exactly once by the next one, now checked in recovery.test.mjs's relaunch test, which replaces the same test in launch-loss.test.mjs. A released run carried back by the next server is now checked in the locked-run-store test. A torn run record is checked in the adopted-run test. A model failure's `run_failed`, message and null result are checked in the run-schema test. A follow-up after a restart is checked in the restart test of `runs.test.mjs`. The `?archived` filters and `/usage` of an archived run are checked in the first archive test. Serve's cancel mark being the one the run's guard reads is checked in the cancel-before-attach test. A reopen giving its place back to a new start is checked in the two-follow-ups test. Nothing written after close is checked in the slow-start restart test. Tests that slept so a request would reach the server first now wait for the server's own record of it: they send the request under an `Idempotency-Key` and wait until a probe under the same key reads `idempotency_mismatch`. That covers the start and the follow-ups that wait for a place, a follow-up that waits for a run's end to be written, and the follow-up and start whose run or agent is archived while they wait. The archived follow-up is now checked for 409 `not_continuable`, where before it only had to be anything but 202. The cancel-before-attach test waits for the cancel mark instead of 1.8 s of sleeps. The test of a record unreadable for over 5 s waits for the server's warning, not a fixed 6.5 s. The follow-up test no longer says "or cancelled" in its name, because `runs.test.mjs`'s cancel test checks that.
546
+ - serve's tests that start a server in a process of their own wait for the line it prints once it listens, or for its exit, never for a fixed time. The launcher tests in `secret-custody.test.mjs` and `tool-keys.test.mjs`, and the start waits in `run-metrics`, `harness-run`, `launch-loss`, `operability`, `decision-key` and `server-lock`, each polled their child's output against a clock of 10 to 120 s, so a start slowed by a loaded machine failed them as "the server did not start" though it was starting. They now share one wait in `support.mjs` that resolves on that whole line and fails at once, with what the child printed, when it exits or cannot be spawned. A 120 s backstop is left only for a child that neither prints the line nor exits.
547
+ - Three serve test areas run faster and check the same things. Eleven of the work/ read checks in `workspace-reads.test.mjs` call the workspace module straight on a scratch work/ directory, laid out as a run's, with the server's own canary file beside it. They used to start a server and finish a run first, about 7 s each on a loaded machine; now they take milliseconds. The tests that go through the file view over HTTP still use a server, and every assertion stays. The mid-map pause test in `dwf.test.mjs` uses a 300 ms fake decision instead of 1.5 s; a pause that let calls through still fails it. The retried start sweep in `box-sweep.test.mjs` uses one server and no earlier run. The start's own sweep and the first run's sweep both fail, and the next run's sweep succeeds. Locally, under load, this saves about 90 s of test time on `workspace-reads`, 9 s on the pause test and 6 s on the sweep retry.
548
+ - The two server-lock tests now spawn a process only where the test is about one. The second server, which must be refused, is still the bin in its own process: it exits 1 with its one line and leaves the data root as it was. The first and third servers run in the test's process. The crash case kills a process that only took the lock, checks that a start is refused while that process lives, then checks that the next start succeeds. Locally, under load, the two tests take about 5 s less.
549
+ - **The webhook test for a redelivery in flight no longer races the server's 15 s fetch timeout on a loaded machine**
550
+ - The test held a redelivery unanswered while it made 50 more test sends, each writing the outbox to disk twice. On a loaded machine those sends could outlast the 15 s a try waits for an answer, so the held redelivery failed as "no answer in 15 s" and the test with it.
551
+ - It now fills the attempt log first, then holds the redelivery while a single send pushes the message's first attempt out of the log. It checks the same things, and that the outbox on disk still keeps the message while its redelivery waits.
552
+ - The webhook test whose server dies under a waiting run starts that server in a process of its own, and now waits for it with the shared `printed` wait in `support.mjs`: it resolves on the server's whole `AGENTRUN_API_KEY=` line and fails at once, with what the child printed, if it exits. Before, it polled the child's output against a 20 s clock, so a start slowed by a loaded machine failed the test as "waited for the server's banner" though the server was still starting.
553
+ - Install and `npx` commands in the READMEs and docs name `@latest` instead of `@beta`. Releases publish under npm's `latest` tag, and `beta` was not moved with them: it still pointed at 0.1.0-beta.21 while `latest` was 0.1.0-beta.28, and `@parcha/pi-durable-agent`, `@parcha/pi-git-remote` and `@parcha/pi-agent-learn` had no `beta` tag at all, so their install lines failed. The harness demo's hint for a missing `@parcha/pi-transport` names `@latest` too. `@parcha/agentrun-harness` is not on npm yet (its `latest` is a placeholder), so its README says it is held and installs it from a packed tarball. The README's Render option gives measured memory: a Starter's 512 MB runs about 3 pi agents at once, and Claude Code or Codex runs want a 2 GB instance. The stranger check reads the install line as `@latest`, installs `@latest` with `--registry`, and walks the keyless examples against the registry's `latest`. The release guide drops the step that moved `beta` after a release; `beta` is kept only for older links, with the one-time command to bring it up to a release.
554
+ - A server built without its console says, at `/`, that the repository's `npm ci && npm run build` builds it, as the README now does. The README's Webhooks section says a receiver may be on your own machine or network: loopback and private-network addresses are allowed.
555
+ - The README's "Spend cap" section no longer says a capped `claude-agent` or `codex` run cut mid-request refuses its next request: those runs also continue after a cut, at the worst case the cap held, as pi runs do.
556
+ - The serve README has a sandbox in 60 seconds near its top: pull the box's image, start the server with `AGENTRUN_BOXES=docker`, make an agent whose place is a Docker box with `bash`, `write` and `read`, run it, watch its timeline, and read the file it wrote from `GET /v2/runs/{id}/files`, with a no-key variant on a three-line faux model. The root README points to it.
557
+ - The sandbox text is one section: the place, the boxes, a run in a Docker box, the box's image and the published image, where it was spread over about 490 lines.
558
+ - `AGENTRUN_DOCKER_IMAGE` has its own part: the default `debian:bookworm-slim` has no python or git, and a box has no network, so it says how to pick or build an image that has them.
559
+ - It says plainly that the published image cannot host boxes yet (no docker command, no daemon), and why mounting the host's Docker socket into it is no way around that.
560
+ - The tools table lists `bash`, and the places that still said a run has no shell (the tools, a run's life, safety) say it runs only in a box.