@parcha/agentrun-serve 0.1.0-beta.54 → 0.1.0-beta.55

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 (190) hide show
  1. package/CHANGELOG.md +110 -2
  2. package/README.md +266 -88
  3. package/dist/adapters.d.ts +10 -0
  4. package/dist/adapters.js +46 -0
  5. package/dist/agent-package.d.ts +3 -3
  6. package/dist/agent-package.js +6 -13
  7. package/dist/agents-store.js +6 -5
  8. package/dist/api-only.d.ts +16 -4
  9. package/dist/api-only.js +21 -7
  10. package/dist/cli.js +5 -3
  11. package/dist/composio-made.d.ts +26 -1
  12. package/dist/composio-made.js +39 -2
  13. package/dist/composio-preset.d.ts +3 -2
  14. package/dist/composio-preset.js +46 -14
  15. package/dist/computer-held-routes.js +2 -3
  16. package/dist/computer-setting.d.ts +4 -2
  17. package/dist/computer-setting.js +0 -2
  18. package/dist/computers-running.d.ts +8 -0
  19. package/dist/computers-running.js +27 -0
  20. package/dist/console/assets/backend-D5EmB4N3.js +166 -0
  21. package/dist/console/assets/index-DUYLaqiR.js +746 -0
  22. package/dist/console/assets/index-DYhU4adm.css +1 -0
  23. package/dist/console/index.html +2 -2
  24. package/dist/docker-host-addresses.d.ts +23 -3
  25. package/dist/docker-host-addresses.js +90 -18
  26. package/dist/exa-keyless.d.ts +2 -3
  27. package/dist/exa-keyless.js +43 -127
  28. package/dist/firecrawl-keyless.d.ts +41 -0
  29. package/dist/firecrawl-keyless.js +152 -0
  30. package/dist/handed-secret.d.ts +3 -1
  31. package/dist/handed-secret.js +4 -2
  32. package/dist/harness-keys.d.ts +98 -0
  33. package/dist/harness-keys.js +247 -0
  34. package/dist/harness-recipe-entry.d.ts +14 -9
  35. package/dist/harness-recipe-entry.js +25 -14
  36. package/dist/harness-table.d.ts +16 -1
  37. package/dist/harness-table.js +19 -7
  38. package/dist/harness.d.ts +4 -0
  39. package/dist/harness.js +12 -1
  40. package/dist/host-check.d.ts +2 -0
  41. package/dist/host-check.js +6 -0
  42. package/dist/import-summary.d.ts +1 -1
  43. package/dist/import-summary.js +1 -1
  44. package/dist/import.d.ts +5 -5
  45. package/dist/import.js +54 -67
  46. package/dist/keyless-mcp.d.ts +36 -0
  47. package/dist/keyless-mcp.js +127 -0
  48. package/dist/learn/audit.d.ts +3 -3
  49. package/dist/learn/audit.js +3 -3
  50. package/dist/learn/commit.d.ts +8 -7
  51. package/dist/learn/commit.js +60 -20
  52. package/dist/learn/compile.d.ts +4 -3
  53. package/dist/learn/compile.js +7 -5
  54. package/dist/learn/folder.d.ts +16 -3
  55. package/dist/learn/folder.js +46 -13
  56. package/dist/learn/promote.d.ts +37 -13
  57. package/dist/learn/promote.js +112 -40
  58. package/dist/learn/secrets.js +10 -2
  59. package/dist/learning-routes.d.ts +22 -17
  60. package/dist/learning-routes.js +40 -39
  61. package/dist/learning.js +2 -2
  62. package/dist/manifest.d.ts +10 -0
  63. package/dist/manifest.js +30 -0
  64. package/dist/mcp-pin-first.d.ts +4 -2
  65. package/dist/mcp-pin-first.js +5 -2
  66. package/dist/mcp-secret-writes.d.ts +16 -7
  67. package/dist/mcp-secret-writes.js +35 -27
  68. package/dist/mcp-servers-store.d.ts +30 -6
  69. package/dist/mcp-servers-store.js +112 -28
  70. package/dist/mcp-sources.d.ts +10 -2
  71. package/dist/mcp-sources.js +9 -2
  72. package/dist/mcp-store.d.ts +13 -7
  73. package/dist/mcp-store.js +12 -9
  74. package/dist/model-form.d.ts +3 -2
  75. package/dist/model-form.js +11 -7
  76. package/dist/model.d.ts +20 -4
  77. package/dist/model.js +68 -9
  78. package/dist/native/history.d.ts +1 -1
  79. package/dist/native/history.js +2 -2
  80. package/dist/ollama-provider.d.ts +92 -0
  81. package/dist/ollama-provider.js +495 -0
  82. package/dist/openapi/agentrun-v2.openapi.json +2 -2
  83. package/dist/openapi.js +127 -37
  84. package/dist/page.d.ts +11 -3
  85. package/dist/page.js +22 -7
  86. package/dist/place-offers.d.ts +17 -1
  87. package/dist/place-offers.js +46 -5
  88. package/dist/print.js +1 -1
  89. package/dist/purged-workflow.d.ts +35 -7
  90. package/dist/purged-workflow.js +73 -26
  91. package/dist/run-computer.d.ts +2 -0
  92. package/dist/run-computer.js +2 -0
  93. package/dist/run-files.d.ts +4 -0
  94. package/dist/run-files.js +4 -0
  95. package/dist/run-keys.d.ts +2 -4
  96. package/dist/run-keys.js +6 -7
  97. package/dist/run-launch.d.ts +4 -0
  98. package/dist/run-launch.js +4 -0
  99. package/dist/run-reads-over-store.d.ts +3 -2
  100. package/dist/run-reads-over-store.js +66 -2
  101. package/dist/run-secrets.js +5 -2
  102. package/dist/runner/adapter-loop.d.ts +6 -3
  103. package/dist/runner/adapter-loop.js +34 -15
  104. package/dist/runner/adapter-run-spec.d.ts +3 -0
  105. package/dist/runner/adapter-run-spec.js +5 -3
  106. package/dist/runner/audit.js +8 -4
  107. package/dist/runner/beside.d.ts +2 -1
  108. package/dist/runner/beside.js +6 -2
  109. package/dist/runner/claim-secrets.d.ts +5 -8
  110. package/dist/runner/claim-secrets.js +6 -0
  111. package/dist/runner/cli-run-spec.d.ts +1 -1
  112. package/dist/runner/cli-run-spec.js +38 -6
  113. package/dist/runner/harness-loops.d.ts +22 -9
  114. package/dist/runner/harness-loops.js +21 -11
  115. package/dist/runner/held.d.ts +3 -0
  116. package/dist/runner/learning-end.d.ts +1 -1
  117. package/dist/runner/learning-end.js +8 -3
  118. package/dist/runner/loop-contract.d.ts +5 -4
  119. package/dist/runner/main.js +4 -2
  120. package/dist/runner/mcp-claim.d.ts +3 -0
  121. package/dist/runner/mcp-claim.js +26 -2
  122. package/dist/runner/mcp-run.d.ts +3 -0
  123. package/dist/runner/mcp-run.js +2 -1
  124. package/dist/runner/metrics.d.ts +10 -10
  125. package/dist/runner/metrics.js +19 -38
  126. package/dist/runner/model-route.d.ts +3 -0
  127. package/dist/runner/model-route.js +6 -2
  128. package/dist/runner/promotion.d.ts +15 -9
  129. package/dist/runner/promotion.js +25 -15
  130. package/dist/runner/run-child-host.js +17 -7
  131. package/dist/runner/run-child.js +3 -1
  132. package/dist/runner/sdk-loop.js +2 -0
  133. package/dist/runner/workflow-loop.d.ts +2 -2
  134. package/dist/runner/workflow-loop.js +1 -2
  135. package/dist/runner/workflow-spec.d.ts +1 -1
  136. package/dist/runner/workflow-spec.js +6 -6
  137. package/dist/sdk/check.d.ts +4 -1
  138. package/dist/sdk/check.js +2 -1
  139. package/dist/sdk/runs.d.ts +2 -2
  140. package/dist/sdk/runs.js +8 -6
  141. package/dist/secret-cut.js +2 -1
  142. package/dist/secret-writes.d.ts +3 -2
  143. package/dist/secret-writes.js +1 -1
  144. package/dist/server.d.ts +44 -8
  145. package/dist/server.js +283 -108
  146. package/dist/standard-webhooks.d.ts +11 -0
  147. package/dist/standard-webhooks.js +20 -2
  148. package/dist/store/index.d.ts +1 -1
  149. package/dist/store/schema.js +5 -2
  150. package/dist/store/sqlite/store.js +90 -34
  151. package/dist/store/store.d.ts +54 -14
  152. package/dist/store-reads/journal.d.ts +7 -2
  153. package/dist/store-reads/journal.js +9 -6
  154. package/dist/store-reads/learning.d.ts +12 -9
  155. package/dist/store-reads/learning.js +18 -24
  156. package/dist/store-view.d.ts +0 -5
  157. package/dist/store-view.js +9 -8
  158. package/dist/template-eval.d.ts +49 -4
  159. package/dist/template-eval.js +168 -45
  160. package/dist/template-import.js +4 -2
  161. package/dist/templates.d.ts +5 -3
  162. package/dist/templates.js +19 -40
  163. package/dist/timeline/labels.d.ts +2 -2
  164. package/dist/timeline/labels.js +2 -2
  165. package/dist/timeline/timeline.d.ts +2 -2
  166. package/dist/timeline/timeline.js +1 -1
  167. package/dist/tool-plane.d.ts +17 -9
  168. package/dist/tool-plane.js +38 -17
  169. package/dist/tools.js +2 -2
  170. package/dist/trigger-launch-hook.d.ts +16 -8
  171. package/dist/trigger-launch-hook.js +32 -23
  172. package/dist/trigger-targets.d.ts +18 -8
  173. package/dist/trigger-targets.js +42 -19
  174. package/dist/triggers.d.ts +85 -23
  175. package/dist/triggers.js +303 -96
  176. package/dist/web-fake.js +3 -3
  177. package/dist/web-fetch-direct.d.ts +4 -0
  178. package/dist/web-fetch-direct.js +8 -1
  179. package/dist/web-fetch.d.ts +12 -3
  180. package/dist/web-fetch.js +47 -14
  181. package/dist/web-search.d.ts +33 -4
  182. package/dist/web-search.js +100 -41
  183. package/dist/webhooks.js +4 -5
  184. package/launcher/agentrun-serve +5 -1
  185. package/package.json +17 -13
  186. package/templates/README.md +2 -2
  187. package/dist/console/assets/index-B_85An2t.js +0 -745
  188. package/dist/console/assets/index-n1YsbnYh.css +0 -1
  189. package/dist/import-sources.d.ts +0 -116
  190. package/dist/import-sources.js +0 -693
package/README.md CHANGED
@@ -857,12 +857,24 @@ paths and addresses) ran without it.
857
857
  whether this server offers it now, the tools it brings, and each provider with its key names and whether each is saved
858
858
  (never a value). `PUT /v2/computers/{provider}/keys` saves a provider's keys, sealed under the server's seal key, from
859
859
  the owner's signed-in session only (the API token is 403), and `POST /v2/computers/{provider}/test` makes one read at
860
- the provider with them and starts nothing. A key set in the server's environment wins over the saved one. The keys are
860
+ the provider with them and starts nothing. A key set in the server's environment wins over the saved one.
861
+ `GET /v2/computers/running` lists the computers up now: one row for each run still going (queued, working, paused or
862
+ waiting on its person) whose agent has a computer, with the run's id, agent, title, status and state and its `computer`
863
+ as `GET /v2/runs/{run_id}` carries it (`starting`, `ready`, or `taken_over` while its owner drives it, and a held
864
+ run's hold), newest first. The runs list carries no computer, so this is the one read for every running computer
865
+ across runs and agents; the console's Settings → Computers shows it as Running now. An agent's own computer kept
866
+ between runs is on the agent's read (`own_computer`), and a paired computer under `paired` in `GET /v2/computers`. The keys are
861
867
  `DAYTONA_API_KEY` (with `DAYTONA_API_URL` and `DAYTONA_TARGET` optional), `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET`,
862
868
  `E2B_API_KEY`, `AGENT37_API_KEY` and `AGENT37_SSH_KEY`, `MORPH_API_KEY`, `ORGO_API_KEY`, `PHONE_HARNESS_API_KEY`,
863
869
  `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, `KERNEL_API_KEY`, `BOXD_API_KEY` (with `BOXD_ORG` and
864
870
  `BOXD_REGION` optional), `SMOLCLOUD_API_KEY`, `GROUNDBOX_API_KEY`, `CLOUDFLARE_RELAY_URL` and `CLOUDFLARE_RELAY_TOKEN` (the relay Worker's,
865
871
  `packages/computer/relays/cloudflare`), and `FLY_API_TOKEN` and `FLY_APP`; Docker takes none.
872
+ `GET /v2/computers/running` lists every run still going (queued, working, paused or waiting on its person) whose agent
873
+ has a computer, newest first, each as `GET /v2/runs/{run_id}` answers it: its `computer` says the kind and provider,
874
+ `starting`, `ready` or `taken_over` while its owner drives it, and a held run's hold. The runs list carries no
875
+ computer, so this is the one read of the computers up across runs and agents; the console's Settings → Computers shows
876
+ it as Running now. An agent's own computer kept between runs is on the agent's read (`own_computer`), and a paired
877
+ computer under `paired` in `GET /v2/computers`.
866
878
  The vendors bill their computers by time on their own pages: this server meters no
867
879
  computer time. The older [`place`](#place) is this setting's v2 view: `{"mode": "runner"}` is kind `none`, and
868
880
  `{"mode": "sandbox", "box": X}` is a sandbox on provider X. Writing either sets both.
@@ -1211,7 +1223,8 @@ An agentic revision names its model as `provider/model-id` (`"model"` in its def
1211
1223
  this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's key, the server's own or saved as a
1212
1224
  [tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
1213
1225
  `openai/gpt-6.1-sol` with `OPENAI_API_KEY`, `particle/particle-1` with `PARTICLE_API_KEY`, then
1214
- `openrouter/openai/gpt-6.1-sol` with `OPENROUTER_API_KEY`. Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
1226
+ `openrouter/openai/gpt-6.1-sol` with `OPENROUTER_API_KEY`. With none of those, pi's default is the first model of this
1227
+ machine's Ollama that calls tools ([below](#on-this-machines-ollama)). Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
1215
1228
  claude-agent takes the Anthropic one and codex the OpenAI one. A workflow revision names no model: each model node names a tier (`fast`, `default`
1216
1229
  or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
1217
1230
  to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
@@ -1361,9 +1374,8 @@ Custody, as for a per_run MCP server's `mcp_auth`:
1361
1374
  keeps failing, the message waits untaken and is delivered again, never run on the key held before it or the
1362
1375
  server's. A stop or cancel sent after it still reaches the run. A message without one keeps the key the run holds.
1363
1376
 
1364
- **The revoke-at-turn-end contract.** The write that ends a run's turn erases its key from the store (the runner's
1365
- redactor keeps the value in memory to cut it), and the run reports the turn
1366
- ended (`run.ended`, the run's `completed`, `failed` or `stopped` status) only after that write. Every model request
1377
+ **The revoke-at-turn-end contract.** The write that ends a run's turn erases its key from the store, and the run
1378
+ reports the turn ended (`run.ended`, the run's `completed`, `failed` or `stopped` status) only after that write. Every model request
1367
1379
  tied to the turn finishes before then: the job, its subagents, its learned workflows' nodes, its end-of-run compile
1368
1380
  turn. So a caller may revoke the key as soon as it sees the turn end, and no request of that run will
1369
1381
  answer 401 for it. Model spend that would run after the turn ends is never sent on the run's key or the server's:
@@ -1395,13 +1407,13 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
1395
1407
 
1396
1408
  - A name that is not a tool key, or one no tool of the run's revision reads (its tools, its workflow's nodes and
1397
1409
  decision providers, and the keys its template declares), is 422 at `keys.<NAME>`, the value never echoed. So is a
1398
- value that is not text of 8 or more characters with no space or control character (`invalid`): the runner could
1410
+ value that is not 8 or more characters of visible ASCII (`invalid`), as a header carries it: the runner could
1399
1411
  not cut a shorter one from what the run writes.
1400
1412
  - The keys are taken out of the body before anything reads it, as `model_key` is: never in the run's saved body, its
1401
1413
  timeline, its view, a log or an `Idempotency-Key`'s fingerprint. They are sealed with the run's launch, opened at
1402
- each claim for its tools alone, and erased from the store by the write that ends its turn; the runner's redactor
1403
- keeps each value in memory to cut it. Since no read after that could cut them, the runner cuts them from everything
1404
- the run writes, as it writes it.
1414
+ each claim for its tools alone, and erased from the store by the write that ends its turn. Since no read after that
1415
+ could cut them, the runner cuts them from everything the run writes, as it writes it. To cut them, the runner's
1416
+ redactor keeps each value in memory for as long as the runner runs, as it does a run's `model_key`.
1405
1417
  - A message's `keys` replace the run's in the message's own write, read from the run's next claim on; a turn still
1406
1418
  going keeps the keys it opened. `keys: {}` leaves the run none. A message without them keeps the run's, which are
1407
1419
  none once its last turn ended.
@@ -1410,15 +1422,21 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
1410
1422
  hold (409, as before). With `1`, a template's apply makes its agent though a tool key it declares is not set here, with
1411
1423
  a warning, and each run of that agent must bring the key in `keys`: without it, the run is 409 `agent_not_runnable` at
1412
1424
  `keys.<NAME>` before anything is made, and so is a message that would start a turn. Keys the server holds are still
1413
- used by runs that bring none. A trigger's firing brings no keys, so no trigger is made whose firings would start or
1414
- message such runs without them: the apply skips the template's triggers with a warning at `triggers.<N>`
1415
- (`not_set_up_here`, the apply still 201), unless the [launch hook](#launch-hook) is set, which hands each firing to
1416
- your backend to start the run with its keys; `POST /v2/triggers`, or a `PATCH` that moves a trigger, is 409
1417
- `agent_not_runnable` naming the keys for a trigger that would start runs of the agent with no hook, or message one of
1418
- its runs, hook or not. `MONID_API_KEY` stays the server's even with
1419
- the setting on: an agent's monid tools are checked with it when the agent is saved, before any run, so a template that
1420
- grants them is still refused at its apply (409 at `secrets.MONID_API_KEY`) where the server has none. A run can still
1421
- bring its own monid key to use in place of the server's.
1425
+ used by runs that bring none.
1426
+
1427
+ A trigger's firing brings no keys, so no trigger is made whose firings would start or message such runs without them.
1428
+ The apply skips the template's triggers with a warning at `triggers.<N>` (`not_set_up_here`, the apply still 201),
1429
+ unless the [launch hook](#launch-hook) is set, which hands each firing to your backend to start the run with its keys.
1430
+ `POST /v2/triggers`, or a `PATCH` that moves a trigger, is 409 `agent_not_runnable` naming the keys for a trigger that
1431
+ would start runs of the agent with no hook, or message one of its runs, hook or not. A `message_run` trigger made
1432
+ before the setting was on, or while the server held the key, fails each firing with that 409 and sends nothing. An
1433
+ update apply that skips a trigger leaves the agent's trigger of that name as it was; when that one is on, it still
1434
+ fires, and the skip's warning names it and says how to turn it off.
1435
+
1436
+ `MONID_API_KEY` stays the server's even with the setting on: an agent's monid tools are checked with it when the agent
1437
+ is saved, before any run, so a template that grants them is still refused at its apply (409 at
1438
+ `secrets.MONID_API_KEY`) where the server has none. A run can still bring its own monid key to use in place of the
1439
+ server's.
1422
1440
 
1423
1441
  ### Direct Particle-1
1424
1442
 
@@ -1558,6 +1576,51 @@ it available past loopback, but a server with more than one API token still refu
1558
1576
  profile. While the mode is off, the row is gone and every route above answers `404` naming its operation. A turn-on
1559
1577
  saved earlier is dropped when the server starts, and claude-agent runs on the model keys.
1560
1578
 
1579
+ ### On this machine's Ollama
1580
+
1581
+ Start Ollama (`ollama serve`, or its app) beside your own server and it lists Ollama's models itself, with no key, no
1582
+ gateway and no restart: `GET /api/tags` for the tags, `POST /api/show` for each one's capabilities and trained context. Each chat model
1583
+ is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi, and the console names it
1584
+ `<tag> · local (Ollama)`, on a run's page too (from the run's `tokens` usage line, `provider` `ollama` and `model` the
1585
+ tag), so a run on the default says which model it ran on. An embedding model is left out. A model pulled or an Ollama started after the server shows in capabilities
1586
+ within half a minute (the listing is kept that long, and asked again behind the next answer). A down or stuck Ollama
1587
+ lists no models and slows nothing: the listing has 2 seconds in all, follows no redirect, and keeps the models shown
1588
+ before its deadline. A run never waits on the listing: one on `ollama/<tag>` asks that model's `/api/show` alone (10
1589
+ seconds), and a run on any other model, a key's default included, never asks Ollama.
1590
+
1591
+ - Where: `OLLAMA_HOST`, read as the ollama CLI reads it. Unset, 127.0.0.1:11434, but only on one owner's own server
1592
+ on their own machine, the one `--harness-sign-in` starts on: it listens on loopback with no public address, keeps the
1593
+ SQLite store, runs its runs beside it as its own user, and takes one owner and one API token. On any other server
1594
+ (shared, `--no-runner`, Postgres, API-only, more than one token), whatever answers on that machine's 11434 is no model
1595
+ of the people who start runs there, so unset means no Ollama: name it in `OLLAMA_HOST`. A host alone, or `host:port`, with no
1596
+ scheme is plain http, port 11434 when none is given; `http://` and `https://` take their own default ports. `0.0.0.0`
1597
+ and `::`, where `ollama serve` listens on every address, mean this machine (127.0.0.1 and `[::1]`). A path is kept.
1598
+ Plain http goes only to this machine (loopback); another machine takes `https://`. A refused `OLLAMA_HOST` lists no
1599
+ models, and the server's log says why once, at its start (`event=ollama_host_refused`, never the value: a user or
1600
+ password in it stays unsaid). `agentrun service install --env OLLAMA_HOST=<host:port>` gives it to the service.
1601
+ - Context: each request is Ollama's own `/api/chat`, streamed, with `options.num_ctx` the least of 65,536, the model's
1602
+ trained context (where `/api/show` names one) and `OLLAMA_CONTEXT_LENGTH` (where the server's environment sets it to a
1603
+ whole number above 0, as a person short of memory does for Ollama itself). The model's context window here is the same
1604
+ number, so pi compacts before Ollama would cut the prompt.
1605
+ - Thinking: a model whose capabilities include `thinking` has its reasoning split out by Ollama. For any other, an
1606
+ answer that opens with `<think>` has that part as thinking up to `</think>`, the split Ollama makes for a thinking
1607
+ model, so the tags never reach the answer.
1608
+ - Tools: a model whose capabilities include `tools` takes them natively. Any other takes them as text: the tools are
1609
+ described in its prompt, and a call written in its answer comes back as a real call.
1610
+ - Cost: $0, booked as a known cost. Its requests never count toward the server's [limit on free
1611
+ requests](#a-limit-on-free-requests): there is no shared quota behind them. An agent's own `max_requests` counts them,
1612
+ with its other free requests, so a run on Ollama that keeps calling tools still stops there.
1613
+ - Harness: pi alone. claude-agent, codex and opencode never list them.
1614
+ - Cloud models: an Ollama cloud model (a `-cloud` tag, with `remote_host` and `remote_model` in `/api/tags` or
1615
+ `/api/show`) runs on ollama.com, not here, so it is never listed: never local, never $0, never the default.
1616
+ - Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi runs on the first model Ollama
1617
+ lists that calls tools. Any key wins. A model without tools is pickable, never the default. Ollama lists the model
1618
+ pulled last first, so pulling one can change that default, and a saved agent that names no model follows it. Name the
1619
+ model (`ollama/<tag>`) to pin it.
1620
+
1621
+ `inkling-2-mini` (Ollama 0.40.17 or later) is the model to try first. Under `--faux` or `AGENT_MODEL_BASE_URL`, Ollama
1622
+ is never asked.
1623
+
1561
1624
  ## Tools
1562
1625
 
1563
1626
  A revision names its tools from one closed table (`src/tools.ts`): each name is how the run's process binds it and the
@@ -1733,30 +1796,34 @@ provider the user picked, optional: the agent's own (`definition.tool_settings`)
1733
1796
  (`PUT /settings/tools`); (2) the native tool, the harness's own or its model provider's hosted one (on claude-agent
1734
1797
  only where it is picked: `auto` there skips Claude's own search, an explicit `native` pick); (3) for
1735
1798
  `web_search`, Parallel, where the server holds a Parallel key (`PARALLEL_API_KEY` in its environment, or one saved on Tool
1736
- keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (4) the kernel's
1737
- keyless fallback. A revision's `tools` (and a pack's grant) names the capability, never a provider. On codex, `auto` is
1799
+ keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (4) the keyless
1800
+ fallback, Firecrawl's public MCP endpoint (for `web_search` with Exa's behind it). A revision's `tools` (and a pack's grant) names the capability, never a provider. On codex, `auto` is
1738
1801
  Codex's own search, except behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
1739
1802
  counts no searches to price) or under a spend cap (its request has no input bound, which a cap cannot
1740
- admit), where it is Parallel on the server's key, else keyless Exa. `off` turns `web_search` off: nothing is searched,
1741
- and an agent naming it is refused (`409`) until it is turned on again. A pick of `exa-keyless` is keyless Exa alone,
1742
- the key held or not.
1803
+ admit), where it is Parallel on the server's key, else keyless Firecrawl. `off` turns `web_search` off: nothing is
1804
+ searched, and an agent naming it is refused (`409`) until it is turned on again. A pick of `firecrawl-keyless` is keyless
1805
+ Firecrawl with keyless Exa behind it, and a pick of `exa-keyless` is keyless Exa alone, the key held or not.
1743
1806
  A workflow's model nodes may each run on another tier's model, so a workflow's `web_search` never searches natively:
1744
- it is Parallel on the server's key, else keyless Exa, or the provider picked, and a pick of `native` alone is
1807
+ it is Parallel on the server's key, else keyless Firecrawl, or the provider picked, and a pick of `native` alone is
1745
1808
  unavailable for a workflow.
1746
1809
 
1747
1810
  | | `claude-agent` | `codex` | pi |
1748
1811
  | --- | --- | --- | --- |
1749
- | `web_search`, `auto` (the default) | Parallel on the server's key, else keyless Exa: Claude's own WebSearch is the `native` pick | Codex's own search, each search booked; behind a gateway, on OpenRouter or under a spend cap, Parallel on the server's key, else keyless Exa, a host tool | one request to the run's own model provider with its hosted search (Anthropic, OpenAI direct); behind a gateway (`AGENT_MODEL_BASE_URL`) or on another provider, Parallel on the server's key, else keyless Exa |
1750
- | `web_search`, `native` | Claude's own WebSearch, unavailable on OpenRouter or under a spend cap | the same, unavailable behind a gateway, on OpenRouter or under a spend cap | the same, unavailable where there is none: never keyless Exa |
1812
+ | `web_search`, `auto` (the default) | Parallel on the server's key, else keyless Firecrawl: Claude's own WebSearch is the `native` pick | Codex's own search, each search booked; behind a gateway, on OpenRouter or under a spend cap, Parallel on the server's key, else keyless Firecrawl, a host tool | one request to the run's own model provider with its hosted search (Anthropic, OpenAI direct); behind a gateway (`AGENT_MODEL_BASE_URL`) or on another provider, Parallel on the server's key, else keyless Firecrawl |
1813
+ | `web_search`, `native` | Claude's own WebSearch, unavailable on OpenRouter or under a spend cap | the same, unavailable behind a gateway, on OpenRouter or under a spend cap | the same, unavailable where there is none: never a keyless search |
1751
1814
  | `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
1752
- | `web_search`, `exa-keyless` | Exa's public MCP search, a host tool | the same | the same |
1753
- | `web_fetch`, `kernel` (the default) | the guarded direct fetch | the same | the same |
1815
+ | `web_search`, `firecrawl-keyless` | Firecrawl's public MCP search, keyless Exa's behind it, a host tool | the same | the same |
1816
+ | `web_search`, `exa-keyless` | Exa's public MCP search alone, a host tool | the same | the same |
1817
+ | `web_fetch`, `auto` (the default) | the guarded direct fetch where the server holds a Parallel key, else keyless Firecrawl | the same | the same |
1818
+ | `web_fetch`, `firecrawl-keyless` | Firecrawl's public MCP scrape, the guarded direct fetch behind it: Firecrawl is sent each URL | the same | the same |
1819
+ | `web_fetch`, `kernel` | the guarded direct fetch | the same | the same |
1754
1820
  | either, `parallel` | Parallel's search and extract, host tools | the same | the same |
1755
1821
 
1756
1822
  `GET /settings/tools` answers the server's settings, `{web_search: {provider}, web_fetch: {provider}, browser: {provider}}`, the default
1757
1823
  where none is set; `PUT /settings/tools` takes the same map and replaces it (a capability it leaves out takes its
1758
1824
  default). An agent's `definition.tool_settings` has the same shape and is over the server's. A provider is one offered
1759
- for its capability (`auto`, `native`, `exa-keyless` or `parallel` for `web_search`; `kernel` or `parallel` for `web_fetch`;
1825
+ for its capability (`auto`, `native`, `firecrawl-keyless`, `exa-keyless`, `parallel` or `off` for `web_search`; `auto`,
1826
+ `firecrawl-keyless`, `kernel` or `parallel` for `web_fetch`;
1760
1827
  `auto`, `browserbase`, `kernel` or `chrome` for `browser`, [below](#tools)); an
1761
1828
  unknown capability or provider is `422`. Any tool's settings also take a `permission`, `allow`, `ask` or `deny`, which the
1762
1829
  tool gate holds every call to (an ask parks the run for the owner's approval), and an MCP tool's a `pin`, the arguments
@@ -1766,8 +1833,8 @@ settings are kept in the data directory
1766
1833
  (`tool-settings.json`, 0600, written whole and durably), not a secret, and read by every run launched from then on.
1767
1834
  `GET /capabilities` is the one tool catalog: each of the three tools there gives the providers offered (`providers`), the
1768
1835
  server's (`provider`, its default where it sets none), the built-in default (`default_provider`) and `resolves`, what it
1769
- resolves to on each harness under the server's settings and default model (`native`, `kernel`, `exa-keyless`,
1770
- `parallel`, or `unavailable: <reason>`), with `why`, keyed the same, one plain sentence for each (`Codex's own search`,
1836
+ resolves to on each harness under the server's settings and default model (`native`, `kernel`, `firecrawl-keyless`,
1837
+ `exa-keyless`, `parallel`, or `unavailable: <reason>`), with `why`, keyed the same, one plain sentence for each (`Codex's own search`,
1771
1838
  `behind a gateway Codex has no own search; your Parallel key (saved)`, where `saved` is a key saved on Tool keys and
1772
1839
  `server` one in the server's environment), both recomputed at each `PUT` and each key saved or deleted. `GET /agents/{id}` projects it onto the agent:
1773
1840
  `tools`, each tool its current revision grants in the same order, and for one with a choice the provider in force,
@@ -1787,7 +1854,8 @@ run (`409` with `details.asks`); set that tool to allow for the agent (`definiti
1787
1854
  allowed by default; catalog (`monid:<provider>/<endpoint>`) and MCP tools, which ask by default, are no call node's tools here.
1788
1855
 
1789
1856
  Upgrading: a server holding `PARALLEL_API_KEY` used to read every `web_fetch` page through Parallel's extract on its own.
1790
- Now `web_fetch` is the guarded direct fetch unless Parallel is picked; to keep the old behaviour, set
1857
+ Now `web_fetch` on `auto` is the guarded direct fetch on such a server (keyless Firecrawl on one with no Parallel key)
1858
+ unless Parallel is picked; to keep the old behaviour, set
1791
1859
  `PUT /v2/settings/tools {"web_fetch": {"provider": "parallel"}}` once (or `tool_settings` in an agent). Parallel's key reaches an agentic run only when one of its capabilities resolves to Parallel (see
1792
1860
  [Decision workflows](#decision-workflows)), and a web tool reaches Parallel only where its own capability does.
1793
1861
 
@@ -1800,11 +1868,37 @@ answer with its sources. A `pause_turn`
1800
1868
  answers what it has, and nothing is retried. It is booked as one of the run's requests: its tokens at the model's price
1801
1869
  plus $10 per 1,000 searches (Anthropic) or calls (OpenAI).
1802
1870
 
1803
- With no native search and no Parallel key, web_search falls back to Exa's public keyless MCP endpoint, a third-party
1804
- service with its own rate limits (unpublished) and its own terms (https://exa.ai/terms). To turn it off, set
1805
- `web_search` to `native` (native only) for the server (`PUT /v2/settings/tools`) or for an agent (`tool_settings`). To
1806
- search with a key instead, save a Parallel key on Tool keys (or set `PARALLEL_API_KEY`): `auto` then searches through
1807
- Parallel and bills the key.
1871
+ With no native search and no Parallel key, web_search falls back to Firecrawl's public keyless MCP endpoint, with Exa's
1872
+ behind it. Both are third-party services with their own free limits and their own terms (https://www.firecrawl.dev/terms-of-service,
1873
+ https://exa.ai/terms). To turn them off, set `web_search` to `native` (native only) for the server
1874
+ (`PUT /v2/settings/tools`) or for an agent (`tool_settings`). To search with a key instead, save a Parallel key on Tool
1875
+ keys (or set `PARALLEL_API_KEY`): `auto` then searches through Parallel and bills the key.
1876
+
1877
+ Keyless Firecrawl is one MCP exchange with Firecrawl's public endpoint (`https://mcp.firecrawl.dev/v2/mcp`), with no key,
1878
+ no Authorization header and no header of our own: `firecrawl_search` with the query and the number of results asked for,
1879
+ or `firecrawl_scrape` with the URL, for its markdown. A call ends at 30 s and is not retried: the backend behind Firecrawl
1880
+ answers it in its place. A search's 60 s are one deadline for both keyless backends: Firecrawl's 30 s leave Exa the rest,
1881
+ and no backend starts once the deadline is spent. A page Firecrawl read with a status that is not 2xx, or an answer past
1882
+ the bound (1 MiB for a search, the guarded fetch's 5 MiB for a page), is no read: the call goes to the backend behind
1883
+ Firecrawl, and where the guarded direct fetch then reads the page, the server logs why Firecrawl gave none
1884
+ (`event=web_fetch_firecrawl_failed`, never the URL). Firecrawl refuses a keyless call it will not serve with a code, and
1885
+ only the code is read, never its words or its sign-up link: `KEYLESS_QUOTA_EXHAUSTED` (its free daily limit spent), `KEYLESS_ACCESS_NOT_AVAILABLE` or
1886
+ `KEYLESS_TOOL_NOT_AVAILABLE` turn Firecrawl off for the rest of the run, and the same call goes to the backend behind it
1887
+ (keyless Exa for `web_search`, the guarded direct fetch for `web_fetch`); `KEYLESS_LIMIT_REACHED` or a `429` is a rate
1888
+ limit, and Firecrawl is held for the wait it names (60 s where it names none), with no cutoff. With Firecrawl and Exa both
1889
+ off for a run, `web_search` answers `search is unavailable for the rest of this run; answer from what you have`.
1890
+
1891
+ `web_fetch` through keyless Firecrawl sends Firecrawl each URL it reads: Firecrawl, a third party, fetches the page and
1892
+ sees the URL, its query string included, so a token in a URL's query goes to Firecrawl with it. A URL first passes the
1893
+ guard's own check, and one it refuses (a private, loopback, link-local or intranet address, a name that resolves to one,
1894
+ or a URL holding a user name or password) is refused as the guarded direct fetch refuses it, and never sent to Firecrawl,
1895
+ to Exa or to Parallel. To keep every URL on the server, pick `kernel` for `web_fetch`, or hold a Parallel key, where
1896
+ `auto` is the guarded direct fetch. A server's pick is the default only: an agent's own `tool_settings` outrank it, so an
1897
+ agent (an imported template's among them) that picks `firecrawl-keyless` or `auto` still sends its URLs to Firecrawl.
1898
+ Only a server's `deny` is absolute: set `web_fetch` to `deny` to stop every agent's fetches.
1899
+
1900
+ A `web_fetch` through keyless Firecrawl takes at most about 95 s: up to 30 s for the guard's check of the URL, 30 s for
1901
+ Firecrawl, then, where Firecrawl gives no page, the guarded fetch's 30 s and 5 s to read the page.
1808
1902
 
1809
1903
  Keyless Exa is one exchange with Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its `web_search_exa` tool, at most
1810
1904
  8 results, no key), dialled over IPv4 alone: the server looks Exa's name up for IPv4 and connects to that address, since
@@ -1818,7 +1912,7 @@ other failure Exa answers reads `Free web search failed. Exa said: "<the first s
1818
1912
  characters; Exa's own instructions (a key for its MCP URL) are never passed on.
1819
1913
 
1820
1914
  Every provider answers one shape, `{provider, query, results: [{url, title, snippet, published?}], text?}`, `provider`
1821
- naming the one that served it (`native`, `exa-keyless`, `parallel`), each snippet cut at 3,000 characters; the answer
1915
+ naming the one that served it (`native`, `firecrawl-keyless`, `exa-keyless`, `parallel`), each snippet cut at 3,000 characters; the answer
1822
1916
  the model reads ends with one line asking it to cite the URL of each result it relies on.
1823
1917
 
1824
1918
  `web_fetch` answers a Page with `via`, a part of the page at a time (`offset`, `max_chars`, as above). With Parallel
@@ -1828,7 +1922,8 @@ text, about $0.001 an extract, one a page a run) and `via` is
1828
1922
  with no content, a 5xx or not within 60 s, it is the guarded direct fetch, `via: "direct"`, with `parallel` saying why
1829
1923
  Parallel gave no page (`refused the key (401)`, `answered 503`, `timed out`, `listed the URL in errors`, `not tried:
1830
1924
  refused earlier in this run`), and the model reads a line saying so; a 401 or 403 stops Parallel for the rest of the
1831
- run. A fetch Parallel was not picked for says nothing of it. A URL passes the guard's own check before anything is sent to Parallel: a URL the guard
1925
+ run. A fetch Parallel was not picked for says nothing of it. Through keyless Firecrawl the page is Firecrawl's markdown
1926
+ and `via` is `"firecrawl-keyless"`; a refusal or failure there is the guarded direct fetch, `via: "direct"`. A URL passes the guard's own check before anything is sent to Parallel or Firecrawl: a URL the guard
1832
1927
  refuses is refused and never leaves the machine. A call stopped before its page arrived answers `ok: false` with
1833
1928
  `via: "stopped"`: no page came for it (the run's read of the URL goes on for its other calls).
1834
1929
 
@@ -1853,7 +1948,7 @@ request checked meanwhile, from any branch, tool round or harness, counts it bes
1853
1948
  never pass the cap together. A workflow's `call` node naming either tool is booked the same way, under the node's own
1854
1949
  call (its execution path).
1855
1950
 
1856
- Keyless Exa, where `web_search` resolves to it, searches through Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its
1951
+ Keyless Exa, where `web_search` resolves to it or to keyless Firecrawl (behind it), searches through Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its
1857
1952
  `web_search_exa` tool), with no key. What leaves the server is
1858
1953
  the search query (cut at 200 characters) and the number of results asked for (1 to 8, 5 by default), nothing else
1859
1954
  from the run, and no key. It goes to Exa over IPv4, straight from the run's process. Exa is a third party: its free,
@@ -1863,8 +1958,8 @@ are held for the wait. Exa answers its daily count running out the same way, nam
1863
1958
  wait after a wait has passed (a 429 with Retry-After is a timed limit, and only waits), in the same run and with no search succeeding since, turns search off for the rest of that run. A search ends at 60 s, its retry
1864
1959
  included, so a call never hangs. The answer is the query and its results, each a URL, a title, a
1865
1960
  snippet of at most 3,000 characters and its date when Exa knows it, then a line asking the model to cite the URLs it
1866
- relies on. Keyless Exa is the default for a harness with no native search when the server holds no Parallel key; `off`
1867
- turns `web_search` off, keyless Exa included.
1961
+ relies on. Keyless Exa answers behind keyless Firecrawl, the default for a harness with no native search when the server
1962
+ holds no Parallel key; `off` turns `web_search` off, both included.
1868
1963
 
1869
1964
  The `browser` tool runs hosted sessions, at Browserbase or at Kernel, never a Chrome on this machine. Which one is
1870
1965
  picked like `web_search`'s provider: the agent's own (`definition.tool_settings.browser.provider`) over the server's
@@ -2198,8 +2293,8 @@ Streamable HTTP with the official MCP SDK client (`@modelcontextprotocol/client`
2198
2293
  `output_schema` and `annotations` (the server's own claims, not checked). It stores nothing. `auth` is `{type: "none"}`
2199
2294
  (or absent), `{type: "bearer", token}` (sent as `Authorization: Bearer <token>`) or `{type: "headers", headers: {Name:
2200
2295
  value}}` (up to 8). An `oauth` server is signed in to first ([below](#signing-in-with-oauth)), then previewed by name.
2201
- `url` is `https`, or `http` on loopback when the server was started with `AGENTRUN_MCP_ALLOW_LOOPBACK=1`
2202
- ([start-time switches](#start-time-switches)); without it a loopback URL is `422` on `url`, in words that name the switch.
2296
+ `url` is `https`, or `http` on loopback; a loopback URL (either scheme) is taken only on a server started with
2297
+ `AGENTRUN_MCP_ALLOW_LOOPBACK=1` ([start-time switches](#start-time-switches)).
2203
2298
 
2204
2299
  A server advertising MCP resources also lists three AgentRun-generated read operations, including when it has no
2205
2300
  tools: `agentrun_list_resources` (`resource: "list"`), `agentrun_list_resource_templates` (`resource: "templates"`)
@@ -2217,7 +2312,11 @@ preset: you give your Composio API key, a toolkit (`github`, `slack`...), the ac
2217
2312
  toolkit's list) and a server name, and the server has Composio make a managed MCP server for them, then saves it as an
2218
2313
  ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
2219
2314
  `{api_key, toolkit}` lists the actions; `PUT /v2/settings/mcp-servers/{name}/composio` `{api_key, toolkit, tools,
2220
- user_id?, auth_config_id?, price_usd?}` makes and saves the server. When the toolkit needs your account and `user_id`
2315
+ user_id?, auth_config_id?, price_usd?}` makes and saves the server. In place of `api_key`, `"api_key_env":
2316
+ "COMPOSIO_API_KEY"` reads the key from that variable, as the server and each runner were started with it, at each use and keeps no copy: the
2317
+ way an [API-only](#api-only) server's token saves one. That key is only ever sent to Composio's own origin, fixed in
2318
+ code, so a server saved so whose address is anywhere else is refused by name and sent nothing. The body names no
2319
+ address or headers (`422 not_allowed`): Composio answers the address. When the toolkit needs your account and `user_id`
2221
2320
  (default `agentrun`) has none active, the answer's `connect_url` is Composio's page to connect it; nothing here signs
2222
2321
  in. The server and its connect link are made against the toolkit's Composio-managed auth config (found, else made), or
2223
2322
  against `auth_config_id`, one you already have at Composio (your own OAuth app's, say): it is read first, and one
@@ -2252,9 +2351,8 @@ curl -X POST "$BASE/v2/agents/$AGENT/runs" -H "authorization: Bearer $TOKEN" -H
2252
2351
  (`ca_...`), and without it Composio picks the user's account for the toolkit. Each request to the server carries that
2253
2352
  user and account, the Composio key staying the server's own. The binding is kept as a `per_run` server's headers are:
2254
2353
  sealed into the run's launch, erased from the store by the write that ends the run, never on the server's row, the
2255
- run's view, its timeline, its trace or a log line, and its values are cut from whatever the run shows (the runner's
2256
- redactor keeps them in memory to cut them). A message's binding replaces the
2257
- run's for the turn it starts. A run that names no account has its calls of the server answered, unsent, that it was
2354
+ run's view, its timeline, its trace or a log line, and its values are cut from whatever the run shows. A message's
2355
+ binding replaces the run's for the turn it starts. A run that names no account has its calls of the server answered, unsent, that it was
2258
2356
  handed none, so a per-run server never calls as a default account. A malformed user or account is `422 input_invalid` at
2259
2357
  `mcp_auth.<server>.composio_user_id` or `.connected_account_id`, and so is a binding to the preset's default user
2260
2358
  `agentrun` (`not_allowed`: the user single-user preset servers call as); headers for such a server, or a binding for any
@@ -2268,8 +2366,13 @@ refused, so a host must not bind a per-run server to a `user_id` that a single-u
2268
2366
  What can go wrong, told apart:
2269
2367
 
2270
2368
  - `403 forbidden` with `details.console_url`: the API token sent, dropped or changed a credential, which only the
2271
- owner's console saves. The link opens Settings → MCP servers with the form filled in (name, URL, kind of credential,
2272
- toolkit; for a saved server, its Change form), never the credential. A URL that could hold one is left out.
2369
+ owner's console saves, or saved over or deleted a server the token did not save (the owner's, sealing a credential or
2370
+ not), which only the owner's console changes or deletes. The link opens Settings → MCP servers with the form filled in
2371
+ (name, URL, kind of credential, toolkit; for a saved server, its Change form), never the credential. A URL that could
2372
+ hold one is left out.
2373
+ - `412 precondition_failed`: the server changed while the save or delete ran (another save, a sign-in, a removal), so
2374
+ nothing was written over it: read it again and try again. An owner's save that lands while the token's save or delete
2375
+ of a server it saved is under way makes the server the owner's, and the token's is this `412`.
2273
2376
  - `422 auth_required`: the server answered 401 or 403. `details.auth` is `oauth` when it names protected-resource
2274
2377
  metadata (in its `WWW-Authenticate`, or at `/.well-known/oauth-protected-resource`), else `bearer`.
2275
2378
  - `422 not_mcp`: the URL answered, but nothing it answered was a JSON-RPC reply (a web page, a JSON API, a 404).
@@ -2327,9 +2430,8 @@ those headers, and only to the origin the server had when the run was started. T
2327
2430
  credential is sealed into the run's launch record under `AGENTRUN_SEAL_KEY` (bound to the run's id), read at each claim, so
2328
2431
  a resume, a restart or a lost lease uses it again, and erased from the store by the write that ends the run. It is never
2329
2432
  in the run's saved body, its timeline, its view, a log line or an `Idempotency-Key`'s fingerprint (a retry with a new
2330
- credential answers the first request's run), and its values are cut from whatever the run shows (the runner's redactor
2331
- keeps them in memory to cut them). `POST /v2/runs/{run_id}/messages`
2332
- takes `mcp_auth` too: it replaces the run's credentials in the message's own write, so the turn the message starts (a
2433
+ credential answers the first request's run), and its values are cut from whatever the run shows.
2434
+ `POST /v2/runs/{run_id}/messages` takes `mcp_auth` too: it replaces the run's credentials in the message's own write, so the turn the message starts (a
2333
2435
  steer into a working run from its next model request, or a follow-up that opens an ended run again) calls with them. A
2334
2436
  name that is not a saved per_run server is `422` at `mcp_auth.<server>`, and no run starts. A run handed no credential
2335
2437
  for a per_run server it calls has those calls answered, unsent, that it was handed none. `POST .../{name}/refresh` lists
@@ -2675,7 +2777,8 @@ gets a `trigger.failed` message for it (`data: {trigger_id, name, agent_id, agen
2675
2777
  auto_paused}`, its `webhook-id` made from the firing's key, so a restart never sends it twice). `agent_id` is the agent
2676
2778
  the trigger runs as, which every trigger has: a `start_run` target's agent, or the agent of the run a `message_run`
2677
2779
  target names; `agent_name` is that agent's name as the message is built, or its id when it has none. Five failed firings in a row turn the
2678
- trigger off (`disabled: {reason: "auto_paused"}`); a firing that starts its run resets the count, and so does turning
2780
+ trigger off (`disabled: {reason: "auto_paused"}`); a firing tried again (a busy server) counts once, when it fails,
2781
+ however many tries it took. A firing that starts its run resets the count, and so does turning
2679
2782
  it on again. Run now (below) works on an auto-paused trigger too, and counts toward the streak like any firing: one that
2680
2783
  starts its run resets it, one that fails adds to it. A trigger whose cron line or zone no longer reads here (after an
2681
2784
  upgrade of the cron library or of the time zone data), or whose `every_s` a hand edit of its row put out of range, is
@@ -2775,7 +2878,8 @@ tried again, a later one can start first.
2775
2878
 
2776
2879
  Such a trigger can fill the runner's places and the queue behind them, starving other triggers and the runs people
2777
2880
  start. Give it `max_active_runs` (1 to 100; `null` clears it): past that many of its runs active, a firing waits due and
2778
- is tried again, and is never skipped. It counts the runs this trigger started while they work, kept apart
2881
+ is tried again, and is never skipped. It counts the runs this trigger started while they work (with the launch hook,
2882
+ also a firing its host took, until that firing's run starts or its `start_by` passes), kept apart
2779
2883
  from its history (so a long run counts however many firings follow it) and read again at each check; a run a person
2780
2884
  opens again after it ended is that person's follow-up, not counted. Any `start_run` trigger of a pushed source (a
2781
2885
  webhook) takes it, with or without `accept`: set, each event starts its own run, never skipped behind the last, up to the
@@ -3283,7 +3387,8 @@ serves these routes alone:
3283
3387
  the backend whose inline runs made it;
3284
3388
  - the [purge of a run](#purging-a-run-or-an-agent-made-here) (`DELETE /runs/{id}`) of such an agent, for that
3285
3389
  backend: it erases one user's runs where deleting the agent, which every user's runs share, would take them all. A
3286
- run of an agent made here is refused, as every address not listed here is;
3390
+ run of an agent made here (a deploy's, below) is purged the same way, since the token may archive and delete that
3391
+ whole agent, every run of it purged;
3287
3392
  - the computer settings' two reads, for a backend to check before it launches: `GET /computers` (each provider, its
3288
3393
  key names and whether each is saved, and whether it is ready) and `GET /workspace/archil` (whether runs' folders are
3289
3394
  on Archil, and whether its account key is saved). Neither answers a key's value. Their writes, tests and key choices
@@ -3301,20 +3406,49 @@ serves these routes alone:
3301
3406
  - a deploy, for a backend that deploys agents here: a template's apply (`POST /templates/{id}/apply`, a redeploy with
3302
3407
  its `agent_id`), the agent's read (`GET /agents/{id}`), its revisions (`GET /agents/{id}/revisions`), a rollback
3303
3408
  (`POST /agents/{id}/current`), and its archive and unarchive (`POST /agents/{id}/archive`, `/unarchive`). The archive
3304
- is what its delete (`DELETE /agents/{id}`) needs first. A run here starts through the backend, on its keys and
3305
- budget, never on this server's own model key. So with the [launch hook](#launch-hook) set, the apply makes the
3306
- package's schedule and feed triggers, and each firing goes to the backend, which starts its run through the API; the
3307
- unarchive turns them on again, as no trigger route is served to. Without the hook it makes neither (`not_set_up_here`: set
3308
- the hook, or start those runs through the API). A webhook, GitHub, Composio or email trigger is never made here, hook
3409
+ is what its delete (`DELETE /agents/{id}`) needs first. With the [launch hook](#launch-hook) set, the apply makes the
3410
+ package's schedule and feed triggers, and every firing that starts a run goes to the backend, which starts it through
3411
+ the API with the keys and budget it sends, a trigger the agent had before the profile included; the unarchive turns
3412
+ them on again, as no trigger route is served to. Without the hook it makes neither (`not_set_up_here`: set the hook,
3413
+ or start those runs through the API), and a trigger the agent already had stays as it was: an enabled one still fires
3414
+ here, on this server's keys, until the agent is archived, and the skip's warning says so. A webhook, GitHub, Composio or email trigger is never made here, hook
3309
3415
  or not, since this profile refuses the hook or setting each needs (`not_an_option`). Each skipped trigger is a warning
3310
3416
  under `warnings` (`triggers.<i>`), and the dry run (`dry_run: true`) plans it as `skip` in the same words;
3417
+ - a Composio server's save (a new name, or a server the token saved) and the delete of a server the token saved, for a
3418
+ backend that grants its runs Composio tools. The token here never writes a secret, so the save keeps none:
3419
+ - a Composio server (`PUT /settings/mcp-servers/{name}/composio`) names its key with
3420
+ `"api_key_env": "COMPOSIO_API_KEY"`, never `api_key` (still `403`). The server keeps the variable's name, never its
3421
+ value, and reads the value it and each runner were started with at each use: the save's calls to Composio, each
3422
+ run's connection and the delete's. A new value takes effect once they start again with it. `COMPOSIO_API_KEY` is
3423
+ the one name taken (`422 invalid` for any other), and it must be set when the server is saved (`422 missing`). A
3424
+ run of a server whose variable is unset is refused before it starts (`409 agent_not_runnable`), naming it; it never
3425
+ runs without the server's tools. `toolkit`, `tools`, `auth_config_id`, `price_usd` and `user_id: "per_run"` work as
3426
+ they do on the full server;
3427
+ - `COMPOSIO_API_KEY` is a secret, so give it to the server and to each runner. The launcher hands it to each over a
3428
+ pipe, so neither process's environment holds it, and no run is handed it: the runner sends it only as the MCP
3429
+ header of a Composio server the run is granted a tool of, and a run granted none gets nothing of it;
3430
+ - the body names no address and no headers (`url` or `headers` is `422 not_allowed`): Composio answers the server's
3431
+ address, and the key read from the variable is only ever sent to Composio's own origin, fixed in code. A server
3432
+ whose saved address is anywhere else is refused by name wherever that key would be read (a refresh, a run's start),
3433
+ and nothing is sent;
3434
+ - a save over a saved name and a delete (`DELETE /settings/mcp-servers/{name}`) take only a server the token saved.
3435
+ One saved any other way (by the owner, sealing a credential or not) is `403` to both, it stays as it was, and
3436
+ nothing is sent to Composio. An owner's save over a server the token saved makes it the owner's once it lands (one
3437
+ refused with `412` leaves it the token's), and one that lands while the token's is under way wins: the token's is
3438
+ `412`.
3439
+
3440
+ The names route above is the listing: there is no list or read of a server's address, auth or tools here, and no
3441
+ generic save (`PUT /settings/mcp-servers/{name}`), so the token saves no server at an address or with headers of its
3442
+ own. The preview, refresh, sign-in, Composio tool listing and every other MCP settings route stay refused. On the full
3443
+ server the token's `api_key_env` is `403`, as `api_key` is: the owner's session saves a Composio server there either
3444
+ way;
3311
3445
  - a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
3312
3446
 
3313
3447
  Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
3314
3448
  `AGENTRUN_PUBLIC_URL` that opens that run's live page and socket until the run ends (API doc).
3315
3449
 
3316
3450
  Every other address is `404 not_found`, answered before the request is read further: the console at `/` and its
3317
- assets, sign-in and setup, every `/settings` route, `POST /mcp`, triggers and their
3451
+ assets, sign-in and setup, every other `/settings` route, `POST /mcp`, triggers and their
3318
3452
  `POST /hooks/{id}`, the agents list, an agent made or edited through `/agents`, the templates list and every other
3319
3453
  template route, `/openapi.json`, `/llms.txt` and a browser's live view. It has no accounts: there is no page to sign in
3320
3454
  to, so no setup code is printed. The token works as it does on every route served. Unset, `0` or `false` serve the
@@ -3339,26 +3473,65 @@ host, and this server starts no run for it:
3339
3473
 
3340
3474
  The POST carries `webhook-id` (the firing's id, the same if it is handed again), `webhook-timestamp` and
3341
3475
  `webhook-signature` as [webhooks](#webhooks) do: check them with any Standard Webhooks library before reading the
3342
- body. The host starts the run with `POST /v2/agents/{agent_id}/runs`, giving the input, its own `model_key`, `keys` and
3476
+ body.
3477
+
3478
+ The host starts the run with `POST /v2/agents/{agent_id}/runs`, giving the input, its own `model_key`, `keys` and
3343
3479
  `max_cost_usd`, and `"trigger_firing": { "trigger_id": ..., "firing_id": ... }` as it was sent, and answers 2xx within
3344
- 10 s. It can start the run before it answers or after: a firing it answered 2xx with no run yet reads `sent` with
3480
+ 10 s. That run is the firing's, as one this server started would be: it names the trigger and the firing, carries the
3481
+ trigger's title and input origin, and the firing reads `started` with it, so the trigger's overlap check and
3482
+ `max_active_runs` count it.
3483
+
3484
+ The run starts on the trigger's target, as the run this server would start for the firing:
3485
+
3486
+ - Its cap is the target's `max_cost_usd`, which the host's `max_cost_usd` may lower and never raise. A target capped at
3487
+ 0.5 runs at 0.5 when the host sends 10, and at 0.2 when the host sends 0.2. A target with no cap takes the agent's
3488
+ default in its place, which the host's may lower the same way: on an agent with a $5 default, the host's 500 runs at
3489
+ 5 and its 1 at 1.
3490
+ - Its effort is the target's when the target sets one, else the host's `effort`, else the agent's.
3491
+ - It runs on the agent's current revision and holds no computer: `revision`, `hold` or `hold_minutes` in the host's
3492
+ body is refused with 422 `not_allowed`, naming the field.
3493
+ - The rest of the host's body is taken as on any start: its `model_key`, `keys` and `mcp_auth` are sealed for the run.
3494
+ - Its input is the host's, followed by the trigger's last completed result when its source hands one on (a schedule
3495
+ does), as a run this server starts for it is.
3496
+
3497
+ The host can start the run before it answers or after. A firing it answered 2xx with no run yet reads `sent` with
3345
3498
  `start_by`, 10 minutes after that answer, takes that one start until then, and is refused with 422 `not_due` after.
3346
3499
  The 10 minutes run from the answer, not from `fired_at`, so a firing that reaches the host late (a catch-up, one that
3347
- waited on `max_active_runs`, one handed again after a restart) gets the same time; the server never hands a `sent`
3348
- firing over again. That run is
3349
- the firing's, as one this server started would be: it names the trigger and the firing, carries the trigger's title and
3350
- input origin, is capped, and the firing reads `started` with it, so the trigger's overlap check and `max_active_runs`
3351
- count it. The firing is the run's key, so a second start for the same firing answers the same run and the request
3352
- takes no `Idempotency-Key` (422 with one); a firing that is not being handed over (skipped, or one of another agent's
3353
- triggers) is refused with 422. Until its run starts, a `sent` firing is one the overlap check cannot see. Any other
3354
- answer, a redirect included (it is not followed), no answer in 10 s, or no connection, and the firing reads `skipped`
3355
- with why, unless the host started its run by then; a skip is no failure and never turns the trigger off, and the
3356
- server does not try that firing again. A firing the server's stop cuts short stays due and is handed again at the next
3357
- start, under the same `webhook-id`. A `message_run` target starts no run and is unchanged. The start prints the hook's
3358
- origin, never its path or the secret. The hook is `https`: a firing's input can carry a person's data, and the
3359
- signature proves who sent it, not that no one else read it, so plain `http` is taken only for 127.0.0.0/8, `::1` or
3360
- `localhost`. One of the two set without the other, a URL that is not https (or http to this machine) or holds a user
3361
- or password, or a secret that is not a `whsec_` one of 24 bytes or more stops the start, in words.
3500
+ waited on `max_active_runs`, one handed again after a restart) gets the same time. The server never hands a `sent`
3501
+ firing over again. Until its run starts or its `start_by` passes, it holds its trigger's room as a run in progress
3502
+ would: with `max_active_runs`, a later firing waits for that room, and without it the overlap check skips a later
3503
+ firing, naming the held one. Once `start_by` passes it holds nothing, and a waiting firing is handed. A start that
3504
+ begins by `start_by` holds the room until its run is written: when `start_by` is less than a minute away, the server
3505
+ moves it to a minute after the start began, before it writes the run. A start that fails without writing its run
3506
+ moves `start_by` back, so failed starts never extend the window.
3507
+
3508
+ The firing is the run's key, so a second start for the same firing answers the same run, also while the first is
3509
+ still writing it (202 with `idempotent-replayed: true`), and the request takes no
3510
+ `Idempotency-Key` (422 with one). A firing that is neither due nor taken by its host (failed, skipped, or one of
3511
+ another agent's triggers) is refused with 422. A due firing takes its start only while its trigger has room for it,
3512
+ by the overlap check and `max_active_runs` the server applies before it hands a firing over: one waiting on its retry
3513
+ whose place another firing's run has taken since is refused with 422 `not_due`, which says why. So is one whose place
3514
+ another firing is taking: a firing whose hook has not answered yet, or whose host's start is being written, holds the
3515
+ room as a run in progress until that is done.
3516
+
3517
+ A hook that does not take the firing is a failed try of it, as a refused run is, unless the host started its run by
3518
+ then. The firing's `error.code` is `hook_failed`, and its `reason` names the cause: the status the host answered,
3519
+ `timeout` (no answer in 10 s) or `unreachable` (no connection). No answer, no connection, a 5xx or a 429 leaves the
3520
+ firing due with `retry_at`, tried again on the trigger's backoff under the same `webhook-id`; any other answer, a
3521
+ redirect included (it is not followed), fails it at once. A firing counts once toward the trigger's failure streak,
3522
+ when it fails, however many tries it took: 5 failed firings in a row turn the trigger off, and a firing that fails
3523
+ sends `trigger.failed`. A host whose start lands while its firing waits on a retry (it answered too late) has that run
3524
+ made the firing's, `started`, while its trigger has room for it. A start that lands just as the server records the
3525
+ hook's answer keeps the firing `started` with its run: the answer doesn't set it back to `sent`, fail it or count it.
3526
+
3527
+ A firing the server's stop cuts short stays due and is handed again at the next start, under the same `webhook-id`. A
3528
+ `message_run` target starts no run and is unchanged.
3529
+
3530
+ The start prints the hook's origin, never its path or the secret. The hook is `https`: a firing's input can carry a
3531
+ person's data, and the signature proves who sent it, not that no one else read it, so plain `http` is taken only for
3532
+ 127.0.0.0/8, `::1` or `localhost`. One of the two set without the other, a URL that is not https (or http to this
3533
+ machine) or holds a user or password, or a secret that is not a `whsec_` one of 24 bytes or more stops the start, in
3534
+ words.
3362
3535
 
3363
3536
  ## Uploads
3364
3537
 
@@ -3741,17 +3914,18 @@ stays in every total.
3741
3914
  (`DELETE /v2/agents/{id}/learning`) or the agent's purge, which delete the folder whole. Each merge's feedback line goes in
3742
3915
  one commit by the host (none when nothing is left to remove), a line a person edited since stays, and another
3743
3916
  merge's diff that shows the line as context is written without it. The log and a workflow's revisions leave out its
3744
- merges, known by the run the log names for each (its newest 200 changes). A purge takes each learned workflow whose
3745
- `workflow.json` the run changed last (by the commits' run trailers over the whole history, past those 200) off main
3746
- in one host commit, its whole folder: its file reads are `404`, no run lays it, and a read at an older commit
3747
- (a champion by its digest, an SDK receipt's pinned commit, a later merge's diff, which shows its files as added)
3748
- never serves its text. Each merge's scrub lands once, so a `DELETE` sent again
3917
+ merges, known by the run the log names for each (its newest 200 changes). A purge takes off main only what the run
3918
+ put there, in one host commit: each learned workflow whose `workflow.json` it wrote last (over the whole history,
3919
+ past those 200; a host commit that puts a version back names that version's run) goes back, its whole folder, to
3920
+ the version before it that no purged run wrote, so another run's champion keeps serving; one it wrote new leaves
3921
+ main, its file reads `404`. No run lays its text, and a read at an older commit (a champion by its digest, an SDK
3922
+ receipt's pinned commit, a later merge's diff, which shows its files as added) never serves it. Each merge's scrub lands once, so a `DELETE` sent again
3749
3923
  after a stop takes no other run's same line, and a merge of the run made since is scrubbed by it. A second `DELETE`
3750
3924
  does this again. It covers the learning folder on this
3751
3925
  server; a Mode 2 agent's folder on an Archil disk keeps the run's text until a learning reset or the agent's purge.
3752
3926
  - It takes the owner's session (the password sign-in, or the console on a server bound to loopback) or the API token;
3753
3927
  any other console session is `403 forbidden`, no credential `401`. An [API-only](#api-only) server purges a run of
3754
- an agent another system owns alone; a run of an agent made here is its profile's `404` there.
3928
+ any agent with its token, as it deletes or purges the whole agent.
3755
3929
 
3756
3930
  An agent made here is purged the same way once archived: `DELETE /v2/agents/{id}`. Its revisions' content, name and
3757
3931
  description, learning, triggers, saved sign-ins, own computer, disk and folders go, and each of its runs is purged.
@@ -4741,7 +4915,7 @@ A request on a free model costs $0, so no dollar cap can stop one: a free model
4741
4915
  (an OpenRouter `:free` model and the like, as `harnesses[].free_models` lists them; an OpenRouter router is none, since
4742
4916
  it bills the model it picks), with no fee beside the request. Its provider's shared daily quota is what a looping run
4743
4917
  burns. So a run has a limit on those requests: 60, or `AGENTRUN_FREE_MODEL_REQUESTS` (a whole number above 0; anything
4744
- else refuses the server's start and the runner's). ChatGPT-plan requests don't count. Capabilities'
4918
+ else refuses the server's start and the runner's). ChatGPT-plan requests and [Ollama's](#on-this-machines-ollama) don't count. Capabilities'
4745
4919
  `limits.free_model_requests` says it, and the console says "free model: up to 60 requests" beside the cap of an agent
4746
4920
  on a free model. A run may make that many; the next is not sent, and the run ends `failed` as one its
4747
4921
  cap ends, its error `spend_cap_reached`: "Not sent: this run reached its 60-request limit for free models." (the number
@@ -4751,6 +4925,9 @@ compaction, a title), and one a crash cut, which is booked at $0, a known cost;
4751
4925
  workflow's decision never count, and are never refused by it. The count is read from the run's booking records at each
4752
4926
  request, so a restart or a claim moved to another runner keeps it.
4753
4927
 
4928
+ An agent's own `max_requests` is a lower limit of the same kind, in the same words. It counts everything the server's
4929
+ limit counts and a local model's requests (Ollama's) too: the only limit a run on Ollama meets besides its turns.
4930
+
4754
4931
  ### A run paused at its cap
4755
4932
 
4756
4933
  A refusal for room (what is left of the cap cannot buy the next request's least) pauses the run instead of ending it: the
@@ -4923,8 +5100,9 @@ carries no cost at all, as from a provider that does not price the model. The te
4923
5100
  `SENTRY_DSN`, `DB_PWD`; never `PWD` or `OLDPWD`), whether the launcher's list names it or not. The rule is
4924
5101
  `keyShaped` (`src/secret-cut.ts`), which an import's cut and a harness's log take too. The keys a
4925
5102
  run needs are read from the store at its claim, opened with the seal key, and are put on that run's environment alone.
4926
- It gets none of the computer providers' account keys ([Sandbox](#sandbox)) and not the Archil account key
4927
- (`ARCHIL_API_KEY`), from which the claim mints the run's own mount credential. A tool key reaches it only when its
5103
+ It gets none of the computer providers' account keys ([Sandbox](#sandbox)), not the Archil account key
5104
+ (`ARCHIL_API_KEY`), from which the claim mints the run's own mount credential, and not the Composio account key
5105
+ (`COMPOSIO_API_KEY`), which the runner sends only as a granted Composio server's MCP header. A tool key reaches it only when its
4928
5106
  revision names a tool the key unlocks (`MONID_API_KEY` a monid tool, `BROWSERBASE_API_KEY` and `KERNEL_API_KEY` `browser`; a workflow's
4929
5107
  tools are those its model and call nodes name), and a model key only when its model needs it ([Models](#models)), read
4930
5108
  from the revision at each claim, a resume after a restart included.