@parcha/agentrun-serve 0.1.0-beta.53 → 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 (224) hide show
  1. package/CHANGELOG.md +138 -3
  2. package/README.md +346 -99
  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 +7 -14
  7. package/dist/agent-rows.d.ts +1 -1
  8. package/dist/agents-store.js +7 -6
  9. package/dist/api-only.d.ts +17 -6
  10. package/dist/api-only.js +22 -9
  11. package/dist/cli.js +11 -4
  12. package/dist/composio-made.d.ts +26 -1
  13. package/dist/composio-made.js +39 -2
  14. package/dist/composio-preset.d.ts +6 -4
  15. package/dist/composio-preset.js +50 -17
  16. package/dist/computer-held-routes.js +2 -3
  17. package/dist/computer-needs.d.ts +1 -1
  18. package/dist/computer-needs.js +1 -1
  19. package/dist/computer-setting.d.ts +8 -4
  20. package/dist/computer-setting.js +0 -2
  21. package/dist/computers-running.d.ts +8 -0
  22. package/dist/computers-running.js +27 -0
  23. package/dist/computers.d.ts +0 -2
  24. package/dist/computers.js +1 -1
  25. package/dist/console/assets/backend-D5EmB4N3.js +166 -0
  26. package/dist/console/assets/index-DUYLaqiR.js +746 -0
  27. package/dist/console/assets/index-DYhU4adm.css +1 -0
  28. package/dist/console/index.html +2 -2
  29. package/dist/docker-host-addresses.d.ts +23 -3
  30. package/dist/docker-host-addresses.js +90 -18
  31. package/dist/errors.d.ts +4 -0
  32. package/dist/errors.js +7 -0
  33. package/dist/exa-keyless.d.ts +2 -3
  34. package/dist/exa-keyless.js +43 -127
  35. package/dist/firecrawl-keyless.d.ts +41 -0
  36. package/dist/firecrawl-keyless.js +152 -0
  37. package/dist/github-connection.d.ts +50 -1
  38. package/dist/github-connection.js +96 -3
  39. package/dist/github-faux.d.ts +11 -2
  40. package/dist/github-faux.js +138 -7
  41. package/dist/github-pull-request.d.ts +37 -0
  42. package/dist/github-pull-request.js +110 -0
  43. package/dist/handed-secret.d.ts +3 -1
  44. package/dist/handed-secret.js +4 -2
  45. package/dist/harness-keys.d.ts +98 -0
  46. package/dist/harness-keys.js +247 -0
  47. package/dist/harness-recipe-entry.d.ts +14 -9
  48. package/dist/harness-recipe-entry.js +25 -14
  49. package/dist/harness-table.d.ts +16 -1
  50. package/dist/harness-table.js +19 -7
  51. package/dist/harness.d.ts +4 -0
  52. package/dist/harness.js +12 -1
  53. package/dist/host-check.d.ts +2 -0
  54. package/dist/host-check.js +6 -0
  55. package/dist/import-summary.d.ts +1 -1
  56. package/dist/import-summary.js +1 -1
  57. package/dist/import.d.ts +5 -5
  58. package/dist/import.js +54 -67
  59. package/dist/keyless-mcp.d.ts +36 -0
  60. package/dist/keyless-mcp.js +127 -0
  61. package/dist/learn/audit.d.ts +3 -3
  62. package/dist/learn/audit.js +3 -3
  63. package/dist/learn/commit.d.ts +8 -7
  64. package/dist/learn/commit.js +60 -20
  65. package/dist/learn/compile.d.ts +4 -3
  66. package/dist/learn/compile.js +7 -5
  67. package/dist/learn/folder.d.ts +16 -3
  68. package/dist/learn/folder.js +46 -13
  69. package/dist/learn/promote.d.ts +37 -13
  70. package/dist/learn/promote.js +112 -40
  71. package/dist/learn/secrets.js +10 -2
  72. package/dist/learning-routes.d.ts +22 -17
  73. package/dist/learning-routes.js +40 -39
  74. package/dist/learning.js +2 -2
  75. package/dist/live-reach.d.ts +34 -7
  76. package/dist/live-reach.js +76 -11
  77. package/dist/manifest.d.ts +10 -0
  78. package/dist/manifest.js +30 -0
  79. package/dist/mcp-pin-first.d.ts +4 -2
  80. package/dist/mcp-pin-first.js +5 -2
  81. package/dist/mcp-probe.js +2 -2
  82. package/dist/mcp-secret-writes.d.ts +16 -7
  83. package/dist/mcp-secret-writes.js +35 -27
  84. package/dist/mcp-servers-store.d.ts +30 -6
  85. package/dist/mcp-servers-store.js +112 -28
  86. package/dist/mcp-sources.d.ts +10 -2
  87. package/dist/mcp-sources.js +9 -2
  88. package/dist/mcp-store.d.ts +13 -7
  89. package/dist/mcp-store.js +12 -9
  90. package/dist/model-form.d.ts +3 -2
  91. package/dist/model-form.js +11 -7
  92. package/dist/model.d.ts +20 -4
  93. package/dist/model.js +68 -9
  94. package/dist/native/history.d.ts +1 -1
  95. package/dist/native/history.js +2 -2
  96. package/dist/ollama-provider.d.ts +92 -0
  97. package/dist/ollama-provider.js +495 -0
  98. package/dist/openapi/agentrun-v2.openapi.json +2 -2
  99. package/dist/openapi.js +235 -41
  100. package/dist/page.d.ts +11 -3
  101. package/dist/page.js +22 -7
  102. package/dist/place-offers.d.ts +17 -1
  103. package/dist/place-offers.js +46 -5
  104. package/dist/print.js +1 -1
  105. package/dist/purged-workflow.d.ts +35 -7
  106. package/dist/purged-workflow.js +73 -26
  107. package/dist/run-computer.d.ts +2 -0
  108. package/dist/run-computer.js +2 -0
  109. package/dist/run-files.d.ts +4 -0
  110. package/dist/run-files.js +4 -0
  111. package/dist/run-keys.d.ts +2 -4
  112. package/dist/run-keys.js +6 -7
  113. package/dist/run-launch.d.ts +4 -0
  114. package/dist/run-launch.js +4 -0
  115. package/dist/run-reads-over-store.d.ts +3 -2
  116. package/dist/run-reads-over-store.js +66 -2
  117. package/dist/run-secrets.js +5 -2
  118. package/dist/runner/adapter-loop.d.ts +6 -3
  119. package/dist/runner/adapter-loop.js +34 -15
  120. package/dist/runner/adapter-run-spec.d.ts +3 -0
  121. package/dist/runner/adapter-run-spec.js +6 -4
  122. package/dist/runner/audit.js +8 -4
  123. package/dist/runner/beside.d.ts +2 -1
  124. package/dist/runner/beside.js +6 -2
  125. package/dist/runner/claim-secrets.d.ts +5 -8
  126. package/dist/runner/claim-secrets.js +6 -0
  127. package/dist/runner/cli-run-spec.d.ts +1 -1
  128. package/dist/runner/cli-run-spec.js +39 -7
  129. package/dist/runner/harness-loops.d.ts +22 -9
  130. package/dist/runner/harness-loops.js +21 -11
  131. package/dist/runner/held.d.ts +3 -0
  132. package/dist/runner/learning-end.d.ts +1 -1
  133. package/dist/runner/learning-end.js +8 -3
  134. package/dist/runner/loop-contract.d.ts +5 -4
  135. package/dist/runner/main.js +4 -2
  136. package/dist/runner/mcp-claim.d.ts +3 -0
  137. package/dist/runner/mcp-claim.js +26 -2
  138. package/dist/runner/mcp-run.d.ts +3 -0
  139. package/dist/runner/mcp-run.js +2 -1
  140. package/dist/runner/metrics.d.ts +10 -8
  141. package/dist/runner/metrics.js +20 -27
  142. package/dist/runner/model-route.d.ts +3 -0
  143. package/dist/runner/model-route.js +6 -2
  144. package/dist/runner/pr-checkout.d.ts +21 -4
  145. package/dist/runner/pr-checkout.js +103 -4
  146. package/dist/runner/promotion.d.ts +15 -9
  147. package/dist/runner/promotion.js +25 -15
  148. package/dist/runner/run-child-host.js +24 -11
  149. package/dist/runner/run-child.js +3 -1
  150. package/dist/runner/runner-check.d.ts +3 -0
  151. package/dist/runner/runner-check.js +23 -0
  152. package/dist/runner/sdk-loop.js +2 -0
  153. package/dist/runner/workflow-loop.d.ts +2 -2
  154. package/dist/runner/workflow-loop.js +1 -2
  155. package/dist/runner/workflow-spec.d.ts +1 -1
  156. package/dist/runner/workflow-spec.js +6 -6
  157. package/dist/sdk/check.d.ts +4 -1
  158. package/dist/sdk/check.js +2 -1
  159. package/dist/sdk/runs.d.ts +2 -2
  160. package/dist/sdk/runs.js +8 -6
  161. package/dist/secret-cut.js +2 -1
  162. package/dist/secret-writes.d.ts +3 -2
  163. package/dist/secret-writes.js +1 -1
  164. package/dist/server.d.ts +55 -8
  165. package/dist/server.js +363 -118
  166. package/dist/standard-webhooks.d.ts +11 -0
  167. package/dist/standard-webhooks.js +20 -2
  168. package/dist/store/agent-body.d.ts +2 -2
  169. package/dist/store/agent-body.js +2 -2
  170. package/dist/store/index.d.ts +1 -1
  171. package/dist/store/schema.js +5 -2
  172. package/dist/store/sqlite/store.js +90 -34
  173. package/dist/store/store.d.ts +54 -14
  174. package/dist/store-reads/journal.d.ts +7 -2
  175. package/dist/store-reads/journal.js +9 -6
  176. package/dist/store-reads/learning.d.ts +12 -9
  177. package/dist/store-reads/learning.js +18 -24
  178. package/dist/store-view.d.ts +0 -5
  179. package/dist/store-view.js +9 -8
  180. package/dist/suggestions.d.ts +282 -0
  181. package/dist/suggestions.js +919 -0
  182. package/dist/telemetry.d.ts +8 -1
  183. package/dist/telemetry.js +12 -4
  184. package/dist/template-eval.d.ts +49 -4
  185. package/dist/template-eval.js +168 -45
  186. package/dist/template-import.d.ts +17 -0
  187. package/dist/template-import.js +36 -2
  188. package/dist/templates.d.ts +83 -76
  189. package/dist/templates.js +29 -48
  190. package/dist/timeline/labels.d.ts +2 -2
  191. package/dist/timeline/labels.js +2 -2
  192. package/dist/timeline/timeline.d.ts +2 -2
  193. package/dist/timeline/timeline.js +1 -1
  194. package/dist/tool-plane.d.ts +17 -9
  195. package/dist/tool-plane.js +38 -17
  196. package/dist/tools.js +2 -2
  197. package/dist/trigger-launch-hook.d.ts +19 -9
  198. package/dist/trigger-launch-hook.js +35 -25
  199. package/dist/trigger-targets.d.ts +18 -8
  200. package/dist/trigger-targets.js +42 -19
  201. package/dist/triggers.d.ts +85 -23
  202. package/dist/triggers.js +303 -96
  203. package/dist/validate.d.ts +1 -1
  204. package/dist/validate.js +2 -2
  205. package/dist/web-fake.js +3 -3
  206. package/dist/web-fetch-direct.d.ts +4 -0
  207. package/dist/web-fetch-direct.js +8 -1
  208. package/dist/web-fetch.d.ts +12 -3
  209. package/dist/web-fetch.js +47 -14
  210. package/dist/web-search.d.ts +33 -4
  211. package/dist/web-search.js +100 -41
  212. package/dist/webhooks.js +4 -5
  213. package/dist/workspace/synced-folder.d.ts +1 -1
  214. package/dist/workspace/synced-folder.js +11 -14
  215. package/launcher/agentrun-serve +5 -1
  216. package/package.json +17 -13
  217. package/templates/README.md +5 -4
  218. package/templates/agent-scout/agent.md +46 -0
  219. package/templates/agent-scout/skills/scout/SKILL.md +88 -0
  220. package/templates/agent-scout/skills/scout/suggestions.schema.json +112 -0
  221. package/dist/console/assets/index-BFgyZzF_.js +0 -734
  222. package/dist/console/assets/index-DbilxljH.css +0 -1
  223. package/dist/import-sources.d.ts +0 -116
  224. package/dist/import-sources.js +0 -693
package/README.md CHANGED
@@ -211,9 +211,10 @@ names no run, and a store with no such run says nothing; quiet keeps it too.
211
211
 
212
212
  ## Anonymous usage counts
213
213
 
214
- The server sends three anonymous events: `server_started`, a daily `heartbeat` and `first_run_completed`. Each holds
215
- a random id kept in the data directory (`.telemetry.json`), the version, the platform and how many runs ended as a
216
- range; never a prompt, a file, a key or a name.
214
+ The server sends six anonymous events: `server_started`, a daily `heartbeat`, `first_run_completed`, and, for
215
+ suggested agents, `suggestions_scanned`, `suggestion_discarded` and `suggested_agent_created`. Each holds a random id
216
+ kept in the data directory (`.telemetry.json`), the version, the platform and how many runs ended as a range; never a
217
+ prompt, a file, a key, a name or a repository.
217
218
  `AGENTRUN_TELEMETRY=0` or `DO_NOT_TRACK=1` turns it off, as do `CI`, a test runner (`node --test`) and `--faux`; `AGENTRUN_TELEMETRY=debug` prints each
218
219
  event on stderr and sends none. The start that first could send prints one notice and sends nothing at that start.
219
220
  [docs/telemetry.md](../../docs/telemetry.md) lists every field.
@@ -277,7 +278,7 @@ which also says dial for E2B, Daytona or Modal made with `connect: "dial"`) work
277
278
  server's public address, `AGENTRUN_PUBLIC_URL` (the image gives both processes the same environment). The machine dials
278
279
  the server, and the server relays its socket to the runner that made it: the runner keeps its own attach hub on a
279
280
  private listener (loopback; across hosts, its `AGENTRUN_RUNNER_LIVE_HOST`, which the server's `AGENTRUN_RUNNER_HOSTS`
280
- must list), and the server reaches it only with a proof under the seal key for that machine's token, that runner and a
281
+ must list; runners that are replicas with no host name of their own give both an IPv4 block instead, below), and the server reaches it only with a proof under the seal key for that machine's token, that runner and a
281
282
  time within 10 seconds, taken once. A dial it cannot relay (its runner gone, not answering, or restarted since) is
282
283
  answered 503 in words that name the run, `a dial for run <run> (machine <machine>)`, and never the machine's token. The
283
284
  runner's create, waiting for that machine, ends at once in the same words and deletes it; the run makes a new machine at
@@ -823,8 +824,8 @@ Settings → Computers. The kind says what the agent is given, and the provider
823
824
  | Kind | What the agent gets | Providers |
824
825
  |---|---|---|
825
826
  | `none` | The run's folder alone: no computer, and no provider (`{"kind": "none"}`) | |
826
- | `sandbox` | A Linux shell, with files and processes | `docker`, `daytona`, `modal`, `e2b`, `boxd`, `smolcloud`, `cloudflare` (through a relay Worker you deploy) |
827
- | `desktop` | The computer's tools (`computer_observe`, `computer_act`, `computer_screenshot`), the computer as `codemode`'s `computer`, and a shell where its provider mounts the run's folder | `docker` (with an image that has an X server), `e2b`, `orgo`, `boxd`, or [a paired computer](#a-persons-own-computer) by its id |
827
+ | `sandbox` | A Linux shell, with files and processes | `docker`, `daytona`, `modal`, `e2b`, `boxd`, `smolcloud`, `groundbox`, `cloudflare` (through a relay Worker you deploy) |
828
+ | `desktop` | The computer's tools (`computer_observe`, `computer_act`, `computer_screenshot`), the computer as `codemode`'s `computer`, and a shell where its provider mounts the run's folder | `docker` (with an image that has an X server), `e2b`, `orgo`, `boxd`, `groundbox`, or [a paired computer](#a-persons-own-computer) by its id |
828
829
  | `phone` | A rented Android, through the same computer tools | `phone-harness` |
829
830
  | `browser` | A hosted browser (the browser tools) | `browserbase`, `kernel` |
830
831
 
@@ -856,12 +857,24 @@ paths and addresses) ran without it.
856
857
  whether this server offers it now, the tools it brings, and each provider with its key names and whether each is saved
857
858
  (never a value). `PUT /v2/computers/{provider}/keys` saves a provider's keys, sealed under the server's seal key, from
858
859
  the owner's signed-in session only (the API token is 403), and `POST /v2/computers/{provider}/test` makes one read at
859
- 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
860
867
  `DAYTONA_API_KEY` (with `DAYTONA_API_URL` and `DAYTONA_TARGET` optional), `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET`,
861
868
  `E2B_API_KEY`, `AGENT37_API_KEY` and `AGENT37_SSH_KEY`, `MORPH_API_KEY`, `ORGO_API_KEY`, `PHONE_HARNESS_API_KEY`,
862
869
  `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, `KERNEL_API_KEY`, `BOXD_API_KEY` (with `BOXD_ORG` and
863
- `BOXD_REGION` optional), `SMOLCLOUD_API_KEY`, `CLOUDFLARE_RELAY_URL` and `CLOUDFLARE_RELAY_TOKEN` (the relay Worker's,
870
+ `BOXD_REGION` optional), `SMOLCLOUD_API_KEY`, `GROUNDBOX_API_KEY`, `CLOUDFLARE_RELAY_URL` and `CLOUDFLARE_RELAY_TOKEN` (the relay Worker's,
864
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`.
865
878
  The vendors bill their computers by time on their own pages: this server meters no
866
879
  computer time. The older [`place`](#place) is this setting's v2 view: `{"mode": "runner"}` is kind `none`, and
867
880
  `{"mode": "sandbox", "box": X}` is a sandbox on provider X. Writing either sets both.
@@ -1210,7 +1223,8 @@ An agentic revision names its model as `provider/model-id` (`"model"` in its def
1210
1223
  this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's key, the server's own or saved as a
1211
1224
  [tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
1212
1225
  `openai/gpt-6.1-sol` with `OPENAI_API_KEY`, `particle/particle-1` with `PARTICLE_API_KEY`, then
1213
- `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;
1214
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`
1215
1229
  or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
1216
1230
  to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
@@ -1360,9 +1374,8 @@ Custody, as for a per_run MCP server's `mcp_auth`:
1360
1374
  keeps failing, the message waits untaken and is delivered again, never run on the key held before it or the
1361
1375
  server's. A stop or cancel sent after it still reaches the run. A message without one keeps the key the run holds.
1362
1376
 
1363
- **The revoke-at-turn-end contract.** The write that ends a run's turn erases its key from the store (the runner's
1364
- redactor keeps the value in memory to cut it), and the run reports the turn
1365
- 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
1366
1379
  tied to the turn finishes before then: the job, its subagents, its learned workflows' nodes, its end-of-run compile
1367
1380
  turn. So a caller may revoke the key as soon as it sees the turn end, and no request of that run will
1368
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:
@@ -1394,13 +1407,13 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
1394
1407
 
1395
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
1396
1409
  decision providers, and the keys its template declares), is 422 at `keys.<NAME>`, the value never echoed. So is a
1397
- 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
1398
1411
  not cut a shorter one from what the run writes.
1399
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
1400
1413
  timeline, its view, a log or an `Idempotency-Key`'s fingerprint. They are sealed with the run's launch, opened at
1401
- each claim for its tools alone, and erased from the store by the write that ends its turn; the runner's redactor
1402
- keeps each value in memory to cut it. Since no read after that could cut them, the runner cuts them from everything
1403
- 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`.
1404
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
1405
1418
  going keeps the keys it opened. `keys: {}` leaves the run none. A message without them keeps the run's, which are
1406
1419
  none once its last turn ended.
@@ -1409,15 +1422,21 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
1409
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
1410
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
1411
1424
  `keys.<NAME>` before anything is made, and so is a message that would start a turn. Keys the server holds are still
1412
- used by runs that bring none. A trigger's firing brings no keys, so no trigger is made whose firings would start or
1413
- message such runs without them: the apply skips the template's triggers with a warning at `triggers.<N>`
1414
- (`not_set_up_here`, the apply still 201), unless the [launch hook](#launch-hook) is set, which hands each firing to
1415
- your backend to start the run with its keys; `POST /v2/triggers`, or a `PATCH` that moves a trigger, is 409
1416
- `agent_not_runnable` naming the keys for a trigger that would start runs of the agent with no hook, or message one of
1417
- its runs, hook or not. `MONID_API_KEY` stays the server's even with
1418
- the setting on: an agent's monid tools are checked with it when the agent is saved, before any run, so a template that
1419
- grants them is still refused at its apply (409 at `secrets.MONID_API_KEY`) where the server has none. A run can still
1420
- 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.
1421
1440
 
1422
1441
  ### Direct Particle-1
1423
1442
 
@@ -1557,6 +1576,51 @@ it available past loopback, but a server with more than one API token still refu
1557
1576
  profile. While the mode is off, the row is gone and every route above answers `404` naming its operation. A turn-on
1558
1577
  saved earlier is dropped when the server starts, and claude-agent runs on the model keys.
1559
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
+
1560
1624
  ## Tools
1561
1625
 
1562
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
@@ -1732,30 +1796,34 @@ provider the user picked, optional: the agent's own (`definition.tool_settings`)
1732
1796
  (`PUT /settings/tools`); (2) the native tool, the harness's own or its model provider's hosted one (on claude-agent
1733
1797
  only where it is picked: `auto` there skips Claude's own search, an explicit `native` pick); (3) for
1734
1798
  `web_search`, Parallel, where the server holds a Parallel key (`PARALLEL_API_KEY` in its environment, or one saved on Tool
1735
- 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
1736
- 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
1737
1801
  Codex's own search, except behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
1738
1802
  counts no searches to price) or under a spend cap (its request has no input bound, which a cap cannot
1739
- admit), where it is Parallel on the server's key, else keyless Exa. `off` turns `web_search` off: nothing is searched,
1740
- and an agent naming it is refused (`409`) until it is turned on again. A pick of `exa-keyless` is keyless Exa alone,
1741
- 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.
1742
1806
  A workflow's model nodes may each run on another tier's model, so a workflow's `web_search` never searches natively:
1743
- 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
1744
1808
  unavailable for a workflow.
1745
1809
 
1746
1810
  | | `claude-agent` | `codex` | pi |
1747
1811
  | --- | --- | --- | --- |
1748
- | `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 |
1749
- | `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 |
1750
1814
  | `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
1751
- | `web_search`, `exa-keyless` | Exa's public MCP search, a host tool | the same | the same |
1752
- | `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 |
1753
1820
  | either, `parallel` | Parallel's search and extract, host tools | the same | the same |
1754
1821
 
1755
1822
  `GET /settings/tools` answers the server's settings, `{web_search: {provider}, web_fetch: {provider}, browser: {provider}}`, the default
1756
1823
  where none is set; `PUT /settings/tools` takes the same map and replaces it (a capability it leaves out takes its
1757
1824
  default). An agent's `definition.tool_settings` has the same shape and is over the server's. A provider is one offered
1758
- 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`;
1759
1827
  `auto`, `browserbase`, `kernel` or `chrome` for `browser`, [below](#tools)); an
1760
1828
  unknown capability or provider is `422`. Any tool's settings also take a `permission`, `allow`, `ask` or `deny`, which the
1761
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
@@ -1765,8 +1833,8 @@ settings are kept in the data directory
1765
1833
  (`tool-settings.json`, 0600, written whole and durably), not a secret, and read by every run launched from then on.
1766
1834
  `GET /capabilities` is the one tool catalog: each of the three tools there gives the providers offered (`providers`), the
1767
1835
  server's (`provider`, its default where it sets none), the built-in default (`default_provider`) and `resolves`, what it
1768
- resolves to on each harness under the server's settings and default model (`native`, `kernel`, `exa-keyless`,
1769
- `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`,
1770
1838
  `behind a gateway Codex has no own search; your Parallel key (saved)`, where `saved` is a key saved on Tool keys and
1771
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:
1772
1840
  `tools`, each tool its current revision grants in the same order, and for one with a choice the provider in force,
@@ -1786,7 +1854,8 @@ run (`409` with `details.asks`); set that tool to allow for the agent (`definiti
1786
1854
  allowed by default; catalog (`monid:<provider>/<endpoint>`) and MCP tools, which ask by default, are no call node's tools here.
1787
1855
 
1788
1856
  Upgrading: a server holding `PARALLEL_API_KEY` used to read every `web_fetch` page through Parallel's extract on its own.
1789
- 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
1790
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
1791
1860
  [Decision workflows](#decision-workflows)), and a web tool reaches Parallel only where its own capability does.
1792
1861
 
@@ -1799,11 +1868,37 @@ answer with its sources. A `pause_turn`
1799
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
1800
1869
  plus $10 per 1,000 searches (Anthropic) or calls (OpenAI).
1801
1870
 
1802
- With no native search and no Parallel key, web_search falls back to Exa's public keyless MCP endpoint, a third-party
1803
- service with its own rate limits (unpublished) and its own terms (https://exa.ai/terms). To turn it off, set
1804
- `web_search` to `native` (native only) for the server (`PUT /v2/settings/tools`) or for an agent (`tool_settings`). To
1805
- search with a key instead, save a Parallel key on Tool keys (or set `PARALLEL_API_KEY`): `auto` then searches through
1806
- 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.
1807
1902
 
1808
1903
  Keyless Exa is one exchange with Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its `web_search_exa` tool, at most
1809
1904
  8 results, no key), dialled over IPv4 alone: the server looks Exa's name up for IPv4 and connects to that address, since
@@ -1817,7 +1912,7 @@ other failure Exa answers reads `Free web search failed. Exa said: "<the first s
1817
1912
  characters; Exa's own instructions (a key for its MCP URL) are never passed on.
1818
1913
 
1819
1914
  Every provider answers one shape, `{provider, query, results: [{url, title, snippet, published?}], text?}`, `provider`
1820
- 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
1821
1916
  the model reads ends with one line asking it to cite the URL of each result it relies on.
1822
1917
 
1823
1918
  `web_fetch` answers a Page with `via`, a part of the page at a time (`offset`, `max_chars`, as above). With Parallel
@@ -1827,7 +1922,8 @@ text, about $0.001 an extract, one a page a run) and `via` is
1827
1922
  with no content, a 5xx or not within 60 s, it is the guarded direct fetch, `via: "direct"`, with `parallel` saying why
1828
1923
  Parallel gave no page (`refused the key (401)`, `answered 503`, `timed out`, `listed the URL in errors`, `not tried:
1829
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
1830
- 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
1831
1927
  refuses is refused and never leaves the machine. A call stopped before its page arrived answers `ok: false` with
1832
1928
  `via: "stopped"`: no page came for it (the run's read of the URL goes on for its other calls).
1833
1929
 
@@ -1852,7 +1948,7 @@ request checked meanwhile, from any branch, tool round or harness, counts it bes
1852
1948
  never pass the cap together. A workflow's `call` node naming either tool is booked the same way, under the node's own
1853
1949
  call (its execution path).
1854
1950
 
1855
- 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
1856
1952
  `web_search_exa` tool), with no key. What leaves the server is
1857
1953
  the search query (cut at 200 characters) and the number of results asked for (1 to 8, 5 by default), nothing else
1858
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,
@@ -1862,8 +1958,8 @@ are held for the wait. Exa answers its daily count running out the same way, nam
1862
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
1863
1959
  included, so a call never hangs. The answer is the query and its results, each a URL, a title, a
1864
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
1865
- relies on. Keyless Exa is the default for a harness with no native search when the server holds no Parallel key; `off`
1866
- 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.
1867
1963
 
1868
1964
  The `browser` tool runs hosted sessions, at Browserbase or at Kernel, never a Chrome on this machine. Which one is
1869
1965
  picked like `web_search`'s provider: the agent's own (`definition.tool_settings.browser.provider`) over the server's
@@ -2197,7 +2293,8 @@ Streamable HTTP with the official MCP SDK client (`@modelcontextprotocol/client`
2197
2293
  `output_schema` and `annotations` (the server's own claims, not checked). It stores nothing. `auth` is `{type: "none"}`
2198
2294
  (or absent), `{type: "bearer", token}` (sent as `Authorization: Bearer <token>`) or `{type: "headers", headers: {Name:
2199
2295
  value}}` (up to 8). An `oauth` server is signed in to first ([below](#signing-in-with-oauth)), then previewed by name.
2200
- `url` is `https`, or `http` on loopback.
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)).
2201
2298
 
2202
2299
  A server advertising MCP resources also lists three AgentRun-generated read operations, including when it has no
2203
2300
  tools: `agentrun_list_resources` (`resource: "list"`), `agentrun_list_resource_templates` (`resource: "templates"`)
@@ -2215,7 +2312,11 @@ preset: you give your Composio API key, a toolkit (`github`, `slack`...), the ac
2215
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
2216
2313
  ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
2217
2314
  `{api_key, toolkit}` lists the actions; `PUT /v2/settings/mcp-servers/{name}/composio` `{api_key, toolkit, tools,
2218
- 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`
2219
2320
  (default `agentrun`) has none active, the answer's `connect_url` is Composio's page to connect it; nothing here signs
2220
2321
  in. The server and its connect link are made against the toolkit's Composio-managed auth config (found, else made), or
2221
2322
  against `auth_config_id`, one you already have at Composio (your own OAuth app's, say): it is read first, and one
@@ -2250,24 +2351,28 @@ curl -X POST "$BASE/v2/agents/$AGENT/runs" -H "authorization: Bearer $TOKEN" -H
2250
2351
  (`ca_...`), and without it Composio picks the user's account for the toolkit. Each request to the server carries that
2251
2352
  user and account, the Composio key staying the server's own. The binding is kept as a `per_run` server's headers are:
2252
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
2253
- run's view, its timeline, its trace or a log line, and its values are cut from whatever the run shows (the runner's
2254
- redactor keeps them in memory to cut them). A message's binding replaces the
2255
- 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
2256
2356
  handed none, so a per-run server never calls as a default account. A malformed user or account is `422 input_invalid` at
2257
2357
  `mcp_auth.<server>.composio_user_id` or `.connected_account_id`, and so is a binding to the preset's default user
2258
2358
  `agentrun` (`not_allowed`: the user single-user preset servers call as); headers for such a server, or a binding for any
2259
2359
  other server, are `422` at `mcp_auth.<server>`, and no run starts. A per-run server makes no Composio trigger: a trigger
2260
2360
  runs as one account. A server saved for one user before this mode keeps calling as that user.
2261
2361
 
2262
- With `user_id: "per_run"`, whoever can start a run chooses its Composio user, so the host (Grep, say) owns which user
2263
- each run binds: it binds each run to its own person and never takes the ids from that person. Only `agentrun` is
2362
+ With `user_id: "per_run"`, whoever can start a run chooses its Composio user, so the host owns which user each run
2363
+ binds: it binds each run to its own person and never takes the ids from that person. Only `agentrun` is
2264
2364
  refused, so a host must not bind a per-run server to a `user_id` that a single-user server calls as.
2265
2365
 
2266
2366
  What can go wrong, told apart:
2267
2367
 
2268
2368
  - `403 forbidden` with `details.console_url`: the API token sent, dropped or changed a credential, which only the
2269
- owner's console saves. The link opens Settings → MCP servers with the form filled in (name, URL, kind of credential,
2270
- 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`.
2271
2376
  - `422 auth_required`: the server answered 401 or 403. `details.auth` is `oauth` when it names protected-resource
2272
2377
  metadata (in its `WWW-Authenticate`, or at `/.well-known/oauth-protected-resource`), else `bearer`.
2273
2378
  - `422 not_mcp`: the URL answered, but nothing it answered was a JSON-RPC reply (a web page, a JSON API, a 404).
@@ -2325,9 +2430,8 @@ those headers, and only to the origin the server had when the run was started. T
2325
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
2326
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
2327
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
2328
- credential answers the first request's run), and its values are cut from whatever the run shows (the runner's redactor
2329
- keeps them in memory to cut them). `POST /v2/runs/{run_id}/messages`
2330
- 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
2331
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
2332
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
2333
2437
  for a per_run server it calls has those calls answered, unsent, that it was handed none. `POST .../{name}/refresh` lists
@@ -2673,7 +2777,8 @@ gets a `trigger.failed` message for it (`data: {trigger_id, name, agent_id, agen
2673
2777
  auto_paused}`, its `webhook-id` made from the firing's key, so a restart never sends it twice). `agent_id` is the agent
2674
2778
  the trigger runs as, which every trigger has: a `start_run` target's agent, or the agent of the run a `message_run`
2675
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
2676
- 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
2677
2782
  it on again. Run now (below) works on an auto-paused trigger too, and counts toward the streak like any firing: one that
2678
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
2679
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
@@ -2773,7 +2878,8 @@ tried again, a later one can start first.
2773
2878
 
2774
2879
  Such a trigger can fill the runner's places and the queue behind them, starving other triggers and the runs people
2775
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
2776
- 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
2777
2883
  from its history (so a long run counts however many firings follow it) and read again at each check; a run a person
2778
2884
  opens again after it ended is that person's follow-up, not counted. Any `start_run` trigger of a pushed source (a
2779
2885
  webhook) takes it, with or without `accept`: set, each event starts its own run, never skipped behind the last, up to the
@@ -2883,8 +2989,9 @@ has each instance on, and the subscription's place.
2883
2989
  ### GitHub triggers (Connect GitHub)
2884
2990
 
2885
2991
  A server has at most one GitHub App, made with GitHub's app-manifest flow, and every `github` trigger (and every
2886
- GitHub template) uses it. In the console, Connect GitHub calls `POST /v2/integrations/github/connect` (`{org?}`, to make
2887
- the App under an organization) and posts the form it answers to GitHub: `action`, GitHub's new-App page, and
2992
+ GitHub template) uses it. In the console, Connect GitHub calls `POST /v2/integrations/github/connect` (`{org?, contents?}`:
2993
+ `org` makes the App under an organization; `contents: "write"` asks for Contents write too, which suggested agents' pull
2994
+ requests need, below) and posts the form it answers to GitHub: `action`, GitHub's new-App page, and
2888
2995
  `manifest`, which names a name GitHub lets the person edit, the server's public URL, its hook `/v2/hooks/github`, its
2889
2996
  callback and setup URLs, the permissions (pull requests write; contents, metadata and issues read) and the events
2890
2997
  (`pull_request`, `issue_comment`, `release`). It needs the address GitHub can reach, `AGENTRUN_PUBLIC_URL` (`409 github_no_public_url`,
@@ -3027,6 +3134,71 @@ is outside this email's thread"). The pending approval carries the reason as `as
3027
3134
  says above the call's arguments ("Asks because ..."). With accounts off, where no one can
3028
3135
  approve, such a send is refused in those words.
3029
3136
 
3137
+ An agent whose definition says `checkout: repository` starts each run in a checkout of the repository the run names: its
3138
+ start's `repo`, else the first `https://github.com/<owner>/<repo>` in its first message (a github trigger's run, its
3139
+ payload's). The same command, token and rules as a pull request's checkout fetch the remote's `HEAD` (its default branch)
3140
+ one commit deep and check it out detached in `repo/` (ref `repo/head`), and list its files one a line in
3141
+ `repo/.git/agentrun-files`, so an agent with `read` and no shell can still find what to open. The run's system prompt
3142
+ names the repository, the branch, the commit and the list, or why there is no checkout.
3143
+
3144
+ ### Suggested agents
3145
+
3146
+ The console's Suggested agents page (`#/suggestions`) connects a GitHub repository, finds where its app needs an agent,
3147
+ and lets a person create or discard each suggestion. Every write to GitHub is the server's, made when a person presses
3148
+ Create; no run ever holds a token that can write.
3149
+
3150
+ 1. **Connect.** Connect GitHub as above. The page asks for `contents: "write"` unless the person unticks it; a scan needs
3151
+ only what every App holds (metadata and contents read). `GET /v2/integrations/github/repositories` lists what the
3152
+ App's installations cover (a metadata-read token per installation, revoked after; at most 500; an installation GitHub
3153
+ did not list is in `unread`).
3154
+ 2. **Scan.** `POST /v2/suggestions/scans` with `{repo}` (`owner/name` or its github.com URL) runs the bundled `agent-scout`
3155
+ template's agent, applied here the first time and reused: a read-only checkout of the default branch (`checkout:
3156
+ repository`), read-only bash where there is a shell, and an answer of at most five suggestions against its schema.
3157
+ Its first message lists the suggestions already decided on that repository, so none comes back. 202 with the run;
3158
+ 200 while one runs; what the apply or the start refuses is the answer (`409 agent_not_runnable` with no model key).
3159
+ A scan whose run stopped without ending (at its cost cap or asking for input, or paused) is listed as `waiting`: it is
3160
+ resumed or cancelled on its run's page, and a new scan starts a new run.
3161
+ 3. **List.** `GET /v2/suggestions` (`?repo=`, `?status=open|created|discarded|all`; open and created by default) answers
3162
+ GitHub's state, each repository's newest scan, and its suggestions. A scan that ended is read once: each suggestion is
3163
+ checked again field by field (paths inside the repository, a client path in its language's extension and outside
3164
+ `.github/`, `.git` and `.agentrun/agents/`, typed inputs and answer, answer labels that can't end a string or a
3165
+ comment), and one that fails is dropped and listed with why in `scan.dropped`. A suggestion's id comes from its
3166
+ repository and key, so a newer scan replaces the open ones of the scan before, and a decision outlives every rescan.
3167
+ Decisions are kept in the store's settings (`suggestions.item.<id>`, `suggestions.scan.<repo>`).
3168
+ 4. **Discard.** `POST /v2/suggestions/{id}/discard` hides it and keeps later scans from suggesting it again;
3169
+ `POST .../restore` brings it back (the page's Undo). A created one is `409 suggestion_decided`.
3170
+ 5. **Create.** `GET /v2/suggestions/{id}` shows the suggestion whole: the files a create adds, rendered now, whether its
3171
+ package checks, and whether the App can open its pull request now (read from GitHub: the installation that covers the
3172
+ repository and its permissions), with the App's permissions page and the installation's page when it can't.
3173
+ `POST /v2/suggestions/{id}/create` (`{name?}`) then:
3174
+ - claims the suggestion on its row in the store, which every server on that store shares: another create of it, a
3175
+ discard or a scan's answer meanwhile is `409 home_busy` or leaves the row alone, so one agent and one pull request
3176
+ are made. A claim older than 15 minutes (a server that stopped mid-create) is taken over. A scan is reserved the
3177
+ same way before its run starts;
3178
+ - refuses before anything is written: `409 github_not_connected`, `409 github_not_installed` (`details.install_url`),
3179
+ `409 github_permission_missing` when the installation lacks Contents or Pull requests write (`details.missing`,
3180
+ `permissions_url`, `installation_url`), or `409 github_file_exists` when the repository has a file it would add;
3181
+ - mints one installation token for that repository with `{contents: write, pull_requests: write, metadata: read}`,
3182
+ revoked at the end whatever happens;
3183
+ - commits, over the default branch's head on a new branch `agentrun/<key>` (GitHub's Git Data API, no clone), the
3184
+ agent's package (`.agentrun/agents/<key>/agent.md` and `output.schema.json`, rendered here from the checked fields)
3185
+ and a client at the suggestion's path (TypeScript or JavaScript over `fetch`, Python over `urllib` taking the input
3186
+ as one dict, or a Markdown page of the HTTP calls for any other language; no dependency). It only adds files;
3187
+ - keeps that package as the imported template `github:<owner>/<repo>/.agentrun/agents/<key>` at the pushed commit,
3188
+ then applies it here (an apply refused takes the package back, deletes the branch and makes nothing). The push is
3189
+ recorded on the suggestion first, so a create after a write that failed finds the agent made from that template at
3190
+ that commit and reuses it, never making a second one;
3191
+ - opens the pull request, naming the agent's id and the variables the client reads (`AGENTRUN_URL`,
3192
+ `AGENTRUN_API_KEY`, `AGENTRUN_AGENT_<KEY>`). A pull request GitHub refuses keeps the agent (`502 github_failed`,
3193
+ `details.agent_id`), and the next create opens the pull request alone. A created suggestion answers `200` as it is.
3194
+
3195
+ `--faux-github` (with `--faux`) serves the list, the checks and the create from its fake App: its installation holds
3196
+ contents write, its one repository answers the Git Data API and pull requests, `GET /_faux/state` on its API shows what a
3197
+ create wrote, and `POST /_faux/permissions` changes what the installation holds. Its repository is also a bare git
3198
+ repository beside the data, which a test's own runner checks out from. The CLI's runner is never pointed at it (a
3199
+ runner's GitHub API and site have one way in, a test runner's option), so a scan on a faux CLI server finds no repository
3200
+ to check out and is told so.
3201
+
3030
3202
  ## Templates
3031
3203
 
3032
3204
  A template package makes a working agent in one call: its definition, its skills and rules, and its triggers, from a
@@ -3037,7 +3209,8 @@ package's `version` is SemVer and never `definition.version`, the agent's revisi
3037
3209
  need's toolkit as its `server` (`server: github` for a required `{source: composio, toolkit: github}` need), and apply makes it
3038
3210
  on the saved Composio server that need maps to, its `config` filled from the parameters it names
3039
3211
  (`repo: "${parameters.repo}"`); one this server can't set up yet (no public URL, say) is skipped with a
3040
- warning, as a github trigger is with GitHub not connected. The first package is `code-review`, a code review agent for one GitHub repository. The format and the
3212
+ warning, as a github trigger is with GitHub not connected. The first package is `code-review`, a code review agent for one GitHub repository;
3213
+ `agent-scout` finds where a repository's app needs an agent ([Suggested agents](#suggested-agents)). The format and the
3041
3214
  rules of an apply are in [templates/README.md](https://github.com/Parcha-ai/agentrun/blob/main/packages/serve/templates/README.md);
3042
3215
  `agentrun template validate DIR` checks a folder as the server does.
3043
3216
 
@@ -3214,7 +3387,8 @@ serves these routes alone:
3214
3387
  the backend whose inline runs made it;
3215
3388
  - the [purge of a run](#purging-a-run-or-an-agent-made-here) (`DELETE /runs/{id}`) of such an agent, for that
3216
3389
  backend: it erases one user's runs where deleting the agent, which every user's runs share, would take them all. A
3217
- 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;
3218
3392
  - the computer settings' two reads, for a backend to check before it launches: `GET /computers` (each provider, its
3219
3393
  key names and whether each is saved, and whether it is ready) and `GET /workspace/archil` (whether runs' folders are
3220
3394
  on Archil, and whether its account key is saved). Neither answers a key's value. Their writes, tests and key choices
@@ -3232,20 +3406,49 @@ serves these routes alone:
3232
3406
  - a deploy, for a backend that deploys agents here: a template's apply (`POST /templates/{id}/apply`, a redeploy with
3233
3407
  its `agent_id`), the agent's read (`GET /agents/{id}`), its revisions (`GET /agents/{id}/revisions`), a rollback
3234
3408
  (`POST /agents/{id}/current`), and its archive and unarchive (`POST /agents/{id}/archive`, `/unarchive`). The archive
3235
- is what its delete (`DELETE /agents/{id}`) needs first. A run here starts through the backend, on its keys and
3236
- budget, never on this server's own model key. So with the [launch hook](#launch-hook) set, the apply makes the
3237
- package's schedule and feed triggers, and each firing goes to the backend, which starts its run through the API; the
3238
- unarchive turns them on again, as no trigger route is served to. Without the hook it makes neither (`not_set_up_here`: set
3239
- 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
3240
3415
  or not, since this profile refuses the hook or setting each needs (`not_an_option`). Each skipped trigger is a warning
3241
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;
3242
3445
  - a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
3243
3446
 
3244
3447
  Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
3245
3448
  `AGENTRUN_PUBLIC_URL` that opens that run's live page and socket until the run ends (API doc).
3246
3449
 
3247
3450
  Every other address is `404 not_found`, answered before the request is read further: the console at `/` and its
3248
- 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
3249
3452
  `POST /hooks/{id}`, the agents list, an agent made or edited through `/agents`, the templates list and every other
3250
3453
  template route, `/openapi.json`, `/llms.txt` and a browser's live view. It has no accounts: there is no page to sign in
3251
3454
  to, so no setup code is printed. The token works as it does on every route served. Unset, `0` or `false` serve the
@@ -3270,26 +3473,65 @@ host, and this server starts no run for it:
3270
3473
 
3271
3474
  The POST carries `webhook-id` (the firing's id, the same if it is handed again), `webhook-timestamp` and
3272
3475
  `webhook-signature` as [webhooks](#webhooks) do: check them with any Standard Webhooks library before reading the
3273
- 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
3274
3479
  `max_cost_usd`, and `"trigger_firing": { "trigger_id": ..., "firing_id": ... }` as it was sent, and answers 2xx within
3275
- 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
3276
3498
  `start_by`, 10 minutes after that answer, takes that one start until then, and is refused with 422 `not_due` after.
3277
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
3278
- waited on `max_active_runs`, one handed again after a restart) gets the same time; the server never hands a `sent`
3279
- firing over again. That run is
3280
- the firing's, as one this server started would be: it names the trigger and the firing, carries the trigger's title and
3281
- input origin, is capped, and the firing reads `started` with it, so the trigger's overlap check and `max_active_runs`
3282
- count it. The firing is the run's key, so a second start for the same firing answers the same run and the request
3283
- takes no `Idempotency-Key` (422 with one); a firing that is not being handed over (skipped, or one of another agent's
3284
- triggers) is refused with 422. Until its run starts, a `sent` firing is one the overlap check cannot see. Any other
3285
- answer, a redirect included (it is not followed), no answer in 10 s, or no connection, and the firing reads `skipped`
3286
- with why, unless the host started its run by then; a skip is no failure and never turns the trigger off, and the
3287
- server does not try that firing again. A firing the server's stop cuts short stays due and is handed again at the next
3288
- start, under the same `webhook-id`. A `message_run` target starts no run and is unchanged. The start prints the hook's
3289
- origin, never its path or the secret. The hook is `https`: a firing's input can carry a person's data, and the
3290
- 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
3291
- `localhost`. One of the two set without the other, a URL that is not https (or http to this machine) or holds a user
3292
- 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.
3293
3535
 
3294
3536
  ## Uploads
3295
3537
 
@@ -3672,17 +3914,18 @@ stays in every total.
3672
3914
  (`DELETE /v2/agents/{id}/learning`) or the agent's purge, which delete the folder whole. Each merge's feedback line goes in
3673
3915
  one commit by the host (none when nothing is left to remove), a line a person edited since stays, and another
3674
3916
  merge's diff that shows the line as context is written without it. The log and a workflow's revisions leave out its
3675
- merges, known by the run the log names for each (its newest 200 changes). A purge takes each learned workflow whose
3676
- `workflow.json` the run changed last (by the commits' run trailers over the whole history, past those 200) off main
3677
- in one host commit, its whole folder: its file reads are `404`, no run lays it, and a read at an older commit
3678
- (a champion by its digest, an SDK receipt's pinned commit, a later merge's diff, which shows its files as added)
3679
- 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
3680
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`
3681
3924
  does this again. It covers the learning folder on this
3682
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.
3683
3926
  - It takes the owner's session (the password sign-in, or the console on a server bound to loopback) or the API token;
3684
3927
  any other console session is `403 forbidden`, no credential `401`. An [API-only](#api-only) server purges a run of
3685
- 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.
3686
3929
 
3687
3930
  An agent made here is purged the same way once archived: `DELETE /v2/agents/{id}`. Its revisions' content, name and
3688
3931
  description, learning, triggers, saved sign-ins, own computer, disk and folders go, and each of its runs is purged.
@@ -4672,7 +4915,7 @@ A request on a free model costs $0, so no dollar cap can stop one: a free model
4672
4915
  (an OpenRouter `:free` model and the like, as `harnesses[].free_models` lists them; an OpenRouter router is none, since
4673
4916
  it bills the model it picks), with no fee beside the request. Its provider's shared daily quota is what a looping run
4674
4917
  burns. So a run has a limit on those requests: 60, or `AGENTRUN_FREE_MODEL_REQUESTS` (a whole number above 0; anything
4675
- 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'
4676
4919
  `limits.free_model_requests` says it, and the console says "free model: up to 60 requests" beside the cap of an agent
4677
4920
  on a free model. A run may make that many; the next is not sent, and the run ends `failed` as one its
4678
4921
  cap ends, its error `spend_cap_reached`: "Not sent: this run reached its 60-request limit for free models." (the number
@@ -4682,6 +4925,9 @@ compaction, a title), and one a crash cut, which is booked at $0, a known cost;
4682
4925
  workflow's decision never count, and are never refused by it. The count is read from the run's booking records at each
4683
4926
  request, so a restart or a claim moved to another runner keeps it.
4684
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
+
4685
4931
  ### A run paused at its cap
4686
4932
 
4687
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
@@ -4854,8 +5100,9 @@ carries no cost at all, as from a provider that does not price the model. The te
4854
5100
  `SENTRY_DSN`, `DB_PWD`; never `PWD` or `OLDPWD`), whether the launcher's list names it or not. The rule is
4855
5101
  `keyShaped` (`src/secret-cut.ts`), which an import's cut and a harness's log take too. The keys a
4856
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.
4857
- It gets none of the computer providers' account keys ([Sandbox](#sandbox)) and not the Archil account key
4858
- (`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
4859
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
4860
5107
  tools are those its model and call nodes name), and a model key only when its model needs it ([Models](#models)), read
4861
5108
  from the revision at each claim, a resume after a restart included.