@parcha/agentrun-serve 0.1.0-beta.54 → 0.1.0-beta.56
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.
- package/CHANGELOG.md +142 -2
- package/README.md +310 -98
- package/dist/adapters.d.ts +11 -0
- package/dist/adapters.js +49 -0
- package/dist/agent-package.d.ts +3 -3
- package/dist/agent-package.js +6 -13
- package/dist/agents-store.js +6 -5
- package/dist/answer-json.d.ts +6 -2
- package/dist/answer-json.js +22 -4
- package/dist/api-only.d.ts +16 -4
- package/dist/api-only.js +23 -7
- package/dist/calendar/tools.js +3 -2
- package/dist/chatgpt-plan.d.ts +16 -1
- package/dist/chatgpt-plan.js +116 -12
- package/dist/claude-login.d.ts +34 -5
- package/dist/claude-login.js +31 -7
- package/dist/claude-sign-in.d.ts +35 -0
- package/dist/claude-sign-in.js +90 -0
- package/dist/cli.js +5 -3
- package/dist/composio-made.d.ts +26 -1
- package/dist/composio-made.js +39 -2
- package/dist/composio-preset.d.ts +3 -2
- package/dist/composio-preset.js +46 -14
- package/dist/computer-held-routes.js +2 -3
- package/dist/computer-setting.d.ts +4 -2
- package/dist/computer-setting.js +0 -2
- package/dist/computers-running.d.ts +8 -0
- package/dist/computers-running.js +27 -0
- package/dist/console/assets/backend-Boh7tC4i.js +166 -0
- package/dist/console/assets/index-CQ3cJRzI.js +746 -0
- package/dist/console/assets/index-DKkaS3a0.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/docker-host-addresses.d.ts +23 -3
- package/dist/docker-host-addresses.js +90 -18
- package/dist/exa-keyless.d.ts +2 -3
- package/dist/exa-keyless.js +43 -127
- package/dist/firecrawl-keyless.d.ts +41 -0
- package/dist/firecrawl-keyless.js +152 -0
- package/dist/handed-secret.d.ts +3 -1
- package/dist/handed-secret.js +4 -2
- package/dist/harness-keys.d.ts +98 -0
- package/dist/harness-keys.js +247 -0
- package/dist/harness-recipe-entry.d.ts +14 -9
- package/dist/harness-recipe-entry.js +25 -14
- package/dist/harness-table.d.ts +16 -1
- package/dist/harness-table.js +19 -7
- package/dist/harness.d.ts +4 -0
- package/dist/harness.js +12 -1
- package/dist/host-check.d.ts +6 -0
- package/dist/host-check.js +10 -0
- package/dist/import-summary.d.ts +1 -1
- package/dist/import-summary.js +1 -1
- package/dist/import.d.ts +5 -5
- package/dist/import.js +54 -67
- package/dist/key-refusal.d.ts +21 -5
- package/dist/key-refusal.js +231 -37
- package/dist/keyless-mcp.d.ts +36 -0
- package/dist/keyless-mcp.js +127 -0
- package/dist/learn/audit.d.ts +3 -3
- package/dist/learn/audit.js +3 -3
- package/dist/learn/commit.d.ts +8 -7
- package/dist/learn/commit.js +60 -20
- package/dist/learn/compile.d.ts +4 -3
- package/dist/learn/compile.js +7 -5
- package/dist/learn/folder.d.ts +16 -3
- package/dist/learn/folder.js +46 -13
- package/dist/learn/promote.d.ts +37 -13
- package/dist/learn/promote.js +112 -40
- package/dist/learn/secrets.d.ts +20 -10
- package/dist/learn/secrets.js +44 -176
- package/dist/learning-routes.d.ts +22 -17
- package/dist/learning-routes.js +40 -39
- package/dist/learning.js +2 -2
- package/dist/llms.txt +1 -1
- package/dist/manifest.d.ts +10 -0
- package/dist/manifest.js +30 -0
- package/dist/mcp-pin-first.d.ts +4 -2
- package/dist/mcp-pin-first.js +5 -2
- package/dist/mcp-secret-writes.d.ts +16 -7
- package/dist/mcp-secret-writes.js +35 -27
- package/dist/mcp-servers-store.d.ts +30 -6
- package/dist/mcp-servers-store.js +112 -28
- package/dist/mcp-sources.d.ts +10 -2
- package/dist/mcp-sources.js +9 -2
- package/dist/mcp-store.d.ts +13 -7
- package/dist/mcp-store.js +12 -9
- package/dist/model-form.d.ts +3 -2
- package/dist/model-form.js +11 -7
- package/dist/model.d.ts +20 -4
- package/dist/model.js +68 -9
- package/dist/native/history.d.ts +1 -1
- package/dist/native/history.js +2 -2
- package/dist/ollama-provider.d.ts +92 -0
- package/dist/ollama-provider.js +495 -0
- package/dist/openapi/agentrun-v2.openapi.json +2 -2
- package/dist/openapi.d.ts +3 -3
- package/dist/openapi.js +197 -55
- package/dist/page.d.ts +11 -3
- package/dist/page.js +22 -7
- package/dist/place-offers.d.ts +25 -1
- package/dist/place-offers.js +62 -8
- package/dist/print.js +1 -1
- package/dist/purged-workflow.d.ts +35 -7
- package/dist/purged-workflow.js +73 -26
- package/dist/redact/match.d.ts +74 -0
- package/dist/redact/match.js +771 -0
- package/dist/run-computer.d.ts +2 -0
- package/dist/run-computer.js +2 -0
- package/dist/run-files.d.ts +4 -0
- package/dist/run-files.js +4 -0
- package/dist/run-keys.d.ts +2 -4
- package/dist/run-keys.js +6 -7
- package/dist/run-launch.d.ts +4 -0
- package/dist/run-launch.js +4 -0
- package/dist/run-reads-over-store.d.ts +3 -2
- package/dist/run-reads-over-store.js +66 -2
- package/dist/run-secrets.js +5 -2
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +4 -4
- package/dist/runner/adapter-loop.d.ts +9 -3
- package/dist/runner/adapter-loop.js +34 -15
- package/dist/runner/adapter-run-spec.d.ts +3 -0
- package/dist/runner/adapter-run-spec.js +9 -4
- package/dist/runner/audit.js +8 -4
- package/dist/runner/beside.d.ts +2 -1
- package/dist/runner/beside.js +13 -5
- package/dist/runner/claim-secrets.d.ts +5 -8
- package/dist/runner/claim-secrets.js +6 -0
- package/dist/runner/cli-run-spec.d.ts +1 -1
- package/dist/runner/cli-run-spec.js +41 -7
- package/dist/runner/harness-loops.d.ts +22 -9
- package/dist/runner/harness-loops.js +21 -11
- package/dist/runner/held.d.ts +3 -0
- package/dist/runner/learning-end.d.ts +1 -1
- package/dist/runner/learning-end.js +8 -3
- package/dist/runner/loop-contract.d.ts +9 -4
- package/dist/runner/main.js +12 -6
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +26 -2
- package/dist/runner/mcp-run.d.ts +3 -0
- package/dist/runner/mcp-run.js +2 -1
- package/dist/runner/metrics.d.ts +10 -10
- package/dist/runner/metrics.js +19 -38
- package/dist/runner/model-route.d.ts +3 -0
- package/dist/runner/model-route.js +6 -2
- package/dist/runner/presence.d.ts +4 -3
- package/dist/runner/presence.js +4 -2
- package/dist/runner/promotion.d.ts +15 -9
- package/dist/runner/promotion.js +25 -15
- package/dist/runner/run-child-host.d.ts +2 -0
- package/dist/runner/run-child-host.js +19 -9
- package/dist/runner/run-child.js +3 -1
- package/dist/runner/runner.d.ts +4 -0
- package/dist/runner/runner.js +33 -3
- package/dist/runner/sdk-loop.js +2 -0
- package/dist/runner/workflow-loop.d.ts +2 -2
- package/dist/runner/workflow-loop.js +1 -2
- package/dist/runner/workflow-spec.d.ts +1 -1
- package/dist/runner/workflow-spec.js +6 -6
- package/dist/sdk/check.d.ts +4 -1
- package/dist/sdk/check.js +2 -1
- package/dist/sdk/runs.d.ts +2 -2
- package/dist/sdk/runs.js +8 -6
- package/dist/secret-cut.js +2 -1
- package/dist/secret-writes.d.ts +3 -2
- package/dist/secret-writes.js +1 -1
- package/dist/server.d.ts +49 -10
- package/dist/server.js +324 -118
- package/dist/standard-webhooks.d.ts +11 -0
- package/dist/standard-webhooks.js +20 -2
- package/dist/store/dialect.d.ts +3 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/postgres/dialect.js +3 -0
- package/dist/store/schema.js +5 -2
- package/dist/store/sqlite/store.js +133 -47
- package/dist/store/store.d.ts +64 -15
- package/dist/store/store.js +7 -0
- package/dist/store-reads/journal.d.ts +7 -2
- package/dist/store-reads/journal.js +9 -6
- package/dist/store-reads/learning.d.ts +12 -9
- package/dist/store-reads/learning.js +18 -24
- package/dist/store-view.d.ts +0 -5
- package/dist/store-view.js +10 -9
- package/dist/template-eval.d.ts +51 -6
- package/dist/template-eval.js +177 -53
- package/dist/template-import.js +4 -2
- package/dist/templates.d.ts +5 -3
- package/dist/templates.js +19 -40
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/labels.d.ts +2 -2
- package/dist/timeline/labels.js +2 -2
- package/dist/timeline/timeline.d.ts +14 -9
- package/dist/timeline/timeline.js +15 -7
- package/dist/tool-gate.js +3 -1
- package/dist/tool-plane.d.ts +17 -9
- package/dist/tool-plane.js +38 -17
- package/dist/tools.js +2 -2
- package/dist/trigger-launch-hook.d.ts +16 -8
- package/dist/trigger-launch-hook.js +32 -23
- package/dist/trigger-targets.d.ts +18 -8
- package/dist/trigger-targets.js +42 -19
- package/dist/triggers.d.ts +85 -23
- package/dist/triggers.js +303 -96
- package/dist/validate.js +1 -1
- package/dist/web-fake.js +3 -3
- package/dist/web-fetch-direct.d.ts +4 -0
- package/dist/web-fetch-direct.js +8 -1
- package/dist/web-fetch.d.ts +12 -3
- package/dist/web-fetch.js +47 -14
- package/dist/web-search.d.ts +33 -4
- package/dist/web-search.js +100 -41
- package/dist/webhooks.js +4 -5
- package/dist/workspace/computer-deps.d.ts +2 -1
- package/dist/workspace/computer-deps.js +5 -4
- package/dist/workspace/computer-for-claim.d.ts +8 -2
- package/dist/workspace/computer-for-claim.js +28 -9
- package/dist/workspace/computer-janitor.d.ts +15 -7
- package/dist/workspace/computer-janitor.js +33 -8
- package/dist/workspace/computer-kept.d.ts +52 -4
- package/dist/workspace/computer-kept.js +118 -6
- package/dist/workspace/run-end-computers.d.ts +5 -1
- package/dist/workspace/run-end-computers.js +27 -1
- package/dist/wrapped.d.ts +57 -0
- package/dist/wrapped.js +51 -0
- package/launcher/agentrun-serve +5 -1
- package/package.json +17 -13
- package/templates/README.md +10 -9
- package/dist/console/assets/index-B_85An2t.js +0 -745
- package/dist/console/assets/index-n1YsbnYh.css +0 -1
- package/dist/import-sources.d.ts +0 -116
- package/dist/import-sources.js +0 -693
package/README.md
CHANGED
|
@@ -416,7 +416,16 @@ A run's runner renews its claim on the run every 10 s, for a claim of 30 s. A ru
|
|
|
416
416
|
time, writes nothing more to the run, and the store refuses any write under a claim the run has moved past. Once the
|
|
417
417
|
claim lapses another runner claims the run and resumes it from its journal. A run's own computer doesn't survive a
|
|
418
418
|
runner loss, a crash, a server stop or a park (the claim that resumes the run starts a new one, and says so on the
|
|
419
|
-
timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does.
|
|
419
|
+
timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does.
|
|
420
|
+
The exception is a park's keep: a desktop, phone or sandbox a park keeps for 10 minutes comes back to the run's resume.
|
|
421
|
+
One that only the runner that kept it can reach again (a Docker container, a machine that dials the server) holds the
|
|
422
|
+
parked run for that runner while it is there under the same process (its word in the last 30 s, not refusing) and the
|
|
423
|
+
keep lasts: no other runner claims the run to resume it, so a runner whose loops are full makes an answer wait until
|
|
424
|
+
then. A stop or a cancel never waits: any runner claims the run at once and ends it without taking the kept machine
|
|
425
|
+
(also when the kept row can't be read then), which the runner that kept it ends at its time, or sooner at its janitor's
|
|
426
|
+
next pass once the run is over; another runner's janitor leaves both the row and the machine. Once that runner
|
|
427
|
+
is gone, any runner claims it, starts a new one, and the timeline says `The desktop wasn't kept: the runner that kept it
|
|
428
|
+
is gone.` `agentrun-serve runner --check --data DIR --name N`
|
|
420
429
|
(or `AGENTRUN_RUNNER_NAME=N` in place of `--name`) checks the runner's environment by name (its store, its seal key,
|
|
421
430
|
every run-facing name its server holds, a forwarder on loopback) and whether the runner named `N` has a fresh
|
|
422
431
|
heartbeat: it exits 0 when both hold, 1 when either does not, and 2 when no name is given. `--check --env` checks the
|
|
@@ -857,12 +866,24 @@ paths and addresses) ran without it.
|
|
|
857
866
|
whether this server offers it now, the tools it brings, and each provider with its key names and whether each is saved
|
|
858
867
|
(never a value). `PUT /v2/computers/{provider}/keys` saves a provider's keys, sealed under the server's seal key, from
|
|
859
868
|
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.
|
|
869
|
+
the provider with them and starts nothing. A key set in the server's environment wins over the saved one.
|
|
870
|
+
`GET /v2/computers/running` lists the computers up now: one row for each run still going (queued, working, paused or
|
|
871
|
+
waiting on its person) whose agent has a computer, with the run's id, agent, title, status and state and its `computer`
|
|
872
|
+
as `GET /v2/runs/{run_id}` carries it (`starting`, `ready`, or `taken_over` while its owner drives it, and a held
|
|
873
|
+
run's hold), newest first. The runs list carries no computer, so this is the one read for every running computer
|
|
874
|
+
across runs and agents; the console's Settings → Computers shows it as Running now. An agent's own computer kept
|
|
875
|
+
between runs is on the agent's read (`own_computer`), and a paired computer under `paired` in `GET /v2/computers`. The keys are
|
|
861
876
|
`DAYTONA_API_KEY` (with `DAYTONA_API_URL` and `DAYTONA_TARGET` optional), `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET`,
|
|
862
877
|
`E2B_API_KEY`, `AGENT37_API_KEY` and `AGENT37_SSH_KEY`, `MORPH_API_KEY`, `ORGO_API_KEY`, `PHONE_HARNESS_API_KEY`,
|
|
863
878
|
`BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, `KERNEL_API_KEY`, `BOXD_API_KEY` (with `BOXD_ORG` and
|
|
864
879
|
`BOXD_REGION` optional), `SMOLCLOUD_API_KEY`, `GROUNDBOX_API_KEY`, `CLOUDFLARE_RELAY_URL` and `CLOUDFLARE_RELAY_TOKEN` (the relay Worker's,
|
|
865
880
|
`packages/computer/relays/cloudflare`), and `FLY_API_TOKEN` and `FLY_APP`; Docker takes none.
|
|
881
|
+
`GET /v2/computers/running` lists every run still going (queued, working, paused or waiting on its person) whose agent
|
|
882
|
+
has a computer, newest first, each as `GET /v2/runs/{run_id}` answers it: its `computer` says the kind and provider,
|
|
883
|
+
`starting`, `ready` or `taken_over` while its owner drives it, and a held run's hold. The runs list carries no
|
|
884
|
+
computer, so this is the one read of the computers up across runs and agents; the console's Settings → Computers shows
|
|
885
|
+
it as Running now. An agent's own computer kept between runs is on the agent's read (`own_computer`), and a paired
|
|
886
|
+
computer under `paired` in `GET /v2/computers`.
|
|
866
887
|
The vendors bill their computers by time on their own pages: this server meters no
|
|
867
888
|
computer time. The older [`place`](#place) is this setting's v2 view: `{"mode": "runner"}` is kind `none`, and
|
|
868
889
|
`{"mode": "sandbox", "box": X}` is a sandbox on provider X. Writing either sets both.
|
|
@@ -1211,7 +1232,8 @@ An agentic revision names its model as `provider/model-id` (`"model"` in its def
|
|
|
1211
1232
|
this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's key, the server's own or saved as a
|
|
1212
1233
|
[tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
|
|
1213
1234
|
`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`.
|
|
1235
|
+
`openrouter/openai/gpt-6.1-sol` with `OPENROUTER_API_KEY`. With none of those, pi's default is the first model of this
|
|
1236
|
+
machine's Ollama that calls tools ([below](#on-this-machines-ollama)). Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
|
|
1215
1237
|
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
1238
|
or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
|
|
1217
1239
|
to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
|
|
@@ -1361,9 +1383,8 @@ Custody, as for a per_run MCP server's `mcp_auth`:
|
|
|
1361
1383
|
keeps failing, the message waits untaken and is delivered again, never run on the key held before it or the
|
|
1362
1384
|
server's. A stop or cancel sent after it still reaches the run. A message without one keeps the key the run holds.
|
|
1363
1385
|
|
|
1364
|
-
**The revoke-at-turn-end contract.** The write that ends a run's turn erases its key from the store
|
|
1365
|
-
|
|
1366
|
-
ended (`run.ended`, the run's `completed`, `failed` or `stopped` status) only after that write. Every model request
|
|
1386
|
+
**The revoke-at-turn-end contract.** The write that ends a run's turn erases its key from the store, and the run
|
|
1387
|
+
reports the turn ended (`run.ended`, the run's `completed`, `failed` or `stopped` status) only after that write. Every model request
|
|
1367
1388
|
tied to the turn finishes before then: the job, its subagents, its learned workflows' nodes, its end-of-run compile
|
|
1368
1389
|
turn. So a caller may revoke the key as soon as it sees the turn end, and no request of that run will
|
|
1369
1390
|
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 +1416,13 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
|
|
|
1395
1416
|
|
|
1396
1417
|
- 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
1418
|
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
|
|
1419
|
+
value that is not 8 or more characters of visible ASCII (`invalid`), as a header carries it: the runner could
|
|
1399
1420
|
not cut a shorter one from what the run writes.
|
|
1400
1421
|
- 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
1422
|
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
|
|
1403
|
-
|
|
1404
|
-
the
|
|
1423
|
+
each claim for its tools alone, and erased from the store by the write that ends its turn. Since no read after that
|
|
1424
|
+
could cut them, the runner cuts them from everything the run writes, as it writes it. To cut them, the runner's
|
|
1425
|
+
redactor keeps each value in memory for as long as the runner runs, as it does a run's `model_key`.
|
|
1405
1426
|
- 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
1427
|
going keeps the keys it opened. `keys: {}` leaves the run none. A message without them keeps the run's, which are
|
|
1407
1428
|
none once its last turn ended.
|
|
@@ -1410,15 +1431,21 @@ curl -s http://127.0.0.1:7340/v2/agents/searcher/runs -H "Authorization: Bearer
|
|
|
1410
1431
|
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
1432
|
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
1433
|
`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.
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1434
|
+
used by runs that bring none.
|
|
1435
|
+
|
|
1436
|
+
A trigger's firing brings no keys, so no trigger is made whose firings would start or message such runs without them.
|
|
1437
|
+
The apply skips the template's triggers with a warning at `triggers.<N>` (`not_set_up_here`, the apply still 201),
|
|
1438
|
+
unless the [launch hook](#launch-hook) is set, which hands each firing to your backend to start the run with its keys.
|
|
1439
|
+
`POST /v2/triggers`, or a `PATCH` that moves a trigger, is 409 `agent_not_runnable` naming the keys for a trigger that
|
|
1440
|
+
would start runs of the agent with no hook, or message one of its runs, hook or not. A `message_run` trigger made
|
|
1441
|
+
before the setting was on, or while the server held the key, fails each firing with that 409 and sends nothing. An
|
|
1442
|
+
update apply that skips a trigger leaves the agent's trigger of that name as it was; when that one is on, it still
|
|
1443
|
+
fires, and the skip's warning names it and says how to turn it off.
|
|
1444
|
+
|
|
1445
|
+
`MONID_API_KEY` stays the server's even with the setting on: an agent's monid tools are checked with it when the agent
|
|
1446
|
+
is saved, before any run, so a template that grants them is still refused at its apply (409 at
|
|
1447
|
+
`secrets.MONID_API_KEY`) where the server has none. A run can still bring its own monid key to use in place of the
|
|
1448
|
+
server's.
|
|
1422
1449
|
|
|
1423
1450
|
### Direct Particle-1
|
|
1424
1451
|
|
|
@@ -1524,20 +1551,45 @@ run agents on it.
|
|
|
1524
1551
|
|
|
1525
1552
|
On a server one person runs on their own machine, Claude Agent can run on that person's Claude plan through the Claude
|
|
1526
1553
|
Code CLI's own login. The CLI holds the login and calls Anthropic itself. AgentRun never reads, copies, stores or relays
|
|
1527
|
-
the login. It tells the CLI where the login is and asks it `claude auth status`, nothing else. Settings → Model keys
|
|
1554
|
+
the login's tokens. It tells the CLI where the login is and asks it `claude auth status`, nothing else. Settings → Model keys
|
|
1528
1555
|
has the row **Use Claude Code's login on this machine**, over these routes:
|
|
1529
1556
|
|
|
1530
1557
|
- `PUT /v2/settings/claude-login` `{"only_me": true, "place": "agentrun"}` turns it on. `only_me` is the owner's word
|
|
1531
1558
|
that they alone run agents on this server. `place` is where the login is: `agentrun` (the default) is AgentRun's own
|
|
1532
|
-
login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1559
|
+
login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login, which
|
|
1560
|
+
you opt into by name. Its folder is the one the CLI uses: `CLAUDE_CONFIG_DIR` when the server's environment sets it to
|
|
1561
|
+
an absolute path, else `~/.claude`. A Claude Code that keeps its login in another folder is found only when AgentRun
|
|
1562
|
+
is started with `CLAUDE_CONFIG_DIR` set to that folder. A server where more than one person can start runs (more
|
|
1563
|
+
than one API token, the API-only profile) refuses it with `403` and one line saying why, and a turn-on saved before
|
|
1564
|
+
is dropped when such a server starts.
|
|
1536
1565
|
- `GET /v2/settings/claude-login` says `state`: `off`, `signed_in` (with the `account` the CLI names: method, email,
|
|
1537
1566
|
organization, plan), `signed_out`, `no_cli` (claude-agent's first run installs the pinned CLI), `unknown`, or
|
|
1538
|
-
`other_machine`. `
|
|
1539
|
-
machine.
|
|
1540
|
-
|
|
1567
|
+
`other_machine`. `folder` is the folder whose login the CLI is asked about, and `machine` is this machine's own
|
|
1568
|
+
login folder (`machine.source`: `CLAUDE_CONFIG_DIR` or `default`). `command` is the line that signs the CLI in at
|
|
1569
|
+
the login's place, for a terminal on the server's machine. Where the console is on that machine (a server on loopback
|
|
1570
|
+
with no public address), `can_start` is true and `POST /v2/settings/claude-login/login` starts the pinned CLI's own
|
|
1571
|
+
`auth login`, which opens a browser there. It runs with the same variables as `command`, so it signs in at `folder`,
|
|
1572
|
+
and the status is read there too, since `auth login` writes the account it signed in to its config dir. On
|
|
1573
|
+
`machine` with the default `~/.claude`, the CLI is signed in as the person's own `claude` runs: no
|
|
1574
|
+
`CLAUDE_CONFIG_DIR` or `CLAUDE_SECURESTORAGE_CONFIG_DIR`, in their home, so it writes the account in `~/.claude.json`
|
|
1575
|
+
and the tokens where their Claude Code keeps them (in `~/.claude`; on macOS the Keychain item `Claude Code-credentials`).
|
|
1576
|
+
`command` there starts with `env -u CLAUDE_CONFIG_DIR -u CLAUDE_SECURESTORAGE_CONFIG_DIR`, so a terminal that exports
|
|
1577
|
+
either still signs in at that login. A run
|
|
1578
|
+
there reaches the same tokens: on macOS with `CLAUDE_SECURESTORAGE_CONFIG_DIR` set and empty, the CLI's way to name
|
|
1579
|
+
that item while the run has a config dir of its own; elsewhere with it set to `~/.claude`. On `machine`, either
|
|
1580
|
+
folder, the status check never runs the CLI on the person's own account file, which the CLI rewrites on every start
|
|
1581
|
+
whose config version is not its own: each check copies `.claude.json` (`~/.claude.json`, or the `CLAUDE_CONFIG_DIR`
|
|
1582
|
+
folder's), opening the original only to read it, into a folder of its own, gives the CLI that folder as its config
|
|
1583
|
+
dir and the tokens as a run reads them, and removes the folder however the check ends. The copy (0600, in a 0700
|
|
1584
|
+
folder) leaves out the fields that hold secrets: `primaryApiKey` (the API key an older Claude Code signed in with),
|
|
1585
|
+
`env` and every `mcpServers`, whose env and headers hold tokens; a file that doesn't parse as a JSON object is not
|
|
1586
|
+
copied at all. A run's config dir has none of them either, so the status says what a run gets. The status check
|
|
1587
|
+
runs in the person's home (the server's `HOME`) on every place, as the sign-in does, and so does a run on the login
|
|
1588
|
+
on macOS: the CLI reads its tokens there from the login keychain, which is under that home. `sign_in`
|
|
1589
|
+
says what became of that sign-in while the server runs: `waiting` for the browser since `started_at`, `signed_in`,
|
|
1590
|
+
`timed_out` (no answer from the browser within 10 minutes, so it was ended and a sign-in page still open can't
|
|
1591
|
+
finish), `failed` (the CLI ended without signing in, with its `exit_code`), or `not_started`. A second start ends a
|
|
1592
|
+
sign-in that still waits, and so do turning the mode off and stopping the server, which waits for that CLI to exit.
|
|
1541
1593
|
- `DELETE /v2/settings/claude-login` turns it off. The login stays as the CLI keeps it.
|
|
1542
1594
|
|
|
1543
1595
|
While it is on, a claude-agent run on an `anthropic/<model>` model goes on the login: its CLI gets no
|
|
@@ -1558,6 +1610,51 @@ it available past loopback, but a server with more than one API token still refu
|
|
|
1558
1610
|
profile. While the mode is off, the row is gone and every route above answers `404` naming its operation. A turn-on
|
|
1559
1611
|
saved earlier is dropped when the server starts, and claude-agent runs on the model keys.
|
|
1560
1612
|
|
|
1613
|
+
### On this machine's Ollama
|
|
1614
|
+
|
|
1615
|
+
Start Ollama (`ollama serve`, or its app) beside your own server and it lists Ollama's models itself, with no key, no
|
|
1616
|
+
gateway and no restart: `GET /api/tags` for the tags, `POST /api/show` for each one's capabilities and trained context. Each chat model
|
|
1617
|
+
is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi, and the console names it
|
|
1618
|
+
`<tag> · local (Ollama)`, on a run's page too (from the run's `tokens` usage line, `provider` `ollama` and `model` the
|
|
1619
|
+
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
|
|
1620
|
+
within half a minute (the listing is kept that long, and asked again behind the next answer). A down or stuck Ollama
|
|
1621
|
+
lists no models and slows nothing: the listing has 2 seconds in all, follows no redirect, and keeps the models shown
|
|
1622
|
+
before its deadline. A run never waits on the listing: one on `ollama/<tag>` asks that model's `/api/show` alone (10
|
|
1623
|
+
seconds), and a run on any other model, a key's default included, never asks Ollama.
|
|
1624
|
+
|
|
1625
|
+
- Where: `OLLAMA_HOST`, read as the ollama CLI reads it. Unset, 127.0.0.1:11434, but only on one owner's own server
|
|
1626
|
+
on their own machine, the one `--harness-sign-in` starts on: it listens on loopback with no public address, keeps the
|
|
1627
|
+
SQLite store, runs its runs beside it as its own user, and takes one owner and one API token. On any other server
|
|
1628
|
+
(shared, `--no-runner`, Postgres, API-only, more than one token), whatever answers on that machine's 11434 is no model
|
|
1629
|
+
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
|
|
1630
|
+
scheme is plain http, port 11434 when none is given; `http://` and `https://` take their own default ports. `0.0.0.0`
|
|
1631
|
+
and `::`, where `ollama serve` listens on every address, mean this machine (127.0.0.1 and `[::1]`). A path is kept.
|
|
1632
|
+
Plain http goes only to this machine (loopback); another machine takes `https://`. A refused `OLLAMA_HOST` lists no
|
|
1633
|
+
models, and the server's log says why once, at its start (`event=ollama_host_refused`, never the value: a user or
|
|
1634
|
+
password in it stays unsaid). `agentrun service install --env OLLAMA_HOST=<host:port>` gives it to the service.
|
|
1635
|
+
- Context: each request is Ollama's own `/api/chat`, streamed, with `options.num_ctx` the least of 65,536, the model's
|
|
1636
|
+
trained context (where `/api/show` names one) and `OLLAMA_CONTEXT_LENGTH` (where the server's environment sets it to a
|
|
1637
|
+
whole number above 0, as a person short of memory does for Ollama itself). The model's context window here is the same
|
|
1638
|
+
number, so pi compacts before Ollama would cut the prompt.
|
|
1639
|
+
- Thinking: a model whose capabilities include `thinking` has its reasoning split out by Ollama. For any other, an
|
|
1640
|
+
answer that opens with `<think>` has that part as thinking up to `</think>`, the split Ollama makes for a thinking
|
|
1641
|
+
model, so the tags never reach the answer.
|
|
1642
|
+
- Tools: a model whose capabilities include `tools` takes them natively. Any other takes them as text: the tools are
|
|
1643
|
+
described in its prompt, and a call written in its answer comes back as a real call.
|
|
1644
|
+
- Cost: $0, booked as a known cost. Its requests never count toward the server's [limit on free
|
|
1645
|
+
requests](#a-limit-on-free-requests): there is no shared quota behind them. An agent's own `max_requests` counts them,
|
|
1646
|
+
with its other free requests, so a run on Ollama that keeps calling tools still stops there.
|
|
1647
|
+
- Harness: pi alone. claude-agent, codex and opencode never list them.
|
|
1648
|
+
- Cloud models: an Ollama cloud model (a `-cloud` tag, with `remote_host` and `remote_model` in `/api/tags` or
|
|
1649
|
+
`/api/show`) runs on ollama.com, not here, so it is never listed: never local, never $0, never the default.
|
|
1650
|
+
- Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi runs on the first model Ollama
|
|
1651
|
+
lists that calls tools. Any key wins. A model without tools is pickable, never the default. Ollama lists the model
|
|
1652
|
+
pulled last first, so pulling one can change that default, and a saved agent that names no model follows it. Name the
|
|
1653
|
+
model (`ollama/<tag>`) to pin it.
|
|
1654
|
+
|
|
1655
|
+
`inkling-2-mini` (Ollama 0.40.17 or later) is the model to try first. Under `--faux` or `AGENT_MODEL_BASE_URL`, Ollama
|
|
1656
|
+
is never asked.
|
|
1657
|
+
|
|
1561
1658
|
## Tools
|
|
1562
1659
|
|
|
1563
1660
|
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 +1830,34 @@ provider the user picked, optional: the agent's own (`definition.tool_settings`)
|
|
|
1733
1830
|
(`PUT /settings/tools`); (2) the native tool, the harness's own or its model provider's hosted one (on claude-agent
|
|
1734
1831
|
only where it is picked: `auto` there skips Claude's own search, an explicit `native` pick); (3) for
|
|
1735
1832
|
`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
|
|
1737
|
-
|
|
1833
|
+
keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (4) the keyless
|
|
1834
|
+
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
1835
|
Codex's own search, except behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
|
|
1739
1836
|
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
|
|
1741
|
-
and an agent naming it is refused (`409`) until it is turned on again. A pick of `
|
|
1742
|
-
the key held or not.
|
|
1837
|
+
admit), where it is Parallel on the server's key, else keyless Firecrawl. `off` turns `web_search` off: nothing is
|
|
1838
|
+
searched, and an agent naming it is refused (`409`) until it is turned on again. A pick of `firecrawl-keyless` is keyless
|
|
1839
|
+
Firecrawl with keyless Exa behind it, and a pick of `exa-keyless` is keyless Exa alone, the key held or not.
|
|
1743
1840
|
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
|
|
1841
|
+
it is Parallel on the server's key, else keyless Firecrawl, or the provider picked, and a pick of `native` alone is
|
|
1745
1842
|
unavailable for a workflow.
|
|
1746
1843
|
|
|
1747
1844
|
| | `claude-agent` | `codex` | pi |
|
|
1748
1845
|
| --- | --- | --- | --- |
|
|
1749
|
-
| `web_search`, `auto` (the default) | Parallel on the server's key, else keyless
|
|
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
|
|
1846
|
+
| `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 |
|
|
1847
|
+
| `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
1848
|
| `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
|
|
1752
|
-
| `web_search`, `
|
|
1753
|
-
| `
|
|
1849
|
+
| `web_search`, `firecrawl-keyless` | Firecrawl's public MCP search, keyless Exa's behind it, a host tool | the same | the same |
|
|
1850
|
+
| `web_search`, `exa-keyless` | Exa's public MCP search alone, a host tool | the same | the same |
|
|
1851
|
+
| `web_fetch`, `auto` (the default) | the guarded direct fetch where the server holds a Parallel key, else keyless Firecrawl | the same | the same |
|
|
1852
|
+
| `web_fetch`, `firecrawl-keyless` | Firecrawl's public MCP scrape, the guarded direct fetch behind it: Firecrawl is sent each URL | the same | the same |
|
|
1853
|
+
| `web_fetch`, `kernel` | the guarded direct fetch | the same | the same |
|
|
1754
1854
|
| either, `parallel` | Parallel's search and extract, host tools | the same | the same |
|
|
1755
1855
|
|
|
1756
1856
|
`GET /settings/tools` answers the server's settings, `{web_search: {provider}, web_fetch: {provider}, browser: {provider}}`, the default
|
|
1757
1857
|
where none is set; `PUT /settings/tools` takes the same map and replaces it (a capability it leaves out takes its
|
|
1758
1858
|
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 `
|
|
1859
|
+
for its capability (`auto`, `native`, `firecrawl-keyless`, `exa-keyless`, `parallel` or `off` for `web_search`; `auto`,
|
|
1860
|
+
`firecrawl-keyless`, `kernel` or `parallel` for `web_fetch`;
|
|
1760
1861
|
`auto`, `browserbase`, `kernel` or `chrome` for `browser`, [below](#tools)); an
|
|
1761
1862
|
unknown capability or provider is `422`. Any tool's settings also take a `permission`, `allow`, `ask` or `deny`, which the
|
|
1762
1863
|
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 +1867,8 @@ settings are kept in the data directory
|
|
|
1766
1867
|
(`tool-settings.json`, 0600, written whole and durably), not a secret, and read by every run launched from then on.
|
|
1767
1868
|
`GET /capabilities` is the one tool catalog: each of the three tools there gives the providers offered (`providers`), the
|
|
1768
1869
|
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`, `
|
|
1770
|
-
`parallel`, or `unavailable: <reason>`), with `why`, keyed the same, one plain sentence for each (`Codex's own search`,
|
|
1870
|
+
resolves to on each harness under the server's settings and default model (`native`, `kernel`, `firecrawl-keyless`,
|
|
1871
|
+
`exa-keyless`, `parallel`, or `unavailable: <reason>`), with `why`, keyed the same, one plain sentence for each (`Codex's own search`,
|
|
1771
1872
|
`behind a gateway Codex has no own search; your Parallel key (saved)`, where `saved` is a key saved on Tool keys and
|
|
1772
1873
|
`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
1874
|
`tools`, each tool its current revision grants in the same order, and for one with a choice the provider in force,
|
|
@@ -1787,7 +1888,8 @@ run (`409` with `details.asks`); set that tool to allow for the agent (`definiti
|
|
|
1787
1888
|
allowed by default; catalog (`monid:<provider>/<endpoint>`) and MCP tools, which ask by default, are no call node's tools here.
|
|
1788
1889
|
|
|
1789
1890
|
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
|
|
1891
|
+
Now `web_fetch` on `auto` is the guarded direct fetch on such a server (keyless Firecrawl on one with no Parallel key)
|
|
1892
|
+
unless Parallel is picked; to keep the old behaviour, set
|
|
1791
1893
|
`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
1894
|
[Decision workflows](#decision-workflows)), and a web tool reaches Parallel only where its own capability does.
|
|
1793
1895
|
|
|
@@ -1800,11 +1902,37 @@ answer with its sources. A `pause_turn`
|
|
|
1800
1902
|
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
1903
|
plus $10 per 1,000 searches (Anthropic) or calls (OpenAI).
|
|
1802
1904
|
|
|
1803
|
-
With no native search and no Parallel key, web_search falls back to
|
|
1804
|
-
|
|
1805
|
-
`web_search` to `native` (native only) for the server
|
|
1806
|
-
search with a key instead, save a Parallel key on Tool
|
|
1807
|
-
Parallel and bills the key.
|
|
1905
|
+
With no native search and no Parallel key, web_search falls back to Firecrawl's public keyless MCP endpoint, with Exa's
|
|
1906
|
+
behind it. Both are third-party services with their own free limits and their own terms (https://www.firecrawl.dev/terms-of-service,
|
|
1907
|
+
https://exa.ai/terms). To turn them off, set `web_search` to `native` (native only) for the server
|
|
1908
|
+
(`PUT /v2/settings/tools`) or for an agent (`tool_settings`). To search with a key instead, save a Parallel key on Tool
|
|
1909
|
+
keys (or set `PARALLEL_API_KEY`): `auto` then searches through Parallel and bills the key.
|
|
1910
|
+
|
|
1911
|
+
Keyless Firecrawl is one MCP exchange with Firecrawl's public endpoint (`https://mcp.firecrawl.dev/v2/mcp`), with no key,
|
|
1912
|
+
no Authorization header and no header of our own: `firecrawl_search` with the query and the number of results asked for,
|
|
1913
|
+
or `firecrawl_scrape` with the URL, for its markdown. A call ends at 30 s and is not retried: the backend behind Firecrawl
|
|
1914
|
+
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,
|
|
1915
|
+
and no backend starts once the deadline is spent. A page Firecrawl read with a status that is not 2xx, or an answer past
|
|
1916
|
+
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
|
|
1917
|
+
Firecrawl, and where the guarded direct fetch then reads the page, the server logs why Firecrawl gave none
|
|
1918
|
+
(`event=web_fetch_firecrawl_failed`, never the URL). Firecrawl refuses a keyless call it will not serve with a code, and
|
|
1919
|
+
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
|
|
1920
|
+
`KEYLESS_TOOL_NOT_AVAILABLE` turn Firecrawl off for the rest of the run, and the same call goes to the backend behind it
|
|
1921
|
+
(keyless Exa for `web_search`, the guarded direct fetch for `web_fetch`); `KEYLESS_LIMIT_REACHED` or a `429` is a rate
|
|
1922
|
+
limit, and Firecrawl is held for the wait it names (60 s where it names none), with no cutoff. With Firecrawl and Exa both
|
|
1923
|
+
off for a run, `web_search` answers `search is unavailable for the rest of this run; answer from what you have`.
|
|
1924
|
+
|
|
1925
|
+
`web_fetch` through keyless Firecrawl sends Firecrawl each URL it reads: Firecrawl, a third party, fetches the page and
|
|
1926
|
+
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
|
|
1927
|
+
guard's own check, and one it refuses (a private, loopback, link-local or intranet address, a name that resolves to one,
|
|
1928
|
+
or a URL holding a user name or password) is refused as the guarded direct fetch refuses it, and never sent to Firecrawl,
|
|
1929
|
+
to Exa or to Parallel. To keep every URL on the server, pick `kernel` for `web_fetch`, or hold a Parallel key, where
|
|
1930
|
+
`auto` is the guarded direct fetch. A server's pick is the default only: an agent's own `tool_settings` outrank it, so an
|
|
1931
|
+
agent (an imported template's among them) that picks `firecrawl-keyless` or `auto` still sends its URLs to Firecrawl.
|
|
1932
|
+
Only a server's `deny` is absolute: set `web_fetch` to `deny` to stop every agent's fetches.
|
|
1933
|
+
|
|
1934
|
+
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
|
|
1935
|
+
Firecrawl, then, where Firecrawl gives no page, the guarded fetch's 30 s and 5 s to read the page.
|
|
1808
1936
|
|
|
1809
1937
|
Keyless Exa is one exchange with Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its `web_search_exa` tool, at most
|
|
1810
1938
|
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 +1946,7 @@ other failure Exa answers reads `Free web search failed. Exa said: "<the first s
|
|
|
1818
1946
|
characters; Exa's own instructions (a key for its MCP URL) are never passed on.
|
|
1819
1947
|
|
|
1820
1948
|
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
|
|
1949
|
+
naming the one that served it (`native`, `firecrawl-keyless`, `exa-keyless`, `parallel`), each snippet cut at 3,000 characters; the answer
|
|
1822
1950
|
the model reads ends with one line asking it to cite the URL of each result it relies on.
|
|
1823
1951
|
|
|
1824
1952
|
`web_fetch` answers a Page with `via`, a part of the page at a time (`offset`, `max_chars`, as above). With Parallel
|
|
@@ -1828,7 +1956,8 @@ text, about $0.001 an extract, one a page a run) and `via` is
|
|
|
1828
1956
|
with no content, a 5xx or not within 60 s, it is the guarded direct fetch, `via: "direct"`, with `parallel` saying why
|
|
1829
1957
|
Parallel gave no page (`refused the key (401)`, `answered 503`, `timed out`, `listed the URL in errors`, `not tried:
|
|
1830
1958
|
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.
|
|
1959
|
+
run. A fetch Parallel was not picked for says nothing of it. Through keyless Firecrawl the page is Firecrawl's markdown
|
|
1960
|
+
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
1961
|
refuses is refused and never leaves the machine. A call stopped before its page arrived answers `ok: false` with
|
|
1833
1962
|
`via: "stopped"`: no page came for it (the run's read of the URL goes on for its other calls).
|
|
1834
1963
|
|
|
@@ -1853,7 +1982,7 @@ request checked meanwhile, from any branch, tool round or harness, counts it bes
|
|
|
1853
1982
|
never pass the cap together. A workflow's `call` node naming either tool is booked the same way, under the node's own
|
|
1854
1983
|
call (its execution path).
|
|
1855
1984
|
|
|
1856
|
-
Keyless Exa, where `web_search` resolves to it, searches through Exa's public MCP endpoint (`https://mcp.exa.ai/mcp`, its
|
|
1985
|
+
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
1986
|
`web_search_exa` tool), with no key. What leaves the server is
|
|
1858
1987
|
the search query (cut at 200 characters) and the number of results asked for (1 to 8, 5 by default), nothing else
|
|
1859
1988
|
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 +1992,8 @@ are held for the wait. Exa answers its daily count running out the same way, nam
|
|
|
1863
1992
|
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
1993
|
included, so a call never hangs. The answer is the query and its results, each a URL, a title, a
|
|
1865
1994
|
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
|
|
1867
|
-
turns `web_search` off,
|
|
1995
|
+
relies on. Keyless Exa answers behind keyless Firecrawl, the default for a harness with no native search when the server
|
|
1996
|
+
holds no Parallel key; `off` turns `web_search` off, both included.
|
|
1868
1997
|
|
|
1869
1998
|
The `browser` tool runs hosted sessions, at Browserbase or at Kernel, never a Chrome on this machine. Which one is
|
|
1870
1999
|
picked like `web_search`'s provider: the agent's own (`definition.tool_settings.browser.provider`) over the server's
|
|
@@ -2198,8 +2327,8 @@ Streamable HTTP with the official MCP SDK client (`@modelcontextprotocol/client`
|
|
|
2198
2327
|
`output_schema` and `annotations` (the server's own claims, not checked). It stores nothing. `auth` is `{type: "none"}`
|
|
2199
2328
|
(or absent), `{type: "bearer", token}` (sent as `Authorization: Bearer <token>`) or `{type: "headers", headers: {Name:
|
|
2200
2329
|
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
|
|
2202
|
-
([start-time switches](#start-time-switches))
|
|
2330
|
+
`url` is `https`, or `http` on loopback; a loopback URL (either scheme) is taken only on a server started with
|
|
2331
|
+
`AGENTRUN_MCP_ALLOW_LOOPBACK=1` ([start-time switches](#start-time-switches)).
|
|
2203
2332
|
|
|
2204
2333
|
A server advertising MCP resources also lists three AgentRun-generated read operations, including when it has no
|
|
2205
2334
|
tools: `agentrun_list_resources` (`resource: "list"`), `agentrun_list_resource_templates` (`resource: "templates"`)
|
|
@@ -2217,7 +2346,11 @@ preset: you give your Composio API key, a toolkit (`github`, `slack`...), the ac
|
|
|
2217
2346
|
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
2347
|
ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
|
|
2219
2348
|
`{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.
|
|
2349
|
+
user_id?, auth_config_id?, price_usd?}` makes and saves the server. In place of `api_key`, `"api_key_env":
|
|
2350
|
+
"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
|
|
2351
|
+
way an [API-only](#api-only) server's token saves one. That key is only ever sent to Composio's own origin, fixed in
|
|
2352
|
+
code, so a server saved so whose address is anywhere else is refused by name and sent nothing. The body names no
|
|
2353
|
+
address or headers (`422 not_allowed`): Composio answers the address. When the toolkit needs your account and `user_id`
|
|
2221
2354
|
(default `agentrun`) has none active, the answer's `connect_url` is Composio's page to connect it; nothing here signs
|
|
2222
2355
|
in. The server and its connect link are made against the toolkit's Composio-managed auth config (found, else made), or
|
|
2223
2356
|
against `auth_config_id`, one you already have at Composio (your own OAuth app's, say): it is read first, and one
|
|
@@ -2252,9 +2385,8 @@ curl -X POST "$BASE/v2/agents/$AGENT/runs" -H "authorization: Bearer $TOKEN" -H
|
|
|
2252
2385
|
(`ca_...`), and without it Composio picks the user's account for the toolkit. Each request to the server carries that
|
|
2253
2386
|
user and account, the Composio key staying the server's own. The binding is kept as a `per_run` server's headers are:
|
|
2254
2387
|
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
|
|
2256
|
-
|
|
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
|
|
2388
|
+
run's view, its timeline, its trace or a log line, and its values are cut from whatever the run shows. A message's
|
|
2389
|
+
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
2390
|
handed none, so a per-run server never calls as a default account. A malformed user or account is `422 input_invalid` at
|
|
2259
2391
|
`mcp_auth.<server>.composio_user_id` or `.connected_account_id`, and so is a binding to the preset's default user
|
|
2260
2392
|
`agentrun` (`not_allowed`: the user single-user preset servers call as); headers for such a server, or a binding for any
|
|
@@ -2268,8 +2400,13 @@ refused, so a host must not bind a per-run server to a `user_id` that a single-u
|
|
|
2268
2400
|
What can go wrong, told apart:
|
|
2269
2401
|
|
|
2270
2402
|
- `403 forbidden` with `details.console_url`: the API token sent, dropped or changed a credential, which only the
|
|
2271
|
-
owner's console saves
|
|
2272
|
-
|
|
2403
|
+
owner's console saves, or saved over or deleted a server the token did not save (the owner's, sealing a credential or
|
|
2404
|
+
not), which only the owner's console changes or deletes. The link opens Settings → MCP servers with the form filled in
|
|
2405
|
+
(name, URL, kind of credential, toolkit; for a saved server, its Change form), never the credential. A URL that could
|
|
2406
|
+
hold one is left out.
|
|
2407
|
+
- `412 precondition_failed`: the server changed while the save or delete ran (another save, a sign-in, a removal), so
|
|
2408
|
+
nothing was written over it: read it again and try again. An owner's save that lands while the token's save or delete
|
|
2409
|
+
of a server it saved is under way makes the server the owner's, and the token's is this `412`.
|
|
2273
2410
|
- `422 auth_required`: the server answered 401 or 403. `details.auth` is `oauth` when it names protected-resource
|
|
2274
2411
|
metadata (in its `WWW-Authenticate`, or at `/.well-known/oauth-protected-resource`), else `bearer`.
|
|
2275
2412
|
- `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 +2464,8 @@ those headers, and only to the origin the server had when the run was started. T
|
|
|
2327
2464
|
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
2465
|
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
2466
|
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
|
|
2331
|
-
|
|
2332
|
-
takes `mcp_auth` too: it replaces the run's credentials in the message's own write, so the turn the message starts (a
|
|
2467
|
+
credential answers the first request's run), and its values are cut from whatever the run shows.
|
|
2468
|
+
`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
2469
|
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
2470
|
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
2471
|
for a per_run server it calls has those calls answered, unsent, that it was handed none. `POST .../{name}/refresh` lists
|
|
@@ -2675,7 +2811,8 @@ gets a `trigger.failed` message for it (`data: {trigger_id, name, agent_id, agen
|
|
|
2675
2811
|
auto_paused}`, its `webhook-id` made from the firing's key, so a restart never sends it twice). `agent_id` is the agent
|
|
2676
2812
|
the trigger runs as, which every trigger has: a `start_run` target's agent, or the agent of the run a `message_run`
|
|
2677
2813
|
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
|
|
2814
|
+
trigger off (`disabled: {reason: "auto_paused"}`); a firing tried again (a busy server) counts once, when it fails,
|
|
2815
|
+
however many tries it took. A firing that starts its run resets the count, and so does turning
|
|
2679
2816
|
it on again. Run now (below) works on an auto-paused trigger too, and counts toward the streak like any firing: one that
|
|
2680
2817
|
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
2818
|
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 +2912,8 @@ tried again, a later one can start first.
|
|
|
2775
2912
|
|
|
2776
2913
|
Such a trigger can fill the runner's places and the queue behind them, starving other triggers and the runs people
|
|
2777
2914
|
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
|
|
2915
|
+
is tried again, and is never skipped. It counts the runs this trigger started while they work (with the launch hook,
|
|
2916
|
+
also a firing its host took, until that firing's run starts or its `start_by` passes), kept apart
|
|
2779
2917
|
from its history (so a long run counts however many firings follow it) and read again at each check; a run a person
|
|
2780
2918
|
opens again after it ended is that person's follow-up, not counted. Any `start_run` trigger of a pushed source (a
|
|
2781
2919
|
webhook) takes it, with or without `accept`: set, each event starts its own run, never skipped behind the last, up to the
|
|
@@ -3134,7 +3272,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
3134
3272
|
| `GET /capacity` | This server's own (`capacity/1`): the runs waiting for a runner and held by one, each live runner's version, slots and free slots, and the hand-backs within `?window=` minutes, read from the store ([capacity and health](#capacity-and-health)). Served under `AGENTRUN_API_ONLY=1` too. |
|
|
3135
3273
|
| `GET /openapi.json` | Without a credential: this API as an OpenAPI 3.1 document, the `agentrun.v2/0` contract (vendored in `src/openapi/`, its source in `info`) with this server's own routes marked `x-agentrun-serve`, the operations it answers `501` marked `x-agentrun-serve-unsupported`, and a contract operation that takes more than the contract gives marked `x-agentrun-serve-changed` with each change named; `links.openapi` in capabilities points at it. |
|
|
3136
3274
|
| `GET /capabilities` | Without a credential. `backend: local`, every feature flag present and true only when it works; `tools`, the tools an agentic revision may name; `workflows`, what a workflow revision's model nodes get and, in `workflows.decisions.providers`, the decision providers its typed questions run on; `models`, where models come from and the model of each tier. |
|
|
3137
|
-
| `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0 ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced
|
|
3275
|
+
| `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0 ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's json block meets (its last fenced one, or the whole answer when it is one JSON object), which a completed run's `result.output` then holds (null when the answer doesn't meet it), kept by an edit that leaves it out. A template's answer schema is set here at apply, and a run a schedule trigger starts is handed that trigger's last completed `result.output` after its message; no other source's runs are, since each of their firings is a different event. Over 32 KiB, a scheduled run is handed only the fields the producing run's schema names in `x-carried`; carried arrays lose entries from the front until they fit, and the run is told how many. A save refuses an `x-carried` that is not unique root property names. `checkout` (agentic only): `pull_request` has the server check out, before each run's first turn, the pull request the run's GitHub event names, in `repo/` at its head with its base and merge base, using a read-only token of its GitHub App that the agent never holds ([GitHub triggers](#github-triggers-connect-github)); `none` clears it, and an edit that leaves it out keeps it. A field the store does not keep (`input_schema`) is `422 input_invalid` by name, and so is a definition that can never run here; one this host cannot run yet saves with `warnings` ([models](#models)). The ETag (`home_etag`) is the current revision's id. `GET /agents/{id}` adds `tools`, the tools its current revision grants with each one's provider ([search and fetch](#search-and-fetch)). It also adds `run_blockers` (`x-agentrun-serve: "runblockers/1"`): `{message, fields}` as a start with no overrides would be refused now (`409 agent_not_runnable`), or null. It is always null for an archived, native or SDK agent and for a revision whose MCP tools its first run pins, and the read asks no other service, so under the agent's `max_cost_usd` an OpenRouter decision model's missing price is named only once a save or a start has read OpenRouter's catalog: null is no promise that a start is accepted. |
|
|
3138
3276
|
| `PUT /agents/{id}/definition` | The same body, checked [the same way](#models): a new revision, its parent the current one, made current. Without `skills` the current revision's skill files carry over. A definition that is the current revision already writes nothing, so a PUT sent twice makes one revision. An agent's id and name stay those it was made with (another name is `422` on `definition.name`). Its description is a label kept on the agent, not on a revision: a PUT that names a new one makes the next revision (even when nothing else changed) and writes the description with it in one commit, so a stale or refused edit changes neither; a PUT that leaves it out keeps it. `If-Match` that is not the current ETag is `412 precondition_failed`; the store compares it again inside the commit, so of two edits that read the same revision exactly one lands. The contract's body is taken too: the definition itself, with `If-Match` required (`412` without it) and `definition.version` greater than the current one (`422`). Any such version is taken, and always makes a new revision, the same definition included; the revision is numbered as this server numbers them, the next, and the answer says which; the route reads a body holding `definition` as this one, any other as the contract's. |
|
|
3139
3277
|
| `GET /agents/{id}/revisions` | The agent's revisions, newest first: `revision`, `version`, `parent`, `kind`, `current`, `note`, `created_at` and the `definition`. |
|
|
3140
3278
|
| `POST /agents/{id}/current` | `{revision}`: one of the agent's revisions becomes current again. |
|
|
@@ -3283,7 +3421,8 @@ serves these routes alone:
|
|
|
3283
3421
|
the backend whose inline runs made it;
|
|
3284
3422
|
- the [purge of a run](#purging-a-run-or-an-agent-made-here) (`DELETE /runs/{id}`) of such an agent, for that
|
|
3285
3423
|
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
|
|
3424
|
+
run of an agent made here (a deploy's, below) is purged the same way, since the token may archive and delete that
|
|
3425
|
+
whole agent, every run of it purged;
|
|
3287
3426
|
- the computer settings' two reads, for a backend to check before it launches: `GET /computers` (each provider, its
|
|
3288
3427
|
key names and whether each is saved, and whether it is ready) and `GET /workspace/archil` (whether runs' folders are
|
|
3289
3428
|
on Archil, and whether its account key is saved). Neither answers a key's value. Their writes, tests and key choices
|
|
@@ -3301,20 +3440,49 @@ serves these routes alone:
|
|
|
3301
3440
|
- a deploy, for a backend that deploys agents here: a template's apply (`POST /templates/{id}/apply`, a redeploy with
|
|
3302
3441
|
its `agent_id`), the agent's read (`GET /agents/{id}`), its revisions (`GET /agents/{id}/revisions`), a rollback
|
|
3303
3442
|
(`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.
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3443
|
+
is what its delete (`DELETE /agents/{id}`) needs first. With the [launch hook](#launch-hook) set, the apply makes the
|
|
3444
|
+
package's schedule and feed triggers, and every firing that starts a run goes to the backend, which starts it through
|
|
3445
|
+
the API with the keys and budget it sends, a trigger the agent had before the profile included; the unarchive turns
|
|
3446
|
+
them on again, as no trigger route is served to. Without the hook it makes neither (`not_set_up_here`: set the hook,
|
|
3447
|
+
or start those runs through the API), and a trigger the agent already had stays as it was: an enabled one still fires
|
|
3448
|
+
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
3449
|
or not, since this profile refuses the hook or setting each needs (`not_an_option`). Each skipped trigger is a warning
|
|
3310
3450
|
under `warnings` (`triggers.<i>`), and the dry run (`dry_run: true`) plans it as `skip` in the same words;
|
|
3451
|
+
- 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
|
|
3452
|
+
backend that grants its runs Composio tools. The token here never writes a secret, so the save keeps none:
|
|
3453
|
+
- a Composio server (`PUT /settings/mcp-servers/{name}/composio`) names its key with
|
|
3454
|
+
`"api_key_env": "COMPOSIO_API_KEY"`, never `api_key` (still `403`). The server keeps the variable's name, never its
|
|
3455
|
+
value, and reads the value it and each runner were started with at each use: the save's calls to Composio, each
|
|
3456
|
+
run's connection and the delete's. A new value takes effect once they start again with it. `COMPOSIO_API_KEY` is
|
|
3457
|
+
the one name taken (`422 invalid` for any other), and it must be set when the server is saved (`422 missing`). A
|
|
3458
|
+
run of a server whose variable is unset is refused before it starts (`409 agent_not_runnable`), naming it; it never
|
|
3459
|
+
runs without the server's tools. `toolkit`, `tools`, `auth_config_id`, `price_usd` and `user_id: "per_run"` work as
|
|
3460
|
+
they do on the full server;
|
|
3461
|
+
- `COMPOSIO_API_KEY` is a secret, so give it to the server and to each runner. The launcher hands it to each over a
|
|
3462
|
+
pipe, so neither process's environment holds it, and no run is handed it: the runner sends it only as the MCP
|
|
3463
|
+
header of a Composio server the run is granted a tool of, and a run granted none gets nothing of it;
|
|
3464
|
+
- the body names no address and no headers (`url` or `headers` is `422 not_allowed`): Composio answers the server's
|
|
3465
|
+
address, and the key read from the variable is only ever sent to Composio's own origin, fixed in code. A server
|
|
3466
|
+
whose saved address is anywhere else is refused by name wherever that key would be read (a refresh, a run's start),
|
|
3467
|
+
and nothing is sent;
|
|
3468
|
+
- a save over a saved name and a delete (`DELETE /settings/mcp-servers/{name}`) take only a server the token saved.
|
|
3469
|
+
One saved any other way (by the owner, sealing a credential or not) is `403` to both, it stays as it was, and
|
|
3470
|
+
nothing is sent to Composio. An owner's save over a server the token saved makes it the owner's once it lands (one
|
|
3471
|
+
refused with `412` leaves it the token's), and one that lands while the token's is under way wins: the token's is
|
|
3472
|
+
`412`.
|
|
3473
|
+
|
|
3474
|
+
The names route above is the listing: there is no list or read of a server's address, auth or tools here, and no
|
|
3475
|
+
generic save (`PUT /settings/mcp-servers/{name}`), so the token saves no server at an address or with headers of its
|
|
3476
|
+
own. The preview, refresh, sign-in, Composio tool listing and every other MCP settings route stay refused. On the full
|
|
3477
|
+
server the token's `api_key_env` is `403`, as `api_key` is: the owner's session saves a Composio server there either
|
|
3478
|
+
way;
|
|
3311
3479
|
- a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
|
|
3312
3480
|
|
|
3313
3481
|
Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
|
|
3314
3482
|
`AGENTRUN_PUBLIC_URL` that opens that run's live page and socket until the run ends (API doc).
|
|
3315
3483
|
|
|
3316
3484
|
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
|
|
3485
|
+
assets, sign-in and setup, every other `/settings` route, `POST /mcp`, triggers and their
|
|
3318
3486
|
`POST /hooks/{id}`, the agents list, an agent made or edited through `/agents`, the templates list and every other
|
|
3319
3487
|
template route, `/openapi.json`, `/llms.txt` and a browser's live view. It has no accounts: there is no page to sign in
|
|
3320
3488
|
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 +3507,65 @@ host, and this server starts no run for it:
|
|
|
3339
3507
|
|
|
3340
3508
|
The POST carries `webhook-id` (the firing's id, the same if it is handed again), `webhook-timestamp` and
|
|
3341
3509
|
`webhook-signature` as [webhooks](#webhooks) do: check them with any Standard Webhooks library before reading the
|
|
3342
|
-
body.
|
|
3510
|
+
body.
|
|
3511
|
+
|
|
3512
|
+
The host starts the run with `POST /v2/agents/{agent_id}/runs`, giving the input, its own `model_key`, `keys` and
|
|
3343
3513
|
`max_cost_usd`, and `"trigger_firing": { "trigger_id": ..., "firing_id": ... }` as it was sent, and answers 2xx within
|
|
3344
|
-
10 s.
|
|
3514
|
+
10 s. That run is the firing's, as one this server started would be: it names the trigger and the firing, carries the
|
|
3515
|
+
trigger's title and input origin, and the firing reads `started` with it, so the trigger's overlap check and
|
|
3516
|
+
`max_active_runs` count it.
|
|
3517
|
+
|
|
3518
|
+
The run starts on the trigger's target, as the run this server would start for the firing:
|
|
3519
|
+
|
|
3520
|
+
- 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
|
|
3521
|
+
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
|
|
3522
|
+
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
|
|
3523
|
+
5 and its 1 at 1.
|
|
3524
|
+
- Its effort is the target's when the target sets one, else the host's `effort`, else the agent's.
|
|
3525
|
+
- It runs on the agent's current revision and holds no computer: `revision`, `hold` or `hold_minutes` in the host's
|
|
3526
|
+
body is refused with 422 `not_allowed`, naming the field.
|
|
3527
|
+
- 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.
|
|
3528
|
+
- Its input is the host's, followed by the trigger's last completed result when its source hands one on (a schedule
|
|
3529
|
+
does), as a run this server starts for it is.
|
|
3530
|
+
|
|
3531
|
+
The host can start the run before it answers or after. A firing it answered 2xx with no run yet reads `sent` with
|
|
3345
3532
|
`start_by`, 10 minutes after that answer, takes that one start until then, and is refused with 422 `not_due` after.
|
|
3346
3533
|
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
|
|
3348
|
-
firing over again.
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3534
|
+
waited on `max_active_runs`, one handed again after a restart) gets the same time. The server never hands a `sent`
|
|
3535
|
+
firing over again. Until its run starts or its `start_by` passes, it holds its trigger's room as a run in progress
|
|
3536
|
+
would: with `max_active_runs`, a later firing waits for that room, and without it the overlap check skips a later
|
|
3537
|
+
firing, naming the held one. Once `start_by` passes it holds nothing, and a waiting firing is handed. A start that
|
|
3538
|
+
begins by `start_by` holds the room until its run is written: when `start_by` is less than a minute away, the server
|
|
3539
|
+
moves it to a minute after the start began, before it writes the run. A start that fails without writing its run
|
|
3540
|
+
moves `start_by` back, so failed starts never extend the window.
|
|
3541
|
+
|
|
3542
|
+
The firing is the run's key, so a second start for the same firing answers the same run, also while the first is
|
|
3543
|
+
still writing it (202 with `idempotent-replayed: true`), and the request takes no
|
|
3544
|
+
`Idempotency-Key` (422 with one). A firing that is neither due nor taken by its host (failed, skipped, or one of
|
|
3545
|
+
another agent's triggers) is refused with 422. A due firing takes its start only while its trigger has room for it,
|
|
3546
|
+
by the overlap check and `max_active_runs` the server applies before it hands a firing over: one waiting on its retry
|
|
3547
|
+
whose place another firing's run has taken since is refused with 422 `not_due`, which says why. So is one whose place
|
|
3548
|
+
another firing is taking: a firing whose hook has not answered yet, or whose host's start is being written, holds the
|
|
3549
|
+
room as a run in progress until that is done.
|
|
3550
|
+
|
|
3551
|
+
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
|
|
3552
|
+
then. The firing's `error.code` is `hook_failed`, and its `reason` names the cause: the status the host answered,
|
|
3553
|
+
`timeout` (no answer in 10 s) or `unreachable` (no connection). No answer, no connection, a 5xx or a 429 leaves the
|
|
3554
|
+
firing due with `retry_at`, tried again on the trigger's backoff under the same `webhook-id`; any other answer, a
|
|
3555
|
+
redirect included (it is not followed), fails it at once. A firing counts once toward the trigger's failure streak,
|
|
3556
|
+
when it fails, however many tries it took: 5 failed firings in a row turn the trigger off, and a firing that fails
|
|
3557
|
+
sends `trigger.failed`. A host whose start lands while its firing waits on a retry (it answered too late) has that run
|
|
3558
|
+
made the firing's, `started`, while its trigger has room for it. A start that lands just as the server records the
|
|
3559
|
+
hook's answer keeps the firing `started` with its run: the answer doesn't set it back to `sent`, fail it or count it.
|
|
3560
|
+
|
|
3561
|
+
A firing the server's stop cuts short stays due and is handed again at the next start, under the same `webhook-id`. A
|
|
3562
|
+
`message_run` target starts no run and is unchanged.
|
|
3563
|
+
|
|
3564
|
+
The start prints the hook's origin, never its path or the secret. The hook is `https`: a firing's input can carry a
|
|
3565
|
+
person's data, and the signature proves who sent it, not that no one else read it, so plain `http` is taken only for
|
|
3566
|
+
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
|
|
3567
|
+
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
|
|
3568
|
+
words.
|
|
3362
3569
|
|
|
3363
3570
|
## Uploads
|
|
3364
3571
|
|
|
@@ -3741,17 +3948,18 @@ stays in every total.
|
|
|
3741
3948
|
(`DELETE /v2/agents/{id}/learning`) or the agent's purge, which delete the folder whole. Each merge's feedback line goes in
|
|
3742
3949
|
one commit by the host (none when nothing is left to remove), a line a person edited since stays, and another
|
|
3743
3950
|
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
|
|
3745
|
-
`workflow.json`
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3951
|
+
merges, known by the run the log names for each (its newest 200 changes). A purge takes off main only what the run
|
|
3952
|
+
put there, in one host commit: each learned workflow whose `workflow.json` it wrote last (over the whole history,
|
|
3953
|
+
past those 200; a host commit that puts a version back names that version's run) goes back, its whole folder, to
|
|
3954
|
+
the version before it that no purged run wrote, so another run's champion keeps serving; one it wrote new leaves
|
|
3955
|
+
main, its file reads `404`. No run lays its text, and a read at an older commit (a champion by its digest, an SDK
|
|
3956
|
+
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
3957
|
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
3958
|
does this again. It covers the learning folder on this
|
|
3751
3959
|
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
3960
|
- It takes the owner's session (the password sign-in, or the console on a server bound to loopback) or the API token;
|
|
3753
3961
|
any other console session is `403 forbidden`, no credential `401`. An [API-only](#api-only) server purges a run of
|
|
3754
|
-
|
|
3962
|
+
any agent with its token, as it deletes or purges the whole agent.
|
|
3755
3963
|
|
|
3756
3964
|
An agent made here is purged the same way once archived: `DELETE /v2/agents/{id}`. Its revisions' content, name and
|
|
3757
3965
|
description, learning, triggers, saved sign-ins, own computer, disk and folders go, and each of its runs is purged.
|
|
@@ -4741,7 +4949,7 @@ A request on a free model costs $0, so no dollar cap can stop one: a free model
|
|
|
4741
4949
|
(an OpenRouter `:free` model and the like, as `harnesses[].free_models` lists them; an OpenRouter router is none, since
|
|
4742
4950
|
it bills the model it picks), with no fee beside the request. Its provider's shared daily quota is what a looping run
|
|
4743
4951
|
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'
|
|
4952
|
+
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
4953
|
`limits.free_model_requests` says it, and the console says "free model: up to 60 requests" beside the cap of an agent
|
|
4746
4954
|
on a free model. A run may make that many; the next is not sent, and the run ends `failed` as one its
|
|
4747
4955
|
cap ends, its error `spend_cap_reached`: "Not sent: this run reached its 60-request limit for free models." (the number
|
|
@@ -4751,6 +4959,9 @@ compaction, a title), and one a crash cut, which is booked at $0, a known cost;
|
|
|
4751
4959
|
workflow's decision never count, and are never refused by it. The count is read from the run's booking records at each
|
|
4752
4960
|
request, so a restart or a claim moved to another runner keeps it.
|
|
4753
4961
|
|
|
4962
|
+
An agent's own `max_requests` is a lower limit of the same kind, in the same words. It counts everything the server's
|
|
4963
|
+
limit counts and a local model's requests (Ollama's) too: the only limit a run on Ollama meets besides its turns.
|
|
4964
|
+
|
|
4754
4965
|
### A run paused at its cap
|
|
4755
4966
|
|
|
4756
4967
|
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 +5134,9 @@ carries no cost at all, as from a provider that does not price the model. The te
|
|
|
4923
5134
|
`SENTRY_DSN`, `DB_PWD`; never `PWD` or `OLDPWD`), whether the launcher's list names it or not. The rule is
|
|
4924
5135
|
`keyShaped` (`src/secret-cut.ts`), which an import's cut and a harness's log take too. The keys a
|
|
4925
5136
|
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))
|
|
4927
|
-
(`ARCHIL_API_KEY`), from which the claim mints the run's own mount credential
|
|
5137
|
+
It gets none of the computer providers' account keys ([Sandbox](#sandbox)), not the Archil account key
|
|
5138
|
+
(`ARCHIL_API_KEY`), from which the claim mints the run's own mount credential, and not the Composio account key
|
|
5139
|
+
(`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
5140
|
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
5141
|
tools are those its model and call nodes name), and a model key only when its model needs it ([Models](#models)), read
|
|
4930
5142
|
from the revision at each claim, a resume after a restart included.
|