@parcha/agentrun-serve 0.1.0-beta.34 → 0.1.0-beta.35
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 +135 -0
- package/README.md +84 -16
- package/dist/adapters.d.ts +3 -0
- package/dist/adapters.js +7 -0
- package/dist/agent-rows.d.ts +1 -0
- package/dist/agents-store.js +17 -2
- package/dist/archil-settings.d.ts +11 -1
- package/dist/archil-settings.js +10 -0
- package/dist/bash-read-only.d.ts +13 -0
- package/dist/bash-read-only.js +77 -0
- package/dist/browser-cost.d.ts +2 -2
- package/dist/browser-cost.js +6 -4
- package/dist/budget.d.ts +0 -5
- package/dist/budget.js +0 -5
- package/dist/cap.d.ts +6 -3
- package/dist/cap.js +7 -4
- package/dist/cli.js +32 -5
- package/dist/computer-keys.d.ts +20 -10
- package/dist/computer-keys.js +36 -57
- package/dist/computer-setting.d.ts +6 -5
- package/dist/computer-setting.js +54 -26
- package/dist/computers.d.ts +9 -4
- package/dist/computers.js +4 -2
- package/dist/console/assets/index-B7NKTU8E.css +1 -0
- package/dist/console/assets/index-CXZMgJE7.js +550 -0
- package/dist/console/index.html +2 -2
- package/dist/content-filter.d.ts +7 -0
- package/dist/content-filter.js +23 -0
- package/dist/decision-cap.d.ts +7 -29
- package/dist/decision-cap.js +3 -94
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +3 -0
- package/dist/explain.js +3 -1
- package/dist/github-connection.js +25 -7
- package/dist/github-faux.d.ts +26 -0
- package/dist/github-faux.js +76 -0
- package/dist/github.d.ts +6 -2
- package/dist/github.js +5 -3
- package/dist/graph-served.d.ts +5 -3
- package/dist/graph-served.js +14 -6
- package/dist/graph-view.js +5 -2
- package/dist/harness-opencode/harness.js +0 -1
- package/dist/harness-opencode/host/policy.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/learn/check.d.ts +3 -1
- package/dist/learn/check.js +3 -3
- package/dist/learn/folder.d.ts +6 -3
- package/dist/learn/folder.js +7 -16
- package/dist/learn/grade.d.ts +4 -1
- package/dist/learn/grade.js +43 -5
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/learning.sh +1 -14
- package/dist/learn/notes.d.ts +14 -3
- package/dist/learn/notes.js +16 -6
- package/dist/learn/reflect.js +5 -3
- package/dist/learn/skills.d.ts +48 -5
- package/dist/learn/skills.js +97 -21
- package/dist/learned-nodes.d.ts +14 -0
- package/dist/learned-nodes.js +8 -0
- package/dist/learned-workflow.d.ts +9 -5
- package/dist/learned-workflow.js +53 -9
- package/dist/learning-routes.d.ts +41 -0
- package/dist/learning-routes.js +94 -26
- package/dist/learning-run.d.ts +7 -5
- package/dist/learning-run.js +9 -6
- package/dist/learning.d.ts +0 -22
- package/dist/learning.js +0 -16
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +4 -2
- package/dist/mcp-gateway.d.ts +6 -0
- package/dist/mcp-gateway.js +11 -1
- package/dist/mcp-servers-store.d.ts +12 -12
- package/dist/model.d.ts +3 -0
- package/dist/model.js +8 -0
- package/dist/openapi.js +37 -13
- package/dist/paid-calls.js +1 -1
- package/dist/pause.d.ts +2 -19
- package/dist/pause.js +5 -74
- package/dist/port-models.d.ts +10 -3
- package/dist/port-models.js +26 -6
- package/dist/propose.d.ts +2 -0
- package/dist/propose.js +1 -10
- package/dist/run-launch.d.ts +5 -3
- package/dist/run-launch.js +6 -5
- package/dist/run-learning-served.d.ts +11 -0
- package/dist/run-reads-over-store.d.ts +4 -2
- package/dist/run-reads-over-store.js +10 -8
- package/dist/run-timeline-served.js +12 -2
- package/dist/run-view.d.ts +30 -14
- package/dist/run-view.js +60 -32
- package/dist/runnable.d.ts +4 -1
- package/dist/runnable.js +14 -2
- package/dist/runner/adapter-loop.d.ts +30 -4
- package/dist/runner/adapter-loop.js +253 -29
- package/dist/runner/adapter-run-spec.d.ts +21 -0
- package/dist/runner/adapter-run-spec.js +104 -28
- package/dist/runner/adapters/pi.d.ts +29 -1
- package/dist/runner/adapters/pi.js +95 -23
- package/dist/runner/beside.d.ts +8 -0
- package/dist/runner/beside.js +18 -0
- package/dist/runner/claim-secrets.d.ts +6 -0
- package/dist/runner/claim-secrets.js +15 -1
- package/dist/runner/cli-run-spec.d.ts +3 -0
- package/dist/runner/cli-run-spec.js +123 -34
- package/dist/runner/conformance/harness.d.ts +1 -0
- package/dist/runner/conformance/harness.js +5 -5
- package/dist/runner/github-app.d.ts +7 -2
- package/dist/runner/github-app.js +46 -15
- package/dist/runner/harness-loops.d.ts +6 -1
- package/dist/runner/harness-loops.js +23 -0
- package/dist/runner/journal-kinds.d.ts +38 -2
- package/dist/runner/journal-kinds.js +23 -0
- package/dist/runner/learning-end.js +88 -16
- package/dist/runner/learning-loop.d.ts +2 -0
- package/dist/runner/learning-loop.js +13 -5
- package/dist/runner/learning-seed.d.ts +6 -0
- package/dist/runner/learning-seed.js +6 -0
- package/dist/runner/loop-contract.d.ts +4 -0
- package/dist/runner/main.d.ts +9 -4
- package/dist/runner/main.js +26 -11
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +6 -1
- package/dist/runner/mcp-github.d.ts +11 -2
- package/dist/runner/mcp-github.js +55 -4
- package/dist/runner/mcp-run.js +1 -0
- package/dist/runner/metrics.d.ts +14 -1
- package/dist/runner/metrics.js +72 -1
- package/dist/runner/model-route.d.ts +3 -0
- package/dist/runner/model-route.js +1 -1
- package/dist/runner/runner.js +90 -8
- package/dist/runner/spec-holds.d.ts +7 -2
- package/dist/runner/spec-holds.js +4 -3
- package/dist/runner/workflow-host.d.ts +7 -2
- package/dist/runner/workflow-host.js +3 -1
- package/dist/runner/workflow-loop.d.ts +4 -1
- package/dist/runner/workflow-loop.js +8 -2
- package/dist/runner/workflow-spec.d.ts +3 -0
- package/dist/runner/workflow-spec.js +156 -78
- package/dist/runs-over-store.d.ts +7 -1
- package/dist/runs-over-store.js +42 -11
- package/dist/seal-key.d.ts +0 -2
- package/dist/seal-key.js +0 -2
- package/dist/server-lock.js +4 -5
- package/dist/server.d.ts +21 -18
- package/dist/server.js +183 -34
- package/dist/stop-signals.d.ts +4 -2
- package/dist/stop-signals.js +5 -3
- package/dist/store/agent-body.d.ts +5 -1
- package/dist/store/agent-body.js +11 -5
- package/dist/store/deadline.d.ts +18 -0
- package/dist/store/deadline.js +45 -0
- package/dist/store/postgres/connection.d.ts +4 -0
- package/dist/store/postgres/connection.js +55 -9
- package/dist/store/sqlite/connection.js +3 -38
- package/dist/store-reads/journal.js +39 -4
- package/dist/store-reads/learning.d.ts +58 -2
- package/dist/store-reads/learning.js +172 -7
- package/dist/store-view.d.ts +15 -1
- package/dist/store-view.js +45 -12
- package/dist/templates.d.ts +9 -4
- package/dist/templates.js +14 -9
- package/dist/timeline/timeline.d.ts +8 -0
- package/dist/tool-budget.d.ts +18 -0
- package/dist/tool-budget.js +50 -0
- package/dist/tool-gate.d.ts +6 -2
- package/dist/tool-gate.js +8 -5
- package/dist/tool-plane.d.ts +9 -10
- package/dist/tools.d.ts +37 -7
- package/dist/tools.js +73 -12
- package/dist/uploads.d.ts +28 -5
- package/dist/uploads.js +82 -9
- package/dist/usage.d.ts +1 -47
- package/dist/usage.js +3 -82
- package/dist/validate.d.ts +2 -0
- package/dist/validate.js +11 -1
- package/dist/workspace/archil-claim.d.ts +2 -2
- package/dist/workspace/archil-claim.js +4 -3
- package/dist/workspace/archil-disk.d.ts +10 -1
- package/dist/workspace/archil-disk.js +4 -0
- package/dist/workspace/archil-exec.d.ts +12 -2
- package/dist/workspace/archil-exec.js +16 -0
- package/dist/workspace/archil.d.ts +2 -2
- package/dist/workspace/archil.js +25 -5
- package/dist/workspace/attach.js +2 -0
- package/dist/workspace/computer-deps.d.ts +9 -10
- package/dist/workspace/computer-deps.js +53 -40
- package/dist/workspace/computer-for-claim.d.ts +5 -3
- package/dist/workspace/computer-for-claim.js +28 -16
- package/dist/workspace/computer-ledger.d.ts +1 -8
- package/dist/workspace/computer-ledger.js +0 -3
- package/dist/workspace/computer-providers.d.ts +5 -3
- package/dist/workspace/computer-providers.js +11 -9
- package/dist/workspace/hands.d.ts +5 -2
- package/dist/workspace/hands.js +4 -3
- package/dist/workspace/index.d.ts +3 -3
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/local.d.ts +3 -0
- package/dist/workspace/local.js +9 -0
- package/dist/workspace/paths.js +3 -2
- package/dist/workspace/pi-env.d.ts +4 -0
- package/dist/workspace/pi-env.js +3 -2
- package/dist/workspace/resolve-computer.d.ts +8 -3
- package/dist/workspace/resolve-computer.js +28 -11
- package/dist/workspace/run-tools.d.ts +2 -0
- package/dist/workspace/run-tools.js +9 -3
- package/dist/workspace/workspace.d.ts +5 -0
- package/dist/workspace.d.ts +0 -3
- package/dist/workspace.js +1 -14
- package/package.json +14 -14
- package/skills/agentrun-serve/SKILL.md +1 -1
- package/templates/README.md +2 -2
- package/templates/code-review/evals/mentions-defused/case.yaml +15 -0
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +254 -0
- package/templates/code-review/evals/mentions-defused/graders/no-pings.md +16 -0
- package/templates/code-review/evals/mentions-defused/graders/posted-a-review.md +5 -0
- package/templates/code-review/evals/mentions-defused/graders/schema.md +5 -0
- package/templates/code-review/evals/mentions-defused/prompt.md +10 -0
- package/templates/kyb/evals/clean-public-company/graders/no-opensanctions.md +5 -0
- package/templates/kyb/evals/opensanctions-on/case.yaml +5 -0
- package/templates/kyb/evals/opensanctions-on/graders/licence-and-evidence.md +18 -0
- package/templates/kyb/evals/opensanctions-on/graders/schema.md +5 -0
- package/templates/kyb/evals/opensanctions-on/prompt.md +11 -0
- package/templates/release-notes/agent.md +11 -0
- package/dist/console/assets/index-RPHGlXmM.js +0 -540
- package/dist/console/assets/index-opTN5Naq.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,141 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.35 (2026-11-11)
|
|
6
|
+
|
|
7
|
+
- On the runner, a learned workflow node that names a tier (`fast`, `strong`) now runs on the host's model of that tier (`AGENT_MODEL_FAST`, `AGENT_MODEL_STRONG`) instead of the run's own model. Its requests take the run's one route and stay under the run's cap, and each is booked at its own model's price. A tier the host names no model of still runs on the run's own model. A tier whose model can't be reached fails the workflow call and names why; it never runs on another model. This holds on every harness: pi, Claude Agent, Codex and OpenCode. On a CLI harness the tier's requests go through a proxy of their own beside the CLI session's, never through the CLI. A tier's model key saved in Settings → Model keys is opened for that tier's requests alone. It never goes into a tool's environment. A tier whose model has the same id as the run's model is still held and booked at the tier's own price. `AdapterSession.port` and the run ledger's `models` take an optional `tier`. The kernel's `ModelRequest`, `ModelProxyOptions` and in-flight records carry an optional `route`, and the cap's `modelOf(id, route)` prices a request by model and route.
|
|
8
|
+
Who breaks: a host that already sets `AGENT_MODEL_FAST` or `AGENT_MODEL_STRONG` changes with no action. Its learned workflows' nodes of that tier now run on that model and at its price, and when that model can't be reached the learned_workflow call fails where it used to run on the run's own model.
|
|
9
|
+
Upgrading: a host whose `AGENT_MODEL_FAST` or `AGENT_MODEL_STRONG` names a model it can't reach should unset it or make the model reachable; learned tier nodes now run on it.
|
|
10
|
+
- A retired note, skill or workflow draft that waited for its owner's OK waits again when it is restored: a restore gives back the status it had before its retire, and only an approval makes it active. Before, Retire then Restore made a held rule active, and the restore was recorded as the owner's approval. A retire now records the status it took the item from (`retired_from: active | pending` in its front matter), the learning view says it (`retired.from`), and the console's Restore confirm says what the restore does: "It becomes active again" only for an item that was active, else that it goes back to waiting for your OK. A person's edit of a retired note keeps it retired with what its retire recorded, and a run's note may not set `retired_from`. An edit (`PUT /v2/agents/{agent_id}/learning/files/{file}`) that drops or changes a retired note's `status: retired`, or changes its `retired_from`, is now refused (400 `bad_request`, rule `status`); before, an edit that dropped it made the note active.
|
|
11
|
+
Upgrading: restore a retired note with `POST /v2/agents/{agent_id}/learning/files/{file}/restore`; an edit that drops or changes its `status: retired` is refused.
|
|
12
|
+
- A note, skill or workflow draft retired before this upgrade has no recorded status, so its restore puts it back waiting for its owner's OK, never active: approve it after the restore to make it active again. Upgrading: nothing to do.
|
|
13
|
+
- A capped run now wraps up instead of running into its cap with no answer. Once its spend plus what its requests and paid steps still out are held at reaches 75% of the cap, the run's tool gate refuses every tool call a model makes, in every conversation of the run and on every harness, with one fixed message: "Budget nearly spent: stop calling tools and answer now from what you have." A call that would start a child conversation (a `subagent` spawn) is refused the same way. Children already working are not cut: they get the same refusal and answer. Model requests continue, so the parent's final answer lands, and the cap stays the last line. The figure is read from the run's booking records at each call, so a restart or a moved claim holds the same line, and a raise of the cap moves it.
|
|
14
|
+
- Upgrading: this changes how a capped run ends. A run that used to end `spend_cap_reached` (or pause at its cap) after its in-flight reservations filled the cap now stops calling tools at 75% and answers from what it has. A run with no cap is unchanged.
|
|
15
|
+
- A learned workflow draft may run an MCP tool in a call node (`"via": "tool"`, `"tool": "mcp:<server>/<tool>"`) when the agent's revision grants it, by its own name or under its server's wildcard `mcp:<server>/*` (read against the tools the server lists), and its gate does not deny it (one set to ask is offered where someone can answer an ask, the server's accounts on: its learned_workflow call asks once, naming its MCP tools; with no one, it is not, since that call would be refused at once); a draft naming any other is refused, and one the gate denies is refused in the gate's words. The end-of-run turn's draft ask says what each such tool takes and gives, from its server's listing. The grader is told, under each draft, the MCP tools its call nodes run, by server and tool, and holds the draft for its owner's OK when one writes or sends: the learned workflow runs it unattended at every call. A draft's dry run synthesizes an MCP node's output from its `out`, as any call's, and sends nothing.
|
|
16
|
+
A draft whose MCP tools set to ask would not all fit on its learned call's approval card is refused when it is proposed, in the gate's words, by the gate's own rule. A draft with a step calling an MCP tool that has no declared per-call price waits for its owner's OK whatever the grade says, since such a tool runs outside the run's cost and cap; the reason names the step, the tool and its server, and the grader is told it.
|
|
17
|
+
Upgrading: nothing to do.
|
|
18
|
+
- A learned workflow can be made an agent of its own. The owner clicks "Make this an agent" on an active learned workflow in the Learning tab (`POST /v2/agents/{agent_id}/learning/workflows/{name}/promote`), and the server makes a new workflow agent from its `workflow.json`: its runs run the workflow's nodes with no agent loop and answer the workflow's output, and pipelines and triggers can call it as any agent. Only an active workflow is made an agent (one that waits for the owner's OK, or was retired, is `409 learned_not_active`), only from the owner's password session (a token is 403), and only once it passes the checks a restore makes and a workflow revision's save makes. The new agent's tools are the ones its call nodes call, under the source agent's own tool settings, approvals and default cap, never more. The new agent's id is the workflow's name, or the name with `-2`, `-3` and so on when an agent (archived ones too) already has that id or name. The request may give the new agent a `name`, 1 to 200 characters; without one it is named as its id. A retry with the same `Idempotency-Key` answers the agent the first request made, never a second one. The learned workflow stays where it is.
|
|
19
|
+
Upgrading: nothing to do.
|
|
20
|
+
- See learning at work, from the server:
|
|
21
|
+
- A learned workflow's call shows which of its nodes ran: its `tool_result` row in a run's timeline carries `learned_nodes`, each node's label, kind, how it ended (`ok`, `failed`, `escalated`) and how long it took; never why a node failed, whose text can hold part of a secret. A call stopped part way keeps the nodes that ended before it stopped.
|
|
22
|
+
- An agent whose learning is only skills or only workflows now has an impact: a run whose claim laid a learned skill or workflow counts on the "after" side, as one that started from a note does. A run's launch records the learned workflows it was offered beside its skills, and its claim records which skills and workflows it laid.
|
|
23
|
+
- `GET /runs/{id}/learning` gains `used`: which learned skills the run's claims laid and whether its job read each one (`used.skills`; a skill a revision's own skill of that name kept out is not one), and which learned workflows it called, how many times and how many of those failed (`used.workflows`; a call with no result yet is not a failure), apart from `skills` and `workflows`, what it learned.
|
|
24
|
+
A run from before this change: its `used.skills` is empty (its claims recorded no laid skills, `agentrun.learning.laid`), and its `used.workflows` lists its learned_workflow calls, read from its journal, when its launch named notes or skills (one whose launch named neither reads both empty); the agent's impact counts it by its notes, as before.
|
|
25
|
+
There is no "saved vs by hand" figure per run: no per-run baseline exists that is not a guess; the agent's impact (before and after) says it per agent.
|
|
26
|
+
Upgrading: a client reading `GET /runs/{id}/learning` gets a new `used` object (empty lists when none), and a timeline row may carry `learned_nodes`.
|
|
27
|
+
- An agent can now cap its tool calls: `max_tool_calls: N` on the definition (a template's `budget.tool_calls`) gives each conversation of a pi run N tool calls. Past N, the run's tool gate refuses every further call with one fixed message telling the model to stop calling tools and answer from what it has. That refusal is not counted, and the run is never ended by it, so the model's final answer still lands. The count is read from the conversation's journal, so a restart or a moved claim keeps it, and a conversation a tool opens counts its own calls. An edit that leaves the field out keeps it, 0 clears it, and on another harness the save is refused.
|
|
28
|
+
- Upgrading: nothing to change; an agent with no budget runs as before.
|
|
29
|
+
- A Mode 2 server with no exec image saved now runs its Archil execs in Docker's `buildpack-deps:trixie-scm`, pinned by digest (`buildpack-deps@sha256:4f34e1d6…`, git 2.47.3), instead of Archil's default exec image. Archil's image has git 2.34.1, and a shell under a bash policy runs git only at 2.43 or later, so a read-only agent on Archil got no git. An image saved through `PUT /v2/workspace/archil` (`image`) still replaces the default; it needs git 2.43 for a read-only agent, and GNU coreutils and perl for the exec line, as Debian-family images have. The console's image field says the new default.
|
|
30
|
+
- A shell under a bash policy (`tool_settings.bash.policy: "read-only"`) now runs git with its config locked down, so a read of someone else's checkout can't run a program that git config names. git reads no system or global config (`GIT_CONFIG_NOSYSTEM=1`, `GIT_CONFIG_GLOBAL=/dev/null`). Command-line config (`GIT_CONFIG_COUNT`, which outranks a repository's own `.git/config`) turns off core.fsmonitor and hooks, sets cat as the pager, reads no attributes (so no textconv, external diff or filter driver attaches to a path), finds a bare repository only when named (`safe.bareRepository=explicit`, against one planted in the tree), allows no transport and runs no signature program. `GIT_PAGER`/`PAGER` are cat, with no prompt, no optional lock and no lazy fetch. The lock-down needs git 2.43 (`attr.tree`), and an older git ignores what it doesn't know, so under a policy `git` runs only at 2.43 or later. An older one (a stock serverless exec image's 2.34) refuses each git call with words saying why, and nothing runs; give a read-only agent's exec image a newer git. A run with no bash policy keeps the plain shell environment.
|
|
31
|
+
- A capped run straight to Anthropic is no longer paused by a cap it could work under. Before each answer request on a route to `https://api.anthropic.com` (pi and claude-agent), the model proxy asks Anthropic's free token count (`POST /v1/messages/count_tokens`). It sends only the credential and version headers, and never goes through a gateway or any other base. The request's input bound is then that count plus the tool-use prompt, where before it was the body's bytes (about two to three times the tokens billed). A count that fails, says nothing or takes over 3 seconds leaves the byte bound, and the request goes on. Through OpenRouter or any other gateway the bound stays the bytes, so the cap still never passes.
|
|
32
|
+
|
|
33
|
+
The serve README's spend-cap section now states the smallest cap that works, by cap mode, measured on a pi desktop run on Sonnet. In `strict` mode (and in `expected`, the default, until the runner prices a step from the previous request's cache, #2504) it is $0.05 for the first request and $0.11 for a five-step run through a gateway, and $0.03 and $0.09 straight to Anthropic. The console's cap fields say it in a line, with a link. A cap below these still pauses with `Not sent: ... the next step needs at least $X`. A policy may count a request through `ProviderPolicy.countInput` (`InputCounter`, `countedInputOf` in the kernel host).
|
|
34
|
+
- A run paused at its cap and raised goes on the way the API says, on the runner.
|
|
35
|
+
- The raise's answer names the follow-up turn (`message_id`): the id the runner sends "The cap was raised to $X; continue the task." under, one per pause, so two raises sent at once, or a retry, name the same message.
|
|
36
|
+
- That follow-up shows in the Timeline as the server's row ("AgentRun: The cap was raised to $X; continue the task."), never as the person's "You: …", on pi. (A CLI harness's run records it with its per-request follow-up record, which comes separately.)
|
|
37
|
+
- A retry of a raise once the run has paused again under the raised cap is no raise of the new pause: it answers `resumed: false`, and the run stays paused.
|
|
38
|
+
- A CLI run (Claude Code, Codex) that waits for its harness's first-use install shows the "Installing … (first use)…" row on its timeline while it waits, not once the install is done.
|
|
39
|
+
- A run on a CLI harness (claude-agent, codex, opencode) now counts its tokens and its model requests in its metrics, and GET /v2/stats' analytics sum them, as a pi run's are. They are what the run's model proxy booked each request at, which the run's cost already came from; before, every CLI run read 0 requests and 0 tokens. A request booked with no usage, or sent and never answered, is counted unmetered, in no token sum; one answered at no known price keeps its tokens, its cost unknown.
|
|
40
|
+
Upgrading: nothing to do.
|
|
41
|
+
- A Claude Code, Codex or OpenCode run's files on the server's machine (its scratch folder under `<data>/scratch/`: the CLI's working directory, its home and state, the skills laid for it) are now removed when the run's claim ends, as the data layout always said, instead of staying for ever. Each claim gets a private folder of its own, so a run reopened by a follow-up while the last claim is still letting go never loses the new claim's files. The harness's session comes back from the run's journal at the next claim, as before.
|
|
42
|
+
- `deploy/compose.yaml` gives each runner container a memory limit, 2 GB by default (`AGENTRUN_RUNNER_MEMORY` in `.env` sets another). A runner claims runs by its memory, which it reads from its container's limit. With no limit, each of the two runners read the whole host's memory and budgeted all of it, so together they could claim twice what the host holds and an out-of-memory kill would take every run on it. Now each holds 1920 MiB of runs (six claude-agent runs or fifteen pi runs at once); the rest wait queued. A runner process also says its budget once at its start, on the line after its ready line: `Runner <name> memory: <N> MiB for runs, each weighed by its harness`.
|
|
43
|
+
- Upgrading: on a compose host with less than about 5 GB, set `AGENTRUN_RUNNER_MEMORY` (`1g`, say) so the runners' limits and the server fit.
|
|
44
|
+
- A Claude Code or Codex call that needs approval shows on the run's timeline while it waits, and the test harness for those CLIs asks the tool gate before each call, as the real ones do:
|
|
45
|
+
- serve: a CLI call the tool gate asks about goes on the run's record as it parks, its start marked parked, the way an MCP call parked at its door already did. Before, the timeline showed the approval card with no call row above it until the call ran. An allowed call then runs under that one start; a stop withdraws it and its row reads "Not run: the run was stopped while it waited".
|
|
46
|
+
- kernel: `askGate(gate, call, signal)` (`process/tools.ts`) is the gate step every tool bridge takes first: undefined for an allow, the refusal for a deny, and a park holds the call until the signal aborts. The faux harness in `@parcha/agentrun-kernel/testing` now asks it before each call: a deny is the call's answer, recorded so it is never asked again, and a park holds the turn. A recovered turn first runs the calls its last request left with no intent and no result (a parked one), under their own ids, as a real CLI's resume does. A test that scripts a faux CLI call to a tool set to ask (a `monid.` or MCP catalog tool by default) now sees the run park on it.
|
|
47
|
+
- A workflow run's graph read again with the same held keys redacts nothing again (#2464). `GET /v2/runs/{id}/graph` reads only the run's facts (its kind, revision, status, times, and whether it is withheld), never the run's served view, whose output and words were redacted again on every read. Every top-level field of the graph, its name and its value, scalar or not, is cut once per content and held-key set and kept as cut, as its parts already were. A key saved since makes a new set, cut on the next read. The read's own `read_at`, the server's clock, is served as it is.
|
|
48
|
+
Upgrading: nothing to do.
|
|
49
|
+
- Fixes a learned workflow draft that calls a tool the agent's own tool settings deny being left out "set to deny on this server". The words now name where the deny was set: "set to deny for this agent" for the agent's tool settings, "on this server" for the server's. The same holds when an owner restores a draft or makes a learned workflow an agent.
|
|
50
|
+
- Upgrading: nothing to change.
|
|
51
|
+
- Fixes a learning run whose cap you raised mid-run being told it had no budget left to look back. A run paused at a $0.001 cap and raised to $1 completed, then its learning read "Skipped: no budget left in this run to look back" with $0.994 of the $1 left: the end-of-run check compared the run's spend with the cap it started with. It now reads the cap the run is held to after a raise, the same one each of its requests is admitted under and its view shows, on pi and on claude-agent, codex and opencode.
|
|
52
|
+
- Upgrading: nothing to change.
|
|
53
|
+
- A run whose files live on the run's Archil disk (Mode 2) can read what its browser saved. browser_read and screenshot file their evidence in the run's own folder on the disk, where the run's `read` opens it; before, they wrote to a local folder that a Mode 2 run never has, so the call failed. browser_upload chooses from the same folder, and refuses a path that would leave it. browser_downloads, which copies into a folder of the runner's machine, is offered only where the run's files are on that machine (Mode 1), so a Mode 2 run is never told a file was saved where it cannot open it.
|
|
54
|
+
pi-browser exports `uploadMime(name)`, the media type browser_upload gives a file by its name.
|
|
55
|
+
- A data root serves one server again, whatever its store, and a server that replaces another waits for it instead of exiting. Since the switch to the one store, a server took only its store's owner lock, so two servers on one data root, each on a store of its own (two Postgres schemas, or SQLite and Postgres), both started and shared what the server writes beside its store (its token, its seal key, uploads, harness installs). A server now also takes `<data>/server.lock` once it holds its store, and reads or writes its token only after. A start that finds either held by the server it replaces (a redeploy, a restart that starts the new server before the old one has exited) says `another server holds this data root: waiting up to N s for the previous server to stop` and waits up to its `--drain-timeout` and 30 s, then exits 1. A server that died holds neither: both are kernel locks. `serveWithRunner(options)` is exported: a server and a runner beside it in one process, as the CLI's start composes them, for a launcher that starts serve in-process (a server alone leaves every run queued).
|
|
56
|
+
- A run whose paid tool call the cap refuses for room reads waiting on a raise only once the call's "Not sent: …" result is on its Timeline. The pause was journaled inside the call, before the harness stored its result, so for a moment the run showed its budget card with no row saying which call was refused. The pause now lands at the model's next request, as a refused model request's does.
|
|
57
|
+
- Runs left by a server that stopped are taken up correctly by the next start. Two cases were wrong. A run of a harness this host's memory can never hold (say a claude-agent run left working, restarted on a 384 MB host) used to be claimed anyway and read working forever. Now its claim fails it, in the same words a new start of it is refused with ("This server has 384 MB of memory … so it can't start here."). A stop or cancel sent just before the server stopped used to be left for the next start, whose runner could resume the run's turn before applying it. Now the closing runner applies it: the run ends stopped or cancelled before the stop is done, and the next start never opens it again.
|
|
58
|
+
- Upgrading: nothing to change.
|
|
59
|
+
- Runs on the runner behave as before the cutover in four places a person could hit:
|
|
60
|
+
- A run keeps the files it was started with. The server holds each of a run's `file_ids` for it at the start, so a file deleted between the start and the runner's claim is still copied into the run's `inputs/`. The hold goes once the copy is made, or when the run ends without one.
|
|
61
|
+
- A copy of a run's files that fails ends the run failed with "The run's files could not be copied into its workspace: <why>", instead of the bare error.
|
|
62
|
+
- A message sent while a turn works is answered before the run ends. The runner hands a turn's end every message it has not handed on yet, rather than at its next poll half a second later, so the run's end no longer refuses one the API took. On pi, a message placed as the turn answered was answered after the run's end was written: the run read completed, then wrote another answer.
|
|
63
|
+
- A claude-agent run's rows name a file it wrote or read by its name in the workspace (`Wrote hello.md`, `Saved hello.md`), not by the absolute path the Claude CLI sends, which named a folder on the runner's machine. The call's input preview keeps the path as sent.
|
|
64
|
+
- The test kit's faux adapter tells its script the session's working directory (`script(spec, { cwd })`), as a real CLI builds its absolute paths from it.
|
|
65
|
+
- A run's spend cap reads on the runner as it did before the cutover:
|
|
66
|
+
- A run paused at its cap shows the server's row "Paused at the run's cap" on its timeline, and, while it waits, "Waiting for you to raise the cap". The banner keeps the pause's sentence (`pending.said`). Before, nothing on the timeline said the run had paused.
|
|
67
|
+
- A run whose booked spend passed its cap shows by how much, after its usage row ("Spent $0.50, $0.20 over the run's cap of $0.30"), or that a cache miss did it within its bound.
|
|
68
|
+
- A run that passed its cap (`spend_cap_reached`) keeps the answer it paid for as `result.final_answer`, cut as it came. Before, its result was null.
|
|
69
|
+
- A run on a model with no price (a `--faux` module whose `cost` is `"unknown"`) costs unknown (`null`), never $0.
|
|
70
|
+
- Upgrading: nothing to change.
|
|
71
|
+
- A tool call the runner runs again after a crash meets the run's gate again. Before, a replay-safe call (web_search, web_fetch) that pi reran after a crash skipped the gate: a deny set since its first attempt didn't stop it, and a tool set to ask since ran it with no one's approval. Now a deny or a pin refuses the rerun in words saying the earlier attempt may have taken effect ("whether it took effect is not known"), never "nothing was sent", and a tool set to ask parks the run on it, the owner's answer then acting on it. A stop that lands while the rerun is asked wins over a permission that comes after it: the call never starts. Codex and Claude Code reruns say the same.
|
|
72
|
+
- A capped run that reads screenshots is no longer refused at its cap after the first one. A model request's input bound counted an image's base64 as one token per byte, and then the image's billed maximum on top. A 1280x720 screenshot (about a megabyte of base64) read as some 1.3 million input tokens, so a Sonnet step under a $1.50 cap "needed at least $4.83" when Claude bills it a few cents.
|
|
73
|
+
|
|
74
|
+
Each image, in every turn, now counts at what the routed model's provider can bill it as, in place of its data's bytes, whatever API carries it. The size comes from the image's own header (PNG, JPEG, GIF or WebP):
|
|
75
|
+
- Anthropic: its 28-pixel patches or its area at 750 pixels a token, whichever is more, at most 4,784.
|
|
76
|
+
- OpenAI: its 512-pixel tiles after resizing (85 + 170 each; 85 at detail low), or for a patch-billed mini or nano model its 32-pixel patches at that model's multiplier when more, at most 73,800.
|
|
77
|
+
- Google: 258 per 768-pixel tile, at least 1,120.
|
|
78
|
+
- Any other provider: the most of the three.
|
|
79
|
+
An image whose size can't be read counts at its provider's per-image maximum, never at its bytes. An image-shaped object outside where the API reads images (a tool call's arguments) is counted at its bytes, as text.
|
|
80
|
+
|
|
81
|
+
`InputShape.images` (the kernel host's `providerInputOverhead`) is now a list of images, each with the bytes its data takes and its size when known; `InputShape.model` names the routed model; the figure can be below 0, and so can a policy's `serverInputOverhead`, never past the body's bytes. Upgrading: pass `images: [{ bytes, width?, height? }]`, built with `imageInputOf`, `messagesImagesIn` or `responsesImagesIn`, and the model, in place of a count.
|
|
82
|
+
- Three fixes found by running again the tests the cutover skipped:
|
|
83
|
+
- A paid tool call's cost row on a run's timeline names the tool it ran (`web_search`, `web_fetch`) in its `tool_name` and its words, as the API docs say. Before, it named the fee ("Parallel's search").
|
|
84
|
+
- Saving an agent whose workflow the DSL can't read, with `POST /v2/agents` or `PUT /v2/agents/{agent_id}/definition`, answers 422 on `definition.workflow` in the DSL's words. Before, it answered 500.
|
|
85
|
+
- The contract's form of `PUT /v2/agents/{agent_id}/definition` takes any `version` past the current revision's, as the contract says; the revision is numbered the next. Before, a version further on than the next was refused 422.
|
|
86
|
+
- On a Postgres store, a write held up by the server process (its event loop busy with other work) no longer rolls back when the transaction itself was fine: its deadline, counted from the transaction's begin, counts only the time the process could run, as on SQLite. A lease's renew, whose deadline runs from its call, still counts the wall clock.
|
|
87
|
+
A pause longer than the database's idle-in-transaction timeout (the deadline plus 5 s) still ends the session at the database's end, which rolls the transaction back. The write now answers 409 `home_busy`, which is safe to retry, never a 500. A pause that ends just before the commit is credited to the commit's time too.
|
|
88
|
+
- Upgrading: nothing to change.
|
|
89
|
+
- Template follow-ups after launch:
|
|
90
|
+
- `release-notes` makes its own GitHub trigger: each release published on the repository it was applied to starts its notes (only that repository's). Applied where GitHub is not connected, the agent is made and the trigger is skipped with a warning. The GitHub App that Connect GitHub makes now subscribes to `release` events too, beside pull requests and comments.
|
|
91
|
+
- Upgrading: an App connected before this release is not subscribed to releases, so its release-notes trigger never fires. In GitHub, open the App's settings, then Permissions & events, tick Release under Subscribe to events, and save.
|
|
92
|
+
- A skipped GitHub trigger's warning says what it would run on, in the template's own words ("…so it runs by itself: Release notes runs on each release to acme/widgets."), never "review pull requests" for every template.
|
|
93
|
+
- New eval cases: `code-review/mentions-defused` (a review of a PR whose body and diff mention people and a team posts no plain @-mention) and `kyb/opensanctions-on` (with OpenSanctions on, its pages are an index cited as aggregators, the list owners' records stay the evidence, and the licence is stated); `kyb/clean-public-company` checks that with it off, opensanctions.org is never touched.
|
|
94
|
+
- A workflow run on the runner whose decision's provider reported no cost now saves its cost as unknown, not as the decision's hold. The run's end cost read the cap's own figure for its decisions, which counts a decision of no reported cost at its hold, so a run saved the hold (a guess) as a known cost. It now reads its decisions' cost from their booking records, as a pi or CLI run does: an unknown charge leaves the run's cost unknown. The cap still counts such a decision at its hold, so the run's cap is kept as before.
|
|
95
|
+
- What a run shows on the runner is right again:
|
|
96
|
+
- A run a provider's content filter stopped fails `moderated`, in words a person can act on ("The model provider stopped this answer (its content filter). Rephrase the request, or try another model."), on every harness. It failed `run_failed` in the provider's words. The Timeline's error row keeps them.
|
|
97
|
+
- An escalated run's `review` names the escalate node's kind, its label and its summary (`{kind: "review", node: "too big", reason: "needs a person"}`), in the run, in the lists and after a restart. It read `kind: null, node: null` and the reason "escalated at <node>".
|
|
98
|
+
- `GET /runs/{id}/graph` lists a workflow's call nodes' calls in `effects` again, each with its status and, for a refused one, the gate's words. The runner kept no node log, so every workflow run's `effects` was empty.
|
|
99
|
+
- An `llm` call's answer names the model it ran on as the run names it (`faux/faux-strong`), not the runner's internal session provider (`workflow-session-strong/faux-strong`).
|
|
100
|
+
- A workflow run refused for a wrong-typed input field (`input at #/properties/question`) is offered an input its workflow takes (`example`), as a missing or wrong-shaped input already was.
|
|
101
|
+
- Most of the learning tests that were skipped for the CLI harnesses run again. A test's harness table now reaches the in-process runner with or without the faux model, so a CLI run on a gateway runs on the test's harness, never on an installed CLI. These now pass: learned_workflow on claude-agent and codex, the gateway route on codex and opencode, both capped-codex cases, the side-call and claude-agent proxy cases, the real-adapter ask-and-allow cases, and the usage meter. Their checks of root entries the old per-run process wrote now read the runner's request records. Four cases that can't run on the in-process runner are gone, each still covered elsewhere:
|
|
102
|
+
- a learned call set to ask on the faux CLI harness, which asks no gate: covered by learned-route-real's real-adapter ask-and-allow cases on claude-agent and codex;
|
|
103
|
+
- a call cut off with its process, which would kill the test's own process: covered by the kernel's runner tests (a request a crash cut off is booked once, cut) and learned_workflow's never-replay case;
|
|
104
|
+
- claude-agent on OpenRouter alone, which needs a preload in a separate run process: covered by openrouter-route's or-1 and the kernel's side-key test;
|
|
105
|
+
- a call beside learned_workflow staying on its answer, which read the old root entries: covered by the kernel's side-key test (a side request is never the turn's answer).
|
|
106
|
+
Three sites in learn-workflow-run stay skipped, under reasons of their own: the two claude-agent native-search cases (:369, :383) wait on #2458, and the allow-before-the-parked-result race (:430, on codex and claude-agent) waits for the faux harness to ask the gate. learned-route's R2 and R3 no longer check the network guard: its preload can't reach an in-process runner, so those checks proved nothing.
|
|
107
|
+
Upgrading: nothing to do.
|
|
108
|
+
- The learning docs' "Coming" list no longer names what is on main: a grade that contradicts itself is asked once more, and a learned workflow's call node runs a granted MCP tool under the run's gate, each now in the learning section's text; the checker's refusal of a bank account, IBAN, routing or sort-code number is said beside the grader's rule. What a run's own draft may call of MCP stays under "Coming".
|
|
109
|
+
- The server README's GPU section says what a Daytona GPU sandbox is: one `H100` from Daytona's `daytona-gpu` snapshot, with its 16 vCPUs, 100 GiB of memory and 400 GiB of disk, and no mount, so this server refuses a Daytona sandbox with a `gpu` where its run folder is an Archil mount. It used to list six GPU types, up to eight, at 192 GiB of memory and 512 GiB of disk each.
|
|
110
|
+
- Each computer provider is now declared once, in a descriptor (`defineProvider`: its id, label, keys and the option each fills, settings, mounts, configurations, default images, whether it prepares its image, runs on this host or takes a ledger, and a lazy `load()`), and the registry and the kind registry's `PROVIDERS` are derived from the descriptors. `ProviderId` is any string; the built-in ids are `BuiltinProviderId`. The server reads every provider from its descriptor and names none, and an agent's computer can name an image a provider's configurations offer.
|
|
111
|
+
|
|
112
|
+
Who breaks, and what to do:
|
|
113
|
+
|
|
114
|
+
- The package root no longer exports the provider classes or their option types. Import `DockerProvider`, `DaytonaProvider`, `ModalProvider`, `BrowserbaseProvider`, `KernelProvider` and their helpers from the provider's subpath (`@parcha/agentrun-computer/docker`, `/daytona`, `/modal`, `/e2b`, `/orgo`, `/orgo-desktop`, `/phone-harness`, `/browserbase`, `/kernel`), or build a provider by id with `providerFor(id, options)`. Their option types (`DockerProviderOptions`, `ModalSdk` and the like) come from the same subpaths. Each provider's default image (`DAYTONA_DEFAULT_SNAPSHOT`, `MODAL_DEFAULT_IMAGE`, `E2B_BASE_TEMPLATE`, `ORGO_BASE_IMAGE`, `PHONE_IMAGE`, `BROWSER_IMAGE` and so on) is its descriptor's, exported from the root and no longer from its provider module. `ProviderKey` is gone: use `DescriptorKey`.
|
|
115
|
+
- A vendor's own failure is now code `vendor`, with the provider's id in the error's `vendor` field, where it was code `docker`, `daytona`, `modal`, `e2b`, `orgo` or `phone`. Match on `code === "vendor"` and read `vendor`. Settings → Computers' test reads it as "<provider> answered with an error"; an old code has no words of its own.
|
|
116
|
+
- `ComputerSpec.lifetimeMs` is optional in the type: a run's computer still needs it (`checkTenure`, which replaces `checkLifetime` in a provider's `check()`, refuses a spec without it), and an agent's computer has none.
|
|
117
|
+
- A provider whose descriptor declares `prepareImage` has `prepareImage()`, the image a computer starts from, built or pulled (Docker's is its `image()`). The server calls it before the first create and refuses the computer in words when it is missing; nothing looks for an `image()` method instead.
|
|
118
|
+
- Orgo offers Linux desktops only: its Windows and macOS desktops are parked (the descriptor's new `parked` list). An agent whose computer names Orgo's `windows` or `macos` image is refused at its run's start in words saying the desktop is parked and naming the image Orgo offers, `linux`; Settings → Computers lists no Windows image. `create({ os: "windows" })` and `create({ os: "macos" })` still build their providers, for the conformance suite.
|
|
119
|
+
- Local Chrome, the keyless local browser that 0.1.0-beta.34 shipped as the provider `local`, is the provider `local-chrome` (its descriptor `descriptors/local-chrome.ts`; `LocalBrowserProvider` from `@parcha/agentrun-computer/local-chrome`, its provider id's subpath; `./local` is gone): an agent's computer names `{ kind: "browser", provider: "local-chrome" }`, and one saved as `provider: "local"` is refused at its run's start as a provider this server does not know: set it to `local-chrome`.
|
|
120
|
+
- A provider module no longer exports `NETWORK`: the networks a provider makes are its descriptor's `network` (`ORGO.network`, for one), which the kind registry's entry carries and of which each built provider's `capabilities().network` is its own configuration's. Its conformance names are `AGENTRUN_COMPUTER_LIVE_LOCAL_CHROME`, `COMPUTER_LOCAL_CHROME_PATH` and `COMPUTER_LOCAL_CHROME_HEADED`. A descriptor's `hostEnv` names the server's own environment variables its provider reads on this machine (Local Chrome's Chrome lookup), which the server passes as `options.env`.
|
|
121
|
+
- Orgo computers made by a release before this one are swept at the next janitor pass; release them before upgrading. An Orgo computer's deadline is the one in its name alone, never Orgo's own end (`ends_at`) or its labels file, so one whose name carries none is a run's computer with no deadline, which the janitor ends.
|
|
122
|
+
|
|
123
|
+
Persistent computers are in the provider contract: `capabilities().persistence`, `spec.owner` (`{ agent, idleTtlMs? }`, labelled `agentrun.owner=agent:<id>`), `release(ref, "detach")`, `attach(ref, { claim })` under a new claim epoch, and on `ComputerInfo` `owned`, `owner` and `detachedAt`. Every built-in provider refuses `spec.owner` and `detach` in words; none declares persistence yet. `sweep` never deletes an agent's computer by a deadline, only when `ownerGone(agent)` says so or after its owner's idle TTL; `releaseOlder` detaches an agent's computer instead of deleting it (`ReleasedOlder.detached`). Only a provider that declares persistence has agents' computers: of one that does not, an owner label a caller put on a run's spec keeps nothing from the janitor. The conformance suite adds `provider.owner` and `provider.detach` (Core) and `provider.persistence` (Full, where persistence is declared). Docker's inspect read-back moves to `src/docker/inspect.ts`, with the same exports.
|
|
124
|
+
|
|
125
|
+
A configuration (`KindCapabilities`) may name the `image` an agent's setting selects it by and the create() `options` that build it (`imagesOf`, `configurationOf`). An agent's computer may name one: `computer: { kind, provider, image }`, such as `{ kind: "desktop", provider: "orgo", image: "linux" }`. It selects the provider's configuration of that name, built by its options beside the keys' (Orgo's `os`); absent, the kind's default. GET /computers lists each provider's `images` for the kind, the default first. An image the provider does not offer saves with a warning naming the ones it does, and its runs are refused at their start in the same words.
|
|
126
|
+
|
|
127
|
+
The server reads what each provider takes from its descriptor: its saved keys fill the options the descriptor names, a setting it declares (Modal's `modalApp`) fills its option from the server's settings or its default, the store's session ledger goes to a provider that declares one, and the image and host options go to one that declares `prepareImage` or `local`. A provider added to the computer package needs no server edit; an id no descriptor declares is refused.
|
|
128
|
+
|
|
129
|
+
Orgo's Windows desktop (parked: built, not offered to an agent): `create({ os: "windows", apiKey, workspaceId })` (`@parcha/agentrun-computer/orgo-desktop`) gives a desktop with daemon `none` that answers the protocol over Orgo's REST API. The screen is Orgo's screenshot; the pointer and keys are its click, drag, scroll, type and key calls; exec is its bash call, PowerShell, and the files methods go through PowerShell too. A cwd or variable that cannot be set runs nothing, and a move with overwrite replaces what is at its target as rename(2) does. Settings → Computers asks for Orgo's workspace beside its key: `ORGO_WORKSPACE_ID` fills `workspaceId`, which every Orgo provider is built with. The network is `open`, since Orgo has no egress control. Orgo's descriptor offers one configuration, `linux` (the default), and parks `windows` and `macos`. Nothing runs in a computer Orgo does not read running. What Orgo's API cannot do (a triple click, a held key) is refused in words. A `down` and its `up` become one click or drag, and a cancelled batch lets go of its press. Each Orgo provider's list keeps to its own system's desktops (Orgo's listing names each one's os), so no janitor sweeps another's. The conformance suite skips, in words, a case written for another system (`Case.os`, `caseOs`): the Linux exec and process cases, and the files cases on Windows. Such a skip (`CaseResult.os`) is not this computer's to pass or fail, so it leaves Core's verdict as an undeclared group's does. With `COMPUTER_ORGO_OS=windows`, `--kind desktop` runs the desktop's cases against a Windows fixture this package carries, a PowerShell script.
|
|
130
|
+
- A run whose bash has a policy (`tool_settings.bash.policy: "read-only"`) now runs each shell command on Archil's serverless exec (Mode 2, no computer) with its egress denied (`network: {egress: {default: "deny"}}`), so a command can reach the run's folder and nothing on the network. If the owner's Archil plan takes no network policy (a 403 such as `network_plan_required` on the Free plan), the command runs with the network open, and its stderr starts with one line saying so, with Archil's words in it. The workspace remembers the refusal and doesn't ask again. The read-only gate still holds either way. Only the shell's commands are denied: the server's own execs on the run's folder keep Archil's default network. A command on a local folder or in a computer can't be given a network policy, and a Workspace exec that asks for one there is refused before anything runs.
|
|
131
|
+
- The console's agent cards keep their chips on one row at every width: when a card's chips and its three actions don't fit side by side, the actions move to a row of their own and the chips keep theirs ("1 revision · 1 run" stacked one under the other at 820 px, and the Learning chip dropped under its counts at 1440 px). A real-browser flow (`agent-card-footer` in `npm run test:e2e`) measures every card at 1440, 1150, 820 and 390 px: each chip on one line, a card's chips on one row whenever that row fits, nothing past the card's right edge, every action the same square.
|
|
132
|
+
- A paid call the cap refused for room pauses the run with the run's spend as it is when the pause lands, and never refuses a person's answer to a question the same turn ended on:
|
|
133
|
+
- The budget card (and its words) count what calls beside the refused one charged before the model's next request, not the spend at the refusal. A call that would now fit (one beside it settled for less than it held) pauses nothing.
|
|
134
|
+
- A turn that ends on a question to the person (ask_person) with no next model request drops the refused call's pending pause, so the person's answer reaches the model and is never refused in that call's words, on this claim or the next.
|
|
135
|
+
- The kernel cap's refusal for a paid call names the call (`figures.step`: its name, hold and basis), and `paidRefusal` is exported, so a host can say a refusal again with the run's spend later.
|
|
136
|
+
- Security: on the runner, a claude-agent, codex or opencode run's CLI process now starts under `setpriv --no-new-privs`, as pi's commands do, so a setuid program or file capability that the CLI or a command it runs reaches grants nothing. It has been unconfined since the per-run process went. It uses pi's own rule (`noNewPrivsPrefix`, new in `@parcha/pi-durable-disk/internals`): Linux only, nothing on macOS, and on Linux a run is refused with pi's `SETPRIV_UNAVAILABLE` words where `/usr/bin/setpriv` (util-linux) is not usable.
|
|
137
|
+
- A separately started runner (`agentrun-serve runner`) no longer loads a faux module named in its environment. `AGENTRUN_SERVE_FAUX*` and `AGENTRUN_HARNESS_TABLE` left in an operator's shell or a platform's settings decided what a run answered. A runner now loads the faux model only from its own `--faux <module>`, as the server does. Test setups that gave a runner `AGENTRUN_SERVE_FAUX` pass `--faux` instead (`deploy/walk/compose.walk.yaml` does).
|
|
138
|
+
- A capped workflow run on the runner keeps three money rules it used to keep. A raise too small for the step that parked the run shows the new pause at the raised cap, not the launch cap, so the next raise is checked against the cap the run has. A decision whose OpenRouter catalog price can't be read for a moment is read again (three reads) before its node fails, and a catalog still down fails the node unsent, never as the cap's stop. A decision's hold is taken only after the workflow's driver has admitted its request, so a runner that dies in between no longer leaves a hold the next claim counts beside asking the decision again (a $0.40 decision was counted $0.80). In the DSL, a decision request that never left (an `unsent` refusal) now ends failed even when the run is stopping, so the next process asks it again instead of escalating it as asked and never answered.
|
|
139
|
+
|
|
5
140
|
## 0.1.0-beta.34 (2026-11-11)
|
|
6
141
|
|
|
7
142
|
- An agentic run's structured answer is its result: `result.output` on `GET /v2/runs/{id}` is no longer always null for an agentic run (#2145). An agentic definition takes `output_schema`, a JSON Schema of at most 64 KiB, refused at save when it does not compile or sits on a workflow. A completed run's `result.output` is its final answer's last fenced json block when that meets the schema, else null. An edit that leaves `output_schema` out keeps it. A template's answer schema (its manifest's `output`) is set on the agent at apply, so a template agent's runs now answer there. A triggered agentic run is also handed its trigger's last completed result after its message, as a fenced json block, so a repeat run (market monitor's weekly digest) leaves out what the last one reported (#2144). Only the same trigger's runs are read, and a result over 32 KiB is named but not handed.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ runner starts beside the server. The capabilities document (`GET /v2/capabilitie
|
|
|
9
9
|
|
|
10
10
|
## Quick start (no key, no network)
|
|
11
11
|
|
|
12
|
-
Node 24.
|
|
12
|
+
Node 24.22.3 or later. In a checkout of this repository:
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
15
|
npm ci --ignore-scripts && npm run build
|
|
@@ -752,11 +752,14 @@ this server's run folder says why there. The save checks the shape, and only a s
|
|
|
752
752
|
and the claim refuse a type or a count the provider does not give, in the computer package's `checkGpu` words, and the
|
|
753
753
|
computer is made with the GPUs asked.
|
|
754
754
|
|
|
755
|
-
- **Daytona** gives `H100`,
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
755
|
+
- **Daytona** gives one `H100`, the GPU of its GPU snapshot `daytona-gpu` (the computer package's `DAYTONA_GPU`:
|
|
756
|
+
`types: ["H100"]`, `max: 1`); another type or count needs a snapshot of its own, so it is refused. A GPU sandbox is
|
|
757
|
+
made from that snapshot, with its 16 vCPUs, 100 GiB of memory and 400 GiB of disk, in region `earth`. Stopping it
|
|
758
|
+
deletes it: it has no pause and no snapshot, so nothing on it outlives the run. A Daytona GPU may be preempted, so a
|
|
759
|
+
run on one can be cut short. The Daytona org needs GPU credits. It takes no mount (`mounts: []`: the snapshot's user
|
|
760
|
+
is not root and has no Archil client), so it can't hold the run's folder from Archil: in Mode 2 this server refuses a
|
|
761
|
+
Daytona sandbox with a `gpu`, and `GET /v2/computers` says why in Daytona's `gpu.why`. In Mode 1 a sandbox runs on
|
|
762
|
+
Docker only, so a Daytona GPU sandbox runs on neither mode's server today.
|
|
760
763
|
- **Modal** declares its GPUs, but a Modal GPU sandbox runs on gVisor, and the Archil mount the run's folder needs is not
|
|
761
764
|
proven there. So this server refuses a Modal sandbox with a `gpu` for now. A Modal GPU is also preemptible.
|
|
762
765
|
|
|
@@ -766,8 +769,10 @@ computer is made with the GPUs asked.
|
|
|
766
769
|
it, so a sandbox runs on Docker only; a Daytona, Modal or E2B sandbox is refused ("Mode 1 runs a sandbox only on
|
|
767
770
|
Docker").
|
|
768
771
|
- **Mode 2**: on your own Archil disk. `PUT /v2/workspace/archil` turns it on with the disk's id, its region, its S3 URL
|
|
769
|
-
(and an exec image pinned by digest, if you want one other than
|
|
770
|
-
`ARCHIL_API_KEY`; `DELETE` turns it off.
|
|
772
|
+
(and an exec image pinned by digest, if you want one other than serve's default), and the account key,
|
|
773
|
+
`ARCHIL_API_KEY`; `DELETE` turns it off. The default exec image is Docker's `buildpack-deps:trixie-scm` pinned by
|
|
774
|
+
digest (git 2.47), because Archil's own has git 2.34 and a read-only bash policy runs git only at 2.43 or later. An
|
|
775
|
+
image you name needs git 2.43 for that too, and GNU coreutils and perl, as Debian-family images have. A Daytona, Modal or E2B sandbox mounts the run's folder from the disk with a
|
|
771
776
|
mount credential minted for that run alone; Docker's sandbox is refused, since it cannot mount the disk.
|
|
772
777
|
|
|
773
778
|
A desktop, a phone and a browser run in either mode. The run's folder is at `/workspace` in every computer that mounts
|
|
@@ -1806,7 +1811,7 @@ GitHub template) uses it. In the console, Connect GitHub calls `POST /v2/integra
|
|
|
1806
1811
|
the App under an organization) and posts the form it answers to GitHub: `action`, GitHub's new-App page, and
|
|
1807
1812
|
`manifest`, which names a name GitHub lets the person edit, the server's public URL, its hook `/v2/hooks/github`, its
|
|
1808
1813
|
callback and setup URLs, the permissions (pull requests write; contents, metadata and issues read) and the events
|
|
1809
|
-
(`pull_request`, `issue_comment`). It needs the address GitHub can reach, `AGENTRUN_PUBLIC_URL` (`409 github_no_public_url`,
|
|
1814
|
+
(`pull_request`, `issue_comment`, `release`). It needs the address GitHub can reach, `AGENTRUN_PUBLIC_URL` (`409 github_no_public_url`,
|
|
1810
1815
|
"GitHub can't reach this server: set its public URL first"), a seal key (`409 github_no_seal_key`, naming
|
|
1811
1816
|
`AGENTRUN_SEAL_KEY`), and no App connected already (`409 github_already_connected`, "This server already has a GitHub
|
|
1812
1817
|
App. Disconnect it first."), and a request at the public URL itself, where GitHub sends the browser back
|
|
@@ -1913,7 +1918,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
1913
1918
|
| `GET /health` | Without a credential: whether the store reads and the disk has room ([capacity and health](#capacity-and-health)). |
|
|
1914
1919
|
| `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. |
|
|
1915
1920
|
| `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. |
|
|
1916
|
-
| `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, and `cap_mode`, how such a cap prices a request, `expected` or `strict` ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced json block meets, 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 trigger starts is handed that trigger's last completed `result.output` after its message. 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)). |
|
|
1921
|
+
| `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, and `cap_mode`, how such a cap prices a request, `expected` or `strict` ([spend cap](#spend-cap)), `max_tool_calls` (agentic only, on pi): the tool calls each conversation of a run may make ([tool-call budget](#tool-call-budget)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced json block meets, 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 trigger starts is handed that trigger's last completed `result.output` after its message. 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)). |
|
|
1917
1922
|
| `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, name and description stay those it was made with. `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. |
|
|
1918
1923
|
| `GET /agents/{id}/revisions` | The agent's revisions, newest first: `revision`, `version`, `parent`, `kind`, `current`, `note`, `created_at` and the `definition`. |
|
|
1919
1924
|
| `POST /agents/{id}/current` | `{revision}`: one of the agent's revisions becomes current again. |
|
|
@@ -2474,6 +2479,10 @@ Each run of an agent that learns starts from `main` as it is when the run is mad
|
|
|
2474
2479
|
keys as it opens the run's own, from the server's environment first and then its saved keys, for the run's tools alone:
|
|
2475
2480
|
never for its model or a CLI harness's own environment. A provider the run's tool gate denies gets no key. Learned
|
|
2476
2481
|
workflows can use them once decision nodes land (see Coming).
|
|
2482
|
+
A learned workflow's call node can run an MCP tool the agent grants (`mcp:<server>/<tool>`) through the run's own MCP,
|
|
2483
|
+
under the run's tool gate: allowed, it runs at the run's tool cost; denied, the workflow is refused before any node
|
|
2484
|
+
runs; set to ask, the `learned_workflow` call asks once, naming every such tool, and the run parks. A run's own draft
|
|
2485
|
+
can't call one yet: the checks admitting it are coming.
|
|
2477
2486
|
|
|
2478
2487
|
The server reads the commit with git plumbing, never the working tree. What it holds that is not a regular UTF-8 file of
|
|
2479
2488
|
1 MiB or less, or a note out of shape, is not read, and the server's stderr names it. A learning fault never blocks a
|
|
@@ -2537,11 +2546,14 @@ many notes the folder holds. No injection screen runs before it: a page classifi
|
|
|
2537
2546
|
from, and read a preference the user stated as a planted instruction; the grader's Planted question decides: a rule the
|
|
2538
2547
|
user states in their own words is theirs, even beside a form or a pasted email in the same message, and a rule found only
|
|
2539
2548
|
inside text the run read is planted and dropped, never held for the owner's OK. An item that holds an account number is
|
|
2540
|
-
dropped too, even where the user gave it as where money goes
|
|
2549
|
+
dropped too, even where the user gave it as where money goes; one with a bank account, IBAN, routing or sort-code number
|
|
2550
|
+
beside its word never reaches the grader, since the checks refuse it as they refuse a secret. The Risky question reads one way on every grade model: a
|
|
2541
2551
|
limit or threshold that decides whether an approval or a check happens is risky in either direction, as is an exemption
|
|
2542
2552
|
from a check, trusting or paying a named site or seller, or naming where money or data goes, whoever asked. What the
|
|
2543
2553
|
grade spends is in no run's totals, and is read once its request is booked: it is kept on the run's learning, and counted once on `GET /usage` under the meter
|
|
2544
2554
|
`learning`, by agent and by day; a call cut off at its bound spent what nobody knows, so its cost is unknown, never $0.
|
|
2555
|
+
A grade that contradicts itself (it keeps every item yet says not to merge) is asked once more, the contradiction named;
|
|
2556
|
+
a second contradiction drops the proposal, saying the review contradicted itself.
|
|
2545
2557
|
|
|
2546
2558
|
A kept verdict merges as one commit on `main`, made with plumbing: the new notes added, each with its `origin` (`you`
|
|
2547
2559
|
for what the user asked in their own words, `run` for what the run worked out), each note they supersede marked
|
|
@@ -2617,9 +2629,8 @@ proposed and reused, staleness after a rule changes, and wrong keeps after a pla
|
|
|
2617
2629
|
- A learned workflow may hold decision nodes (judge, pick, sift), answered by the run's decision provider under the run's cap (#2363).
|
|
2618
2630
|
- Consolidation: related notes merged into one, and a skill and its workflow brought back in step (#2335).
|
|
2619
2631
|
- A learned workflow's node of a tier runs on the server's model of that tier, at its own price (#2408).
|
|
2620
|
-
- A
|
|
2632
|
+
- A run's workflow draft may call a granted MCP tool: the checks admit it, and the grader holds one that writes for the owner's OK.
|
|
2621
2633
|
- A learned workflow keeps the output format its skill asks for (#2412).
|
|
2622
|
-
- A grade that contradicts itself is asked once more (#2425).
|
|
2623
2634
|
|
|
2624
2635
|
### What a person sees and controls
|
|
2625
2636
|
|
|
@@ -2667,6 +2678,17 @@ with the token, an archived agent's too:
|
|
|
2667
2678
|
too (`Approved-Via: console`). The learning view gives each item `last_change` (`{kind, by, at}`: `approved`,
|
|
2668
2679
|
`edited`, `created`, `retired` or `restored` by a `person`, or `learned` by a `run`) and each retired one `retired`
|
|
2669
2680
|
(`{at, by}`, the time of its retire, which an edit since moves not).
|
|
2681
|
+
- `POST .../learning/workflows/{name}/promote` (`{name?}`) makes an active learned workflow an agent of its own: a new
|
|
2682
|
+
agent, as `POST /agents` makes one, whose revision is a workflow revision of the workflow's `workflow.json`, so its
|
|
2683
|
+
runs run the workflow's nodes with no agent loop, answer the workflow's output, and can be started by a trigger or a
|
|
2684
|
+
pipeline like any agent's. Only an active one: a workflow that waits for its owner's OK, or was retired, is 409
|
|
2685
|
+
`learned_not_active`. Its files are checked again as a restore checks them, and its workflow as the learning checker
|
|
2686
|
+
checks a run's draft against the agent's tools and gate (400 with `problems`), then as any workflow revision's save
|
|
2687
|
+
(422, or 409 `agent_not_runnable`). The new agent's `tools` are the ones its call nodes call, and it keeps the source
|
|
2688
|
+
agent's policy as it is now (its `tool_settings`, `approvals`, `max_cost_usd` and `cap_mode`), never more. Its id is the
|
|
2689
|
+
workflow's name, with `-2`, `-3` and on past an agent's id or name already here, and its name `name` or the same. It
|
|
2690
|
+
answers 201 with the agent; the learned workflow stays in the folder, unchanged. It takes the owner's password session
|
|
2691
|
+
alone, as an approval does.
|
|
2670
2692
|
- `GET /runs/{run_id}/learning`: the run's learning whole (its `given`, `read` and `learned` as on its read, its seed, its merge, the grader's verdict with its item for
|
|
2671
2693
|
each new note, `{file, keep, question, why}`, `question` the rubric's question a dropped note failed, the checker's
|
|
2672
2694
|
problems, what the grade cost), `null` for a run that does not learn; `verdict` is `null` until a grade ran.
|
|
@@ -2742,6 +2764,19 @@ on claude-agent, codex and opencode the model proxy adds them to the body (after
|
|
|
2742
2764
|
prefix is unchanged). Neither CLI nor pi keeps them in its transcript, and no message is queued, so nothing runs after
|
|
2743
2765
|
the model's answer. Once per cap, across restarts; a raise re-arms it.
|
|
2744
2766
|
|
|
2767
|
+
A capped run also stops calling tools before its cap stops it. Once what it has spent, plus what its requests and paid
|
|
2768
|
+
steps still out are held at (their worst case, as the cap counts them, a browser session's open reserve included),
|
|
2769
|
+
reaches 75% of its cap, the run's tool gate
|
|
2770
|
+
refuses every call a model makes, in every conversation of the run, on every harness, before any setting or approval
|
|
2771
|
+
is read, with one fixed text: "Budget nearly spent: stop calling tools and answer now from what you have." A call that
|
|
2772
|
+
would open a child conversation is refused the same way, so no new one starts. Nothing in flight is cut: a child still
|
|
2773
|
+
working gets the same refusal on its next call and answers, a call a running tool makes is that tool's and runs, and
|
|
2774
|
+
model requests are judged by the cap as before, so the run's final answer still lands. The cap stays the last line: a
|
|
2775
|
+
request that does not fit what is left is refused as above. The figure is read from the run's booking records at each
|
|
2776
|
+
call, never kept in memory, so a restart or a claim moved to another runner holds the same line, and a raise moves it.
|
|
2777
|
+
Several requests out at once hold far more than they cost, which is why a fan-out of children used to end a small cap
|
|
2778
|
+
with no answer at all; the quarter left above the line is the room for each of them, and the parent, to answer.
|
|
2779
|
+
|
|
2745
2780
|
Under a cap each request is limited to the
|
|
2746
2781
|
output tokens what is left of the cap can buy, thinking included, never more than it asks for or than the model's
|
|
2747
2782
|
ceiling (its max output tokens, else its context window, clamped to what the window leaves): on pi through the request's
|
|
@@ -2751,9 +2786,33 @@ so the cap stays exact. A request is refused only when what is left cannot buy i
|
|
|
2751
2786
|
tokens for its answer (what it asks for, when that is fewer), and when it thinks, the provider's least thinking budget
|
|
2752
2787
|
where thinking takes one (Anthropic's, 1,024, the budget squeezed to it at the least) or else its thinking level's
|
|
2753
2788
|
budget, since its reasoning then shares the limit (minimal 1,024, low 2,048, medium 8,192, high 16,384). The input bound is one token per UTF-8 byte of what is sent (a byte-level tokenizer never makes
|
|
2754
|
-
a token of less than one byte,
|
|
2755
|
-
server-side (a tool-use prompt
|
|
2756
|
-
the proxy measures each request's body.
|
|
2789
|
+
a token of less than one byte), each image counted at what its model's provider bills it by its size in place of its
|
|
2790
|
+
base64's bytes, plus what the provider adds server-side (a tool-use prompt), from the same table the model proxy of
|
|
2791
|
+
claude-agent, codex and opencode uses; there the proxy measures each request's body. On a route straight to Anthropic
|
|
2792
|
+
(`https://api.anthropic.com`, on pi and claude-agent), each answer request is also counted by Anthropic's own free
|
|
2793
|
+
token count (`POST /v1/messages/count_tokens`, with only the credential and version headers, and never through a
|
|
2794
|
+
gateway or any other base), and its bound is that count plus the tool-use prompt when that is below its bytes. A count
|
|
2795
|
+
that fails or takes over 3 seconds leaves the byte bound; the request is never held up or refused for it.
|
|
2796
|
+
|
|
2797
|
+
**The smallest cap that works.** The byte bound reads text as about two to three times the tokens it is billed as, and a
|
|
2798
|
+
step is sent only when the run's spend plus that step's least (its input bound, priced by the cap mode, and a 1,024-token
|
|
2799
|
+
answer) fits. So a small cap pauses a run well before it has spent it. Measured on a pi desktop run on Sonnet ($3 / $15,
|
|
2800
|
+
cache write $3.75, cache read $0.30 a million) through the dispatch's own system prompt and tools, five requests (four
|
|
2801
|
+
screenshots, then the answer), spending about $0.04 in all:
|
|
2802
|
+
|
|
2803
|
+
| Cap mode | Route | First request needs | Five-step run needs | Each further step |
|
|
2804
|
+
| --- | --- | --- | --- | --- |
|
|
2805
|
+
| `strict` | Through a gateway (OpenRouter): the byte bound | $0.05 | $0.11 | about $0.013 |
|
|
2806
|
+
| `strict` | Straight to Anthropic: Anthropic's count | $0.03 | $0.09 | about $0.012 |
|
|
2807
|
+
| `expected` (the default) | Either | as `strict` | as `strict` until #2504 lands | as `strict` until #2504 lands |
|
|
2808
|
+
|
|
2809
|
+
In `strict` mode every step's whole input is priced at the cache-write price. The `expected` row is today's: the runner
|
|
2810
|
+
does not yet price a step from what the previous request read from the cache, as `expected` is described above, so it
|
|
2811
|
+
prices like `strict` until #2504 lands. Once it does, a five-step run in `expected` mode needs about $0.06 by either route,
|
|
2812
|
+
and about $0.007 a further step. A claude-agent run's first request is of the same size (the pinned
|
|
2813
|
+
CLI's measured 6,926 bytes with five tools: $0.04 for its first request through a gateway). A cap below these pauses at
|
|
2814
|
+
once with `Not sent: ... the next step needs at least $X`, and a raise to that figure sends it on.
|
|
2815
|
+
`packages/serve/test/cap-minimum.test.mjs` holds these figures to what the cap does. A request in flight holds what it was admitted at until it answers, so requests
|
|
2757
2816
|
sent side by side cannot pass the cap together. Spent so far is read from the run's store each time its process starts, so it
|
|
2758
2817
|
survives a restart, plus each response since, and with them each charge a paid tool booked (`monid.run`, which is itself
|
|
2759
2818
|
refused once the spend reaches the cap; see [monid](#tools)).
|
|
@@ -2937,6 +2996,15 @@ OpenRouter Decisions model the catalog lists no price for: `409 agent_not_runnab
|
|
|
2937
2996
|
node's label and its fix. A step no cap fixes all the same (a spend no one knows) ends the run `failed`,
|
|
2938
2997
|
`spend_cap_reached`, in the cap's words, after the node's label.
|
|
2939
2998
|
|
|
2999
|
+
## Tool-call budget
|
|
3000
|
+
|
|
3001
|
+
An agentic definition's `max_tool_calls: N` gives each conversation of its runs on pi N tool calls: the run's own, and
|
|
3002
|
+
each conversation a tool opens, counted apart. Past N the run's tool gate refuses every call before it runs, before
|
|
3003
|
+
any setting or approval is read, with one fixed text: the budget is spent, don't call another tool, answer now from
|
|
3004
|
+
what you have. That refusal is not counted and never ends the run, so the model's next answer is the turn's. The count
|
|
3005
|
+
is read from the conversation's committed journal, so a restart or a claim moved to another runner keeps it. Above 0
|
|
3006
|
+
sets the budget, 0 clears it, an edit that leaves it out keeps it; a workflow's, or one on another harness, is `422`.
|
|
3007
|
+
|
|
2940
3008
|
## The faux model
|
|
2941
3009
|
|
|
2942
3010
|
`--faux MODULE` loads `MODULE` in each run's process. Its default export is called for every model request with the
|
package/dist/adapters.d.ts
CHANGED
|
@@ -81,6 +81,9 @@ export type AdapterNeeds = {
|
|
|
81
81
|
skills?: readonly SkillFiles[];
|
|
82
82
|
unpriced?: ReadonlySet<string>;
|
|
83
83
|
};
|
|
84
|
+
/** The ConfineChild that starts a child under `prefix` (the argv pi's commands start under, ending in "--"); none when
|
|
85
|
+
* the run confines nothing (macOS), since an adapter refuses a confinement that adds nothing. */
|
|
86
|
+
export declare function confineOf(prefix: readonly string[]): ConfineChild | undefined;
|
|
84
87
|
/** The model key a run on `harness` (one on an adapter, by its wire's route) of `model` (the revision's; none, the host's default for the
|
|
85
88
|
* harness) takes: the one its requests carry on the route its provider below takes, as key-refusal.ts' runKeyOf names
|
|
86
89
|
* it. codex: the gateway's when AGENT_MODEL_BASE_URL is set, else OpenAI's, or OpenRouter's on OpenRouter's route;
|
package/dist/adapters.js
CHANGED
|
@@ -159,6 +159,13 @@ function unavailable(facts, error, npx, env) {
|
|
|
159
159
|
const hinted = installHint(said, facts.install.npmLine, facts.install.spec, npx, env);
|
|
160
160
|
return new HarnessUnavailable(hinted, hinted === said ? fixOf(facts, error) : undefined);
|
|
161
161
|
}
|
|
162
|
+
/** The ConfineChild that starts a child under `prefix` (the argv pi's commands start under, ending in "--"); none when
|
|
163
|
+
* the run confines nothing (macOS), since an adapter refuses a confinement that adds nothing. */
|
|
164
|
+
export function confineOf(prefix) {
|
|
165
|
+
if (!prefix.length)
|
|
166
|
+
return undefined;
|
|
167
|
+
return (child) => ({ command: prefix[0], args: [...prefix.slice(1), child.command, ...child.args] });
|
|
168
|
+
}
|
|
162
169
|
/** The model key a run on `harness` (one on an adapter, by its wire's route) of `model` (the revision's; none, the host's default for the
|
|
163
170
|
* harness) takes: the one its requests carry on the route its provider below takes, as key-refusal.ts' runKeyOf names
|
|
164
171
|
* it. codex: the gateway's when AGENT_MODEL_BASE_URL is set, else OpenAI's, or OpenRouter's on OpenRouter's route;
|
package/dist/agent-rows.d.ts
CHANGED
package/dist/agents-store.js
CHANGED
|
@@ -114,6 +114,8 @@ function revisionInputOf(definition, files) {
|
|
|
114
114
|
...(typeof definition.thinking === "string" ? { thinking: definition.thinking } : {}),
|
|
115
115
|
...(definition.approvals === "ask" || definition.approvals === "never" ? { approvals: definition.approvals } : {}),
|
|
116
116
|
...(isObject(definition.output_schema) ? { outputSchema: definition.output_schema } : {}),
|
|
117
|
+
// The tool-call budget (tool-budget.ts): 0 keeps none.
|
|
118
|
+
...(typeof definition.max_tool_calls === "number" && definition.max_tool_calls > 0 ? { maxToolCalls: definition.max_tool_calls } : {}),
|
|
117
119
|
...common,
|
|
118
120
|
...learning,
|
|
119
121
|
...capped,
|
|
@@ -131,6 +133,12 @@ function checkVersion(definition, version) {
|
|
|
131
133
|
throw invalid([{ field: "definition.version", reason: "not_an_option", message: `definition.version is ${version} here: the number of the revision this definition leaves current` }]);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
136
|
+
/** The contract's `definition.version` on an edit: past `current`, the number of the agent's current revision. */
|
|
137
|
+
function checkPast(definition, current) {
|
|
138
|
+
if (typeof definition.version === "number" && definition.version <= current) {
|
|
139
|
+
throw invalid([{ field: "definition.version", reason: "not_an_option", message: `definition.version is past ${current} here: the current revision's number` }]);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
134
142
|
/** Whether committing `next` would leave the agent's current revision unchanged: the same kind and body (skills are in the
|
|
135
143
|
* body as their SHA-256, so equal files are an equal body — and equal pins an equal body, keys sorted by the validator). */
|
|
136
144
|
function sameRevision(current, next) {
|
|
@@ -251,7 +259,12 @@ export async function commitAgent(store, read, { definition, skills, note }, { i
|
|
|
251
259
|
checkVersion(definition, now.version);
|
|
252
260
|
return now;
|
|
253
261
|
}
|
|
254
|
-
|
|
262
|
+
// The contract's form takes any version past the current one (the revision is numbered the next all the same); the
|
|
263
|
+
// server's own form names the next revision's number, or none.
|
|
264
|
+
if (contract)
|
|
265
|
+
checkPast(definition, now.version);
|
|
266
|
+
else
|
|
267
|
+
checkVersion(definition, now.revisions + 1);
|
|
255
268
|
try {
|
|
256
269
|
await store.agents.addRevision({ agentId: agent.id, ifCurrent: base, ...revision });
|
|
257
270
|
return (await getAgent(store, agent.id));
|
|
@@ -285,6 +298,8 @@ function editOn(entry, definition, skills, note) {
|
|
|
285
298
|
// No approvals here: an edit that leaves them out asks (openapi.ts DefinitionInput.approvals),
|
|
286
299
|
// so no edit makes an agent unattended by saying nothing. The console's edit sends back the approvals it read.
|
|
287
300
|
...(definition.max_cost_usd === undefined && currentBody.maxCostUsd !== undefined ? { max_cost_usd: currentBody.maxCostUsd } : {}),
|
|
301
|
+
// A tool-call budget is a limit too: an edit of an agentic revision that leaves it out keeps it.
|
|
302
|
+
...(definition.max_tool_calls === undefined && current.kind === "agentic" && !isObject(definition.workflow) && currentBody.maxToolCalls !== undefined ? { max_tool_calls: currentBody.maxToolCalls } : {}),
|
|
288
303
|
...(definition.cap_mode === undefined && currentBody.capMode !== undefined ? { cap_mode: currentBody.capMode } : {}),
|
|
289
304
|
// The structured answer's schema is the agent's contract with its callers: an edit that leaves it out keeps it.
|
|
290
305
|
...(definition.output_schema === undefined && current.kind === "agentic" && !isObject(definition.workflow) && currentBody.outputSchema !== undefined ? { output_schema: currentBody.outputSchema } : {}),
|
|
@@ -331,7 +346,7 @@ export function definitionOf(agent, revision, version) {
|
|
|
331
346
|
...(body.capMode !== undefined ? { cap_mode: body.capMode } : {}),
|
|
332
347
|
};
|
|
333
348
|
const kindBody = revision.kind === "agentic"
|
|
334
|
-
? { instructions: body.instructions, ...(body.model ? { model: body.model } : {}), ...(body.thinking ? { thinking: body.thinking } : {}), ...(body.learning !== undefined ? { learning: body.learning } : {}), ...(body.outputSchema !== undefined ? { output_schema: body.outputSchema } : {}), ...common }
|
|
349
|
+
? { instructions: body.instructions, ...(body.model ? { model: body.model } : {}), ...(body.thinking ? { thinking: body.thinking } : {}), ...(body.learning !== undefined ? { learning: body.learning } : {}), ...(body.outputSchema !== undefined ? { output_schema: body.outputSchema } : {}), ...(body.maxToolCalls !== undefined ? { max_tool_calls: body.maxToolCalls } : {}), ...common }
|
|
335
350
|
: { workflow: body.workflow, ...common };
|
|
336
351
|
return {
|
|
337
352
|
id: agent.id,
|
|
@@ -4,11 +4,21 @@ export declare const ARCHIL_SETTINGS_KEY = "archil";
|
|
|
4
4
|
/** The sealed-key row of the Archil account key (the file API and exec), saved through server-keys.ts. Named *_ROW: a
|
|
5
5
|
* constant named like a key holding a string reads as a literal credential to the source export. */
|
|
6
6
|
export declare const ARCHIL_API_KEY_ROW = "archil.api_key";
|
|
7
|
+
/** The exec image a Mode 2 server runs commands in when the owner saved none: Docker's official
|
|
8
|
+
* `buildpack-deps:trixie-scm` (Debian 13 with git 2.47.3, GNU coreutils, perl-base, grep, sed, mawk, diffutils and
|
|
9
|
+
* findutils; no ripgrep), pinned to the multi-arch index digest Docker Hub served for that tag on 2026-11-11. Archil's
|
|
10
|
+
* own default exec image has git 2.34.1, and a shell under a bash policy runs git only at 2.43 or later (bash-read-only.ts
|
|
11
|
+
* POLICY_GIT_FLOOR), so a read-only agent there would get no git. Its git was read from the top layer's
|
|
12
|
+
* /var/lib/dpkg/status for amd64 and arm64 alike (`git 1:2.47.3-0+deb13u1`). To move it, read the tag's index digest
|
|
13
|
+
* again (an anonymous pull token from auth.docker.io for `repository:library/buildpack-deps:pull`, then a HEAD of
|
|
14
|
+
* registry-1.docker.io/v2/library/buildpack-deps/manifests/trixie-scm accepting an OCI index: its
|
|
15
|
+
* `docker-content-digest`), check the git its layers hold, and put it here. An image the owner saved replaces it. */
|
|
16
|
+
export declare const DEFAULT_ARCHIL_EXEC_IMAGE = "buildpack-deps@sha256:4f34e1d673fdb65371de9f88bdd32c4e30152fe692b35604aef5c0b3c0e6da10";
|
|
7
17
|
export interface ArchilSettings {
|
|
8
18
|
readonly diskId: string;
|
|
9
19
|
readonly region: string;
|
|
10
20
|
readonly s3Url: string;
|
|
11
|
-
/** A pinned image for the disk's exec, when the owner set one; absent,
|
|
21
|
+
/** A pinned image for the disk's exec, when the owner set one; absent, DEFAULT_ARCHIL_EXEC_IMAGE. */
|
|
12
22
|
readonly image?: string;
|
|
13
23
|
}
|
|
14
24
|
/** The Archil settings the owner saved, or undefined when none is (Mode 1). A row that is not the expected shape reads as
|
package/dist/archil-settings.js
CHANGED
|
@@ -3,6 +3,16 @@ export const ARCHIL_SETTINGS_KEY = "archil";
|
|
|
3
3
|
/** The sealed-key row of the Archil account key (the file API and exec), saved through server-keys.ts. Named *_ROW: a
|
|
4
4
|
* constant named like a key holding a string reads as a literal credential to the source export. */
|
|
5
5
|
export const ARCHIL_API_KEY_ROW = "archil.api_key";
|
|
6
|
+
/** The exec image a Mode 2 server runs commands in when the owner saved none: Docker's official
|
|
7
|
+
* `buildpack-deps:trixie-scm` (Debian 13 with git 2.47.3, GNU coreutils, perl-base, grep, sed, mawk, diffutils and
|
|
8
|
+
* findutils; no ripgrep), pinned to the multi-arch index digest Docker Hub served for that tag on 2026-11-11. Archil's
|
|
9
|
+
* own default exec image has git 2.34.1, and a shell under a bash policy runs git only at 2.43 or later (bash-read-only.ts
|
|
10
|
+
* POLICY_GIT_FLOOR), so a read-only agent there would get no git. Its git was read from the top layer's
|
|
11
|
+
* /var/lib/dpkg/status for amd64 and arm64 alike (`git 1:2.47.3-0+deb13u1`). To move it, read the tag's index digest
|
|
12
|
+
* again (an anonymous pull token from auth.docker.io for `repository:library/buildpack-deps:pull`, then a HEAD of
|
|
13
|
+
* registry-1.docker.io/v2/library/buildpack-deps/manifests/trixie-scm accepting an OCI index: its
|
|
14
|
+
* `docker-content-digest`), check the git its layers hold, and put it here. An image the owner saved replaces it. */
|
|
15
|
+
export const DEFAULT_ARCHIL_EXEC_IMAGE = "buildpack-deps@sha256:4f34e1d673fdb65371de9f88bdd32c4e30152fe692b35604aef5c0b3c0e6da10";
|
|
6
16
|
/** The Archil settings the owner saved, or undefined when none is (Mode 1). A row that is not the expected shape reads as
|
|
7
17
|
* undefined, never a half-configured Mode 2. */
|
|
8
18
|
export async function loadArchilSettings(store) {
|
package/dist/bash-read-only.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
/** The policies an agent may set on bash (tool_settings.bash.policy). */
|
|
2
2
|
export declare const BASH_POLICIES: readonly ["read-only"];
|
|
3
3
|
export type BashPolicy = (typeof BASH_POLICIES)[number];
|
|
4
|
+
/** An agent's bash policy as its own tool settings write it (tool_settings.bash.policy), or undefined for none: any
|
|
5
|
+
* value, a policy this server does not know too (the gate refuses its every call; policyEnv holds its shell all the same). */
|
|
6
|
+
export declare function bashPolicyOf(toolSettings: unknown): string | undefined;
|
|
7
|
+
/** The command-line config a shell under a policy gives git (GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n). */
|
|
8
|
+
export declare const POLICY_GIT_CONFIG: readonly (readonly [string, string])[];
|
|
9
|
+
/** What a shell under bash policy `policy` adds to the run's fixed environment (hands.ts shellEnv): git's config locked
|
|
10
|
+
* down (POLICY_GIT_CONFIG and the variables above); nothing without a policy. */
|
|
11
|
+
export declare function policyEnv(policy: string | undefined): Readonly<Record<string, string>>;
|
|
12
|
+
/** The oldest git that holds the whole lock-down (attr.tree). */
|
|
13
|
+
export declare const POLICY_GIT_FLOOR = "2.43";
|
|
14
|
+
/** What a shell under bash policy `policy` runs before the command, on a line of its own: `git` as a function that runs
|
|
15
|
+
* git only at POLICY_GIT_FLOOR or later. Empty without a policy. POSIX sh, for bash and the sh fallback alike. */
|
|
16
|
+
export declare function policyPrelude(policy: string | undefined): string;
|
|
4
17
|
/** The programs a read-only command may run. */
|
|
5
18
|
export declare const PROGRAMS: ReadonlySet<string>;
|
|
6
19
|
/** The programs a command may pipe into: filters of their input. */
|