@parcha/agentrun-serve 0.1.0-beta.29 → 0.1.0-beta.30
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 +188 -0
- package/README.md +564 -97
- package/dist/adapters.d.ts +35 -6
- package/dist/adapters.js +152 -26
- package/dist/agents.d.ts +11 -5
- package/dist/agents.js +16 -10
- package/dist/app.js +80 -20
- package/dist/background.d.ts +28 -0
- package/dist/background.js +376 -0
- package/dist/box-egress.d.ts +98 -0
- package/dist/box-egress.js +259 -0
- package/dist/box-image.d.ts +1 -1
- package/dist/box-image.js +9 -7
- package/dist/box-relay-vm.d.ts +80 -0
- package/dist/box-relay-vm.js +389 -0
- package/dist/box-relay.d.ts +8 -5
- package/dist/box-relay.js +14 -9
- package/dist/boxes.d.ts +21 -3
- package/dist/boxes.js +14 -7
- package/dist/browser-cost.d.ts +41 -0
- package/dist/browser-cost.js +158 -0
- package/dist/cap.d.ts +129 -21
- package/dist/cap.js +338 -67
- package/dist/coding-tools.d.ts +7 -3
- package/dist/coding-tools.js +16 -10
- package/dist/console/THIRD-PARTY-NOTICES.txt +580 -0
- package/dist/console/assets/index-34jfpIbQ.js +481 -0
- package/dist/console/assets/index-DUHbWcIP.css +1 -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-rows.d.ts +11 -3
- package/dist/decision-rows.js +18 -11
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +5 -2
- package/dist/files.d.ts +6 -1
- package/dist/files.js +7 -2
- package/dist/grade.d.ts +7 -10
- package/dist/grade.js +31 -51
- package/dist/graph-served.d.ts +23 -0
- package/dist/graph-served.js +75 -0
- package/dist/graph-view.d.ts +7 -5
- package/dist/graph-view.js +10 -3
- package/dist/harness-app.d.ts +4 -2
- package/dist/harness-app.js +101 -19
- package/dist/harness-opencode/adapter.d.ts +45 -0
- package/dist/harness-opencode/adapter.js +272 -0
- package/dist/harness-opencode/binary.d.ts +18 -0
- package/dist/harness-opencode/binary.js +87 -0
- package/dist/harness-opencode/config.d.ts +24 -0
- package/dist/harness-opencode/config.js +61 -0
- package/dist/harness-opencode/harness.d.ts +77 -0
- package/dist/harness-opencode/harness.js +620 -0
- package/dist/harness-opencode/host/mcp.d.ts +40 -0
- package/dist/harness-opencode/host/mcp.js +208 -0
- package/dist/harness-opencode/host/policy.d.ts +71 -0
- package/dist/harness-opencode/host/policy.js +419 -0
- package/dist/harness-opencode/host/server.d.ts +55 -0
- package/dist/harness-opencode/host/server.js +165 -0
- package/dist/harness-opencode/index.d.ts +9 -0
- package/dist/harness-opencode/index.js +6 -0
- package/dist/harness-opencode/verify.d.ts +32 -0
- package/dist/harness-opencode/verify.js +75 -0
- package/dist/harness-opencode/versions.d.ts +33 -0
- package/dist/harness-opencode/versions.js +64 -0
- package/dist/harness.d.ts +4 -1
- package/dist/harness.js +5 -2
- package/dist/host-tools.d.ts +12 -2
- package/dist/host-tools.js +26 -12
- package/dist/host.js +6 -2
- package/dist/hosted-search.js +5 -1
- package/dist/import.d.ts +2 -2
- package/dist/import.js +4 -3
- package/dist/key-check.d.ts +3 -2
- package/dist/key-check.js +7 -3
- package/dist/key-refusal.js +8 -4
- package/dist/learn/check.d.ts +10 -1
- package/dist/learn/check.js +19 -1
- package/dist/learn/grade.d.ts +3 -2
- package/dist/learn/grade.js +25 -13
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/notes.js +2 -1
- package/dist/learn/reflect.d.ts +2 -2
- package/dist/learn/reflect.js +51 -5
- package/dist/learn/secrets.js +28 -8
- package/dist/learn/skills.d.ts +17 -4
- package/dist/learn/skills.js +79 -6
- package/dist/learned-workflow.d.ts +59 -0
- package/dist/learned-workflow.js +191 -0
- package/dist/learning-run.d.ts +7 -5
- package/dist/learning-run.js +45 -23
- package/dist/learning-words.d.ts +6 -3
- package/dist/learning-words.js +8 -5
- package/dist/learning.d.ts +44 -3
- package/dist/learning.js +148 -3
- package/dist/mcp-servers.d.ts +7 -4
- package/dist/mcp-servers.js +5 -0
- package/dist/mcp.js +5 -5
- package/dist/model.d.ts +13 -11
- package/dist/model.js +11 -10
- package/dist/openapi/agentrun-v2.openapi.json +1 -0
- package/dist/openapi.js +358 -48
- package/dist/paid-calls.d.ts +5 -1
- package/dist/paid-calls.js +1 -1
- package/dist/pause.d.ts +2 -0
- package/dist/place.d.ts +27 -4
- package/dist/place.js +42 -10
- package/dist/propose.d.ts +2 -0
- package/dist/propose.js +38 -8
- package/dist/request-start.d.ts +12 -4
- package/dist/request-start.js +139 -15
- package/dist/run-box.d.ts +56 -4
- package/dist/run-box.js +173 -23
- package/dist/runnable.d.ts +5 -2
- package/dist/runnable.js +12 -4
- package/dist/runs.d.ts +258 -36
- package/dist/runs.js +830 -89
- package/dist/secrets.d.ts +12 -0
- package/dist/secrets.js +18 -0
- package/dist/server.d.ts +131 -35
- package/dist/server.js +467 -105
- package/dist/sign-ins.d.ts +99 -0
- package/dist/sign-ins.js +288 -0
- package/dist/skills.d.ts +16 -4
- package/dist/skills.js +35 -7
- package/dist/stats.d.ts +7 -2
- package/dist/stats.js +28 -7
- package/dist/tool-gate.d.ts +266 -0
- package/dist/tool-gate.js +554 -0
- package/dist/tool-keys.d.ts +46 -10
- package/dist/tool-keys.js +44 -2
- package/dist/tool-plane.d.ts +112 -27
- package/dist/tool-plane.js +205 -47
- package/dist/tools.d.ts +69 -14
- package/dist/tools.js +143 -24
- package/dist/trigger-secrets.d.ts +32 -0
- package/dist/trigger-secrets.js +143 -0
- package/dist/triggers.d.ts +439 -0
- package/dist/triggers.js +863 -0
- package/dist/turn-end.d.ts +3 -2
- package/dist/turn-end.js +3 -2
- package/dist/usage-lines.d.ts +26 -0
- package/dist/usage-lines.js +28 -0
- package/dist/validate.d.ts +2 -0
- package/dist/validate.js +11 -2
- package/dist/webhooks.d.ts +11 -4
- package/dist/webhooks.js +17 -1
- package/launcher/agentrun-serve +1 -1
- package/package.json +19 -13
- package/dist/console/assets/index-BN7oVcO4.js +0 -445
- package/dist/console/assets/index-By-jkqki.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,194 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.30 (2026-11-05)
|
|
6
|
+
|
|
7
|
+
- An agent can carry a default spend cap. A definition's `max_cost_usd` (agentic only) above 0 sets the agent's default, kept with its revision, as `maxCostUsd` on the agent store's agentic body, and read back in `GET /v2/agents/{agent_id}`; a run started with no `max_cost_usd` of its own takes its revision's default, and a run's own cap wins. An edit that leaves the field out keeps the agent's default, so leaving a field out never removes a spend limit, and only `max_cost_usd: 0` clears it (no default; through MCP's agents_revise too, where null is refused). A workflow definition with one above 0 is `422 not_allowed`, since a workflow run's spend is not capped here; 0 changes nothing there. A trigger's `start_run` target may now leave out `max_cost_usd` when its agent has a default: each firing takes the default as it stands when it starts, a target with neither is `422`, and a firing that finds neither fails rather than start an uncapped run.
|
|
8
|
+
- Background processes in a sandbox: an agent whose place is a sandbox may name `bash_background`, `bash_output`, `bash_input`, `bash_signal` and `bash_list`, to start a command that outlives one call (a dev server, a watcher, a long build), read its output in pages, write to its stdin, signal it and list what runs.
|
|
9
|
+
- `bash_background {command}` answers the process's id at once. Its stdout and stderr go to `work/background/<id>/output.log`, beside its `pid` and, once it ends, its `exit` code, so the run's files show each log during the run and after it.
|
|
10
|
+
- `bash_output {id, offset?, max_bytes?}` reads the log from a byte offset, at most 48 KiB a call, with whether the process still runs, its exit code, the log's size and the next offset. `bash_input {id, text, close?}` writes its stdin; `bash_signal {id, signal}` sends its process group `TERM`, `INT` or `KILL`.
|
|
11
|
+
- At most 8 run at once in a run's box, and each log keeps the first 16 MiB of the output: a ninth start is refused in words.
|
|
12
|
+
- The run's end ends every one of them (`TERM`, then `KILL` after 3 s) before its box is copied back and destroyed, and each log stays in the run's files.
|
|
13
|
+
- Each call is one short command in the box, on the same path as `bash`, so they work on every box that runs `bash`, and the permission gate takes each call as it takes `bash`'s.
|
|
14
|
+
- Browser minutes count in a run's spend. Each charge of a `browser` session's time is booked as a tool cost, so it is a `Tool cost` line on the run's timeline, part of its `cost.usd`, and `/usage`'s new `browser_time` meter (dollars, and seconds for runs that have ended); capabilities list `browser_time` in `usage.meters`. Under `max_cost_usd`, the browser's time is held before it runs: a browser call that the cap cannot hold is not made, the model gets the cap's words, and the run's session is released, so no browser minute passes the cap.
|
|
15
|
+
- Prices by provider: Browserbase $0.12 an hour with a 60 s minimum, Kernel (headless) about $0.06 an hour by the second, a local Chrome $0. `AGENTRUN_BROWSER_USD_PER_HOUR_<PROVIDER>` (`_BROWSERBASE`, `_KERNEL`, `_CDP`) sets a provider's own price in US dollars an hour. A provider with no price books its time as an unknown cost, and under a cap its calls are refused.
|
|
16
|
+
- Each browser call is held at what its session ran since its last charge plus two stretches of session time; a stretch is the provider's minimum, pi-browser's 180 s idle window and 30 s for a release to be confirmed (270 s, $0.009, at Browserbase). A session keeps one stretch held until its release is booked.
|
|
17
|
+
- pi-browser: `createBrowserExtension` takes `onCharge(charge, tx, call?)`, called with each session charge (`SessionCharge`: `seconds`, `usd`, `final`, `tag`, `provider`, `state`) in the commit that writes it on the session's record, at each browser call and at the release, or when custody gives up releasing a session. A session found by its tag (its create's answer lost) is billed at its release. A session kept across a reopen has its idle release armed at reconcile, so one no call uses is released an idle window later.
|
|
18
|
+
- Pick the browser: the `browser` tool runs on Browserbase or on Kernel, picked for the server (`PUT /v2/settings/tools` `{browser: {provider}}`) or for one agent (`definition.tool_settings.browser.provider`, which wins), as `web_search`'s provider is.
|
|
19
|
+
- The choices are `auto` (the default), `browserbase`, `kernel` and `chrome`. `auto` is Browserbase where the server holds `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, else Kernel where it holds `KERNEL_API_KEY`, else unavailable, saying which keys would do. A vendor picked without its key is unavailable, never the other vendor. `chrome` is in the list but not set up on any server yet: it reads unavailable (`a local Chrome is not set up on this server`), and a run that would get it is `409 agent_not_runnable`.
|
|
20
|
+
- A run keeps the vendor its first launch resolved for its life (its tool plane names it, `browser: "kernel"` or `"browserbase"`); at a later launch a vendor whose key is gone since is unavailable, and each browser call says why. Kernel's browsers run headless.
|
|
21
|
+
- Kernel's key is a tool key: `PUT /v2/settings/tool-keys/kernel` `{values: {KERNEL_API_KEY}}` saves it sealed, after one check that costs nothing (Kernel's list of browsers, at most one, 5 s); a key Kernel refuses (401) is `422`, reason `refused_by_provider`. `KERNEL_API_KEY` is on the launcher's secrets list, and reaches a run's process over its pipe only when its revision names `browser`.
|
|
22
|
+
- `GET /v2/capabilities`' `browser` tool gives its `providers`, the server's `provider` and what it `resolves` to, as the web tools do; `GET /v2/agents/{id}`' `tools` gives an agent's. With no vendor's keys it is unavailable with that reason, and no longer lists `missing` variables: either vendor's keys would do. The served contract marks `features.browser`'s `kernel` (`browser/1`).
|
|
23
|
+
- An agent's browser stays signed in: sign in once in one of its runs, and every later run of that agent starts from that signed-in browser. Sign-ins are kept per agent, never shared between agents.
|
|
24
|
+
- The cookies stay at the browser's vendor, in a Browserbase context or a Kernel profile (made under a random name, `agentrun-` and 24 hex digits, since Kernel's profile names are its whole account's). The server keeps one pointer per agent and vendor, sealed under `AGENTRUN_SEAL_KEY` and bound to its agent, in the agent's home under `sign-ins/`, a host-owned folder the home API neither reads nor writes (`capabilities.home.host_owned` lists it). With no seal key nothing is kept. A local Chrome keeps none.
|
|
25
|
+
- The server makes the agent's Browserbase context or Kernel profile when it has none (neither opens a browser) and hands a run the pointer over its pipe, never in its environment; the run's process never gets the seal key, and the model never sees the pointer.
|
|
26
|
+
- The first run of an agent to start with the browser holds the save lease, and its sessions save. A run of the same agent started meanwhile starts signed in and saves nothing. The lease ends when the run ends or lets go to wait for its person; a run whose process went keeps it through its relaunch.
|
|
27
|
+
- `GET /v2/agents/{id}` lists `sign_ins` (`key`, `provider`, `state` ready or held, `held_by`, `verified_at`), never the pointer, and `unreadable` (this server's own state, `signins/1`) for one that no longer opens under the seal key, which a run never replaces by itself; `capabilities.features.sign_ins` is true with a seal key and a browser vendor. `DELETE /v2/agents/{id}/sign-ins/{key}` (this server's own route) deletes the vendor's context or profile, best effort, and the pointer; it is `409 sign_in_held` while a run holds the lease.
|
|
28
|
+
- V1 limits: the save lease goes to the first run with the browser in its tools, whether or not it browses, until that run ends; a run still going when its sign-in is forgotten keeps the pointer it was handed, and its later sessions fail.
|
|
29
|
+
- **A Daytona box reaches the package registries and GitHub, through Daytona's domain list**
|
|
30
|
+
- pi-transport: `daytonaBoxes` takes `network: { allow: [...] }` when every entry is a domain (a `*.` wildcard allowed), sends it as Daytona's `domainAllowList`, and reports `network: "allowlist"` only once the sandbox's own read carries that list. A sandbox whose read lacks it is deleted and the create refused as `unsupported`, as `networkBlockAll` is checked. A CIDR in the list is still refused.
|
|
31
|
+
- serve: a run's Daytona box gets the hosts `AGENTRUN_BOX_ALLOW` names. Unset, `pypi.org`, `files.pythonhosted.org`, `registry.npmjs.org`, `registry.yarnpkg.com`, `github.com` and `codeload.github.com`; a comma list replaces them; `none` blocks the network as before. `*`, an IP address or a CIDR refuses the start. Where Daytona keeps or takes no domain list (its tier 1 and 2), the box is made again with its network blocked, never open, and capabilities say why. Capabilities show the hosts in `places.allow` and each Daytona box's `network`.
|
|
32
|
+
- The box is a new agent's default machine. A new agentic agent whose definition names no place is saved in the Docker box wherever the server has docker, whether ready or still preparing its image (the first run waits for the image). The place is written on its revision. If the definition names no tools either, the agent gets `bash`, so it has a shell. A definition that names its tools keeps exactly those. Where docker is unavailable, or the definition names `browser` (runner-only for now), a new agent is saved as before and runs on the runner. `capabilities.places.default_place` says what a new agent gets, and `default_reason` says why when that is the runner. `places.default` stays `runner`, because it is where a revision that names no place runs. Agents saved before keep running where they ran, and a workflow is never given a box. The console's new-agent form starts on the served default, with bash ticked in a sandbox and the browser left unticked there.
|
|
33
|
+
- AgentRun Server runs OpenCode as a harness: a revision with `harness: "opencode"` runs on the pinned `opencode serve` (`opencode-ai` 1.19.5, an exact optional peer of the server that the host installs), started for each drive of the run's session, with the host's tools as its only tools and its model behind the session's proxy, durable in the run's own store. Its model goes where codex's does: the gateway at `AGENT_MODEL_BASE_URL`, or OpenAI with `OPENAI_API_KEY`, on the Responses API.
|
|
34
|
+
- What a host does differently: install `opencode-ai@1.19.5` beside the server to make `opencode` available in `GET /v2/capabilities`. Without it, capabilities say it is not installed and give the install line.
|
|
35
|
+
- OpenCode's own events for the session are mirrored into the run's store and given back to a new OpenCode process (`/sync/replay`) on each drive, so a follow-up, a stop or a crash resumes from the store. A turn a crash cut off gets the kernel's recovery note.
|
|
36
|
+
- An OpenAI key saved in Settings → Model keys runs opencode too: with no `AGENT_MODEL` it gives opencode its default model, as it does codex. An OpenRouter key alone runs opencode on OpenAI's models through OpenRouter's Responses API (default `openai/gpt-6-sol`), the route codex takes. Under a spend cap each opencode request is sent with the output tokens what is left of the cap can buy, as codex's are.
|
|
37
|
+
- The console offers OpenCode beside Pi, Claude and Codex when the server lists it.
|
|
38
|
+
- An answer the model provider's content filter stops ends an opencode run `failed` with `moderated` after one request, as on the other harnesses: the session's model proxy reads the stop (OpenAI's API, or a gateway that sends each event as its data alone) and the drive ends the turn, so OpenCode never asks for the refused answer again.
|
|
39
|
+
- An opencode run reserves 704 MB of the host's memory (measured: OpenCode's own process takes about 500 MB), so a 1 GB instance holds one opencode run at a time and a host under 832 MB doesn't offer it, with why.
|
|
40
|
+
- On Linux, a Docker box reaches a list of hosts, and nothing else: by default `pypi.org`, `files.pythonhosted.org`, `registry.npmjs.org`, `registry.yarnpkg.com`, `github.com` and `codeload.github.com`, so `pip install` and `npm install` work in it. `AGENTRUN_BOX_ALLOW` replaces the list with a comma list of names (where `*.example.com` names the hosts below `example.com`); `AGENTRUN_BOX_ALLOW=none` is the box offline, as before.
|
|
41
|
+
- The box stays `--network none`. The run's process starts the kernel's egress proxy with the list, on a Unix socket in a directory of its own under `/tmp/agentrun-egress-<uid>/`, bound into the box read-only at `/run/agentrun/egress/`. A `socat` in the box relays `127.0.0.1:3128` to it, and `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy`, `https_proxy`, `NO_PROXY` and `no_proxy` name it in the box's fixed environment. A program that skips them has no route out.
|
|
42
|
+
- A host off the list, an IP address and any port but 80 and 443 are refused before any lookup: `403 <host> is not on this box's network list: use web_fetch for web pages, or ask the operator to add it to AGENTRUN_BOX_ALLOW`. A listed name whose address is private, this machine's or a cloud's metadata is refused too. The proxy holds no key and adds none.
|
|
43
|
+
- The server decides once, at start, and fails closed: the box has the list only when this machine is Linux, the docker CLI's endpoint is a local unix socket, and `docker info` answers within 5 s with Linux containers on this machine's own kernel, keeping its data in a directory this server sees. Anything else (a Docker on another kernel such as Docker Desktop on a Mac or OrbStack, a daemon elsewhere, this server in a container given the host's docker socket, docker info that fails or does not answer) leaves the box with no network, and says why in `network_reason`, naming what it found.
|
|
44
|
+
- A box made with another network than the server's (made under `none`, then the list turned on) is made again at its run's next open, not reused offline. The box's relay is waited on until it listens (up to 3 s); one that can't start (no socat or setsid in the image, or not listening) leaves the box with no network and one timeline row that says why.
|
|
45
|
+
- Each start removes the proxy directories of runs that are gone (a socket that refuses a connect); a live run's stays.
|
|
46
|
+
- Capabilities give the list as `places.allow`, and each box's `network`: `allowlist` or `none`, with `network_reason` when an available box has none. The start's banner says the same.
|
|
47
|
+
- `*`, an IP address, a CIDR or a URL in the setting refuses the start, naming it.
|
|
48
|
+
- The default box image adds `npm` and `socat`, so it builds once more. An image with no `socat` gets no network, and the run's timeline says so once.
|
|
49
|
+
- A run that its spend cap stops for room now pauses instead of failing. When what is left of `max_cost_usd` cannot buy the next request's least, the request is still not sent, so the cap holds, and the run ends up as follows:
|
|
50
|
+
- It is `input_required` and `waiting`, with `error` null and `pending: {kind: "budget", cap_usd, spent_usd, needs_usd, said, at}`. `spent_usd` is what the cap counted as taken, and `needs_usd` is the least the refused request needs. They are kept on the refusal's start mark, so a restarted server reads them too.
|
|
51
|
+
- Its timeline shows a waiting row: "Paused at the run's $1 cap: Not sent: …".
|
|
52
|
+
- The webhook's `run.needs_input` carries `pending.kind: "budget"`.
|
|
53
|
+
- Its process is let go while it waits, so it holds no place. A restarted server reads it paused.
|
|
54
|
+
- A message to a paused run is `409 budget_reached` (a new error code). A cancel ends it.
|
|
55
|
+
- The MCP tools say so too: `runs_get`'s `pending` names the budget kind, and `runs_respond` and the instructions say a run paused at its cap waits for its cap to be raised and is not answered.
|
|
56
|
+
- The built-in console shows a paused run's reason ("Paused at its $X spend cap") in Mission Control and on its page. It offers no answer form and no composer there.
|
|
57
|
+
|
|
58
|
+
A refusal no cap fixes still ends the run `failed` with `spend_cap_reached`: an unknown spend, a model with no price or no output ceiling, or an input that could not be measured. So does a cost found past the cap after a response. Raising the cap of a paused run comes next.
|
|
59
|
+
- `PATCH /runs/{run_id}` with `{max_cost_usd}` raises a run's spend cap, and only raises it. The new cap must be above the run's current cap, its last raise included, by more than 1e-9, and the same raise sent again (a retry, within 1e-9) changes nothing. A raise serve.json could not keep is not taken. It is `422` otherwise, and for a run with no cap or a workflow run; an ended run is `409 not_continuable`.
|
|
60
|
+
- **Where the cap is kept:** the run's serve.json keeps the new cap, with each raise in `cap_raised`. The run's next process opens under it, and so does a server started again.
|
|
61
|
+
- **A run paused at its cap goes on.** The answer is `{resumed: true, message_id}` at once. The pause gets one follow-up turn, "The cap was raised to $X; continue the task.", under that `message_id`, sent once the process being let go is gone; the turn runs under the new cap. A second raise before it goes answers the same id and raises what it says.
|
|
62
|
+
- **Sent once, or the run fails saying why:** a server started again sends a follow-up that had not gone, to the process a launch started too. One that cannot be sent is tried again twice, then the run ends `failed` in plain words. A raised run's paused process that exits without releasing the run does not fail it. The follow-up shows in the timeline as the server's, "AgentRun: The cap was raised…", never as the person's.
|
|
63
|
+
- **What a paused run has spent:** its figures are shown to a millionth of a dollar, as `cost.usd` is. Once its process is gone, `pending.spent_usd` is the store's spend when that is lower than the refusal's figure, which counted requests still answering at what it held for them. `suggested_cap_usd` follows it.
|
|
64
|
+
- **The raise to offer:** a paused run's `pending` (`kind: "budget"`) adds `suggested_cap_usd`. It is `spent_usd` + 10 × `needs_usd`, rounded up to a whole dollar, and always above the run's cap, so a `PATCH` with it resumes the run. This is part of the `cappause/1` widening.
|
|
65
|
+
- **Within a float's tail:** a request whose least, with what the run has spent, makes its cap to within a float's own tail (1e-12) fits it, but a spend past the cap by any more, however little, does not. The same holds for a paid call's check and for a cost read after a response. A request past the cap names a raise a cent above it, never the cap itself. Two caps within 1e-9 are the same cap.
|
|
66
|
+
- **A working run's live process** keeps the cap it was opened with until its next process, and the answer's `note` says so.
|
|
67
|
+
- A run whose agent learned a workflow runs it as one tool, `learned_workflow {name, input}`, on pi, claude-agent and codex, with no edit of the agent's definition. A draft whose call node calls a tool set to ask or deny (a composed workflow's inner one too) is refused at the merge and before a call, in the words a workflow revision's call node is, the end-of-run prompt offers only tools set to allow, and each call node asks the run's gate again as it runs, so a tool set to deny or ask since the call began is refused there, never run. The tool gate holds it like any tool: `learned_workflow` is its settings key, allowed by default (the agent's own graded workflow, each of its nodes checked), and an agent's or the server's tool settings may set it to ask (the run parks until an owner answers, and an allow runs it once) or deny. Only a workflow whose `README.md` sets no status (or `active`) is the run's: one held for its owner's OK, or retired, is not. The tool's description names each workflow with its README's line, 8 KiB of lines in all, and the run's pin names the ones it gets (`workflows`), each kept whole in the run's directory, and the ones over that budget or holding a secret (`workflows_left_out`); the list is fixed when the run starts, so an approval or a retire takes effect at the next run, and a README whose front matter does not read one way is not read. A call checks the workflow again against the agent's own tools as its run resolves them and refuses one whose call node names a tool the agent was not granted, whose model node names any tool (the merge refuses that too), that holds a node its runner cannot run (a judge, pick or sift node needs a decision provider a run is not given; the merge refuses that too), whose agent node asks what its runner refuses when the node comes up (more than 8 turns, or context fork; the merge refuses those too), or that holds a code node or a shell or executor call, before any of its nodes runs. It runs with the workflow DSL: each model node on the run's own model, in a session of its own with no tool of its own, and each call node `via: "tool"` on a tool the agent has, its paid requests booked under the call. Its model requests are the run's, under its cap and on its timeline as `learned_workflow` side requests (on claude-agent and codex against one total with the harness's own, and on the harness's own route: on OpenRouter alone, through OpenRouter; claude-agent through the operator's own gateway at `ANTHROPIC_BASE_URL` is offered no learned workflow, nor is any harness at an origin its requests could not follow, and its pin says why in `workflows_off`; opencode takes codex's route), and a call a crash cut off is never run again.
|
|
68
|
+
- A paid tool call the spend cap refuses for room pauses the run, as a refused model request does: monid's run, Parallel's search and fetch, and browser time, on pi, claude-agent, codex and opencode.
|
|
69
|
+
- **The call is not sent.** Its result says so in the cap's words, and the model's next request is refused in those words, so the turn ends there and the model gets no turn to work around it.
|
|
70
|
+
- **The run waits on a raise:** `input_required`, `waiting`, `pending.kind: "budget"`, with what was taken, the call's hold as what it needs, and the raise it is offered. A raise sends it on, and the model makes the call again if it still needs it, once per call it makes.
|
|
71
|
+
- **A stop between the refusal and the next request**, then a message, starts a turn judged as any other.
|
|
72
|
+
- **A spend that is unknown still fails the run**, as for a model request.
|
|
73
|
+
- The runs lists (`GET /v2/runs` and `GET /v2/agents/{agent_id}/runs`) name the trigger that started each run, as the run's own view does: `trigger: {id, firing_key}`, or `null` for a run a caller started. An ended run listed after a restart reads it from the `serve.json` its list row already reads, so the list makes no extra read.
|
|
74
|
+
- A schedule tells you when it misses or fails. Of the times missed while the server was down, the latest still fires, once and marked `catch_up`, when it is within the trigger's `catchup_window_s` (default 3600; 0 never catches up), and the rest stay one `missed` firing with their count.
|
|
75
|
+
A firing whose run is refused sends a `trigger.failed` webhook message, signed like the run notices, with `data: {trigger_id, name, firing_key, nominal_at, error, auto_paused}`; its `webhook-id` is made from the firing's key, so a restart never sends it twice. Five failed firings in a row turn the trigger off with `disabled: {reason: "auto_paused"}`, and the fifth's message says so; a firing that starts its run resets `failures_in_a_row`, and so does turning the trigger on again. A webhook receiver now sees this third message type when a trigger fails; capabilities list it in `features.webhooks.events`.
|
|
76
|
+
Overlap stays `skip` alone: a firing while the last run is active (working, or parked waiting on a person) is skipped with why, never queued, because a firing queued behind a parked run would wait as long as the person does.
|
|
77
|
+
- Schedules start an agent's capped runs on their own: `POST /v2/triggers` with a source of `{kind: "schedule", cron, timezone}` (five fields, an IANA zone), `{kind: "schedule", at}` (once; the trigger turns itself off after) or `{kind: "schedule", every_s, start_at?}` (60 to 31622400, a year and a day, on the grid from `start_at`), and a target of `{kind: "start_run", agent_id, input, max_cost_usd, effort?}`. `max_cost_usd` is required, and a workflow agent is refused, since a workflow run's spend is not capped here.
|
|
78
|
+
Each firing starts its run once, across retries and restarts: its key comes from the trigger and its nominal time, and its run is started under that key. A firing while the trigger's last run is still active (working, or waiting on a person) is recorded as skipped, with why. Times missed while the server was down are one `missed` firing with their count; the schedule goes on from now. `PATCH /v2/triggers/{id}` with `enabled: false` pauses it, and the time it was off is skipped, not caught up. `POST /v2/triggers/{id}/fire` runs it now, once per `Idempotency-Key`. `GET /v2/triggers/{id}/firings` lists its last 200 firings, and a run it started names it in `trigger`. Triggers live in `triggers.json` in the data directory; capabilities list them under `features.triggers`.
|
|
79
|
+
- On `pi`, `codex` and `opencode`, a run that reads its files (the `read` or `bash` tool) gets its skills on demand, as `claude-agent` does through its Skill tool: its system prompt names each skill, what it is for and its `SKILL.md`'s path under `.agents/skills/`, and the agent reads the file when the skill fits the step it is on. The revision's own skills and the ones the agent learned alike. A run with neither tool gets every `SKILL.md` inlined, as before.
|
|
80
|
+
A skill's front matter description is read whole as YAML folds it: one that wraps onto indented lines, or one written entirely on the next lines.
|
|
81
|
+
- **An approved MCP call runs once through the executor its gateway registers**
|
|
82
|
+
- The tool gate keeps an executor for each tool prefix (`executor("mcp:", run)`, which the MCP gateway registers). Once the owner allows a parked `mcp:<server>/<tool>` call, the gate runs it through that executor exactly once, on the same journaled path as a kernel host tool: the call's intent is in the run's store before it runs, and a call a crash cut off is answered interrupted, never run again. The run resumes with its answer, a failure included, through the gate's one resume message.
|
|
83
|
+
- An approved call whose prefix has no executor is not run, and the run resumes being told so: `The approved <tool> call was not run: nothing in this run runs mcp: calls.`
|
|
84
|
+
- **Every tool call passes one gate: each tool is allow, ask or deny, and an ask parks the run until the owner answers**
|
|
85
|
+
- `permission` (`allow`, `ask`, `deny`) in `tool_settings`, the agent's own over the server's (`PUT /v2/settings/tools`). An MCP server's wildcard, `mcp:<server>/*`, sets each of its tools, under a tool's own key. By default every built-in tool is allowed and a catalog tool (`monid.<tool>`, `mcp:<server>/<tool>`) asks. So until monid's tools are set to `allow`, an agent that calls them waits for the owner at each call; on a server with accounts off (`AGENTRUN_ACCOUNTS=0`) each call is refused instead, and so is a workflow model node's. `ask` is offered for `read`, `write`, `edit`, `bash`, `fetch_page`, `web_fetch`, `web_search` and catalog tools; any value not offered is `422`. `features.tool_permissions` is now `true`. `capabilities.tools` give each tool's `permission`, `default_permission` and `permissions`, and `GET /v2/agents/{id}`'s `tools` add `permission_from`.
|
|
86
|
+
- pi's tools, and claude-agent's and codex's host tools, all pass the gate. `deny` answers the call at once with an error, and the run goes on. `ask` ends the turn: the run is `input_required` and `waiting`, with `pending: {kind: "approval", id, tool, call_id, args_preview, requested_at}` on the run and its summary, a `tool_approval_requested` timeline row after the call's result, and a `run.needs_input` webhook with `pending.kind` `approval`. `POST /v2/runs/{id}/approvals/{approval_id}` with `{decision, note?}` answers it, from the owner's password session only: a bearer token is `403`. On allow the kernel runs the call once, on the run's own coding source, and resumes the session with one message that names the call and carries its result; deny resumes it with the refusal. The same answer again is `204`, another `409` (`already_answered`). The request survives a restart, and a cancel marks it canceled.
|
|
87
|
+
- Under `ask`, claude-agent's and codex's own web search, which runs inside the CLI where no call can wait, gives way to the kernel's (`native` picked: unavailable). Under `deny`, `web_search` and `web_fetch` resolve `unavailable: denied`, and the run still starts.
|
|
88
|
+
- On a server with accounts off (`AGENTRUN_ACCOUNTS=0`) no one can answer an approval, so an `ask` is refused at each call (`Permission denied: <tool> needs the owner's approval, and this server has accounts off (AGENTRUN_ACCOUNTS=0), so no one can give it: set the tool to allow or deny in the agent's Tools.`), never parked, and `capabilities.tools` give `ask_needs: "password"` on each tool `ask` is offered for.
|
|
89
|
+
- The learning lane's end-of-run turn writes no file under `work/.learning/`: its write or edit there is refused (`A note is kept only from your answer: write it in a ```note block, not to a file.`), whatever the tool's permission, since its notes are kept only from its answer. Any other turn's write there follows the tool's permission. The refusal guides the model and is not a security boundary: it reads the path as written, so a write through a link or a shell redirect is not refused. Nothing depends on it, since the host lays `.learning/` from its own store and never reads back a file the run wrote there.
|
|
90
|
+
- A workflow call node that calls a tool set to deny refuses its run (`409 agent_not_runnable`, `details.denied`), and so does one set to ask (`details.asks`), since a call node cannot wait for an approval. A tool switched to deny or ask while the run goes refuses its next call node in the gate's words. A model node's asked call is refused, since no node can wait.
|
|
91
|
+
- Upgrading: a workflow whose call node's tool is set to ask, by a setting or a default, now refuses its run (`409`, `details.asks`): set that tool to allow for the agent (`definition.tool_settings`). Built-in tools are allowed by default; catalog (`monid.*`) and MCP tools, which ask by default, are no call node's tools here.
|
|
92
|
+
- `@parcha/pi-durable-agent`: a revision's `toolSettings` keeps a catalog tool's name (`monid.run`), an MCP server's tool (`mcp:<server>/<tool>`) and its wildcard (`mcp:<server>/*`) as keys, beside a plain name; its timeline's `TimelineKind` declares `tool_approval_requested`.
|
|
93
|
+
- A signed webhook starts or messages an agent. A trigger with `source: {kind: "webhook"}` fires on each `POST /v2/hooks/{trigger_id}` signed by its own secret under the Standard Webhooks spec (`webhook-id`, `webhook-timestamp` within 5 minutes, `webhook-signature`), checked on the raw body before anything else; it is the server's one route with no token. A bad signature, a stale timestamp, an unknown trigger, one that is off and one that is not a webhook's all answer the same `401`; a body past 256 KiB is `413`. The secret is made with the trigger, shown in its `201` once, kept sealed in `trigger-secrets.json` (no seal key, no webhook trigger: `409 no_sealing_key`), cut by an import, and rotated with `POST /v2/triggers/{id}/secret`.
|
|
94
|
+
The `webhook-id` is the firing's key: the first request answers `202` once its firing is recorded, and the same id again answers `200` with that firing and starts nothing. The agent gets the trigger's input, then the body, cut at 16 KiB, inside `<trigger-payload source="webhook" untrusted>`. A new target, `{kind: "message_run", run_id, input}`, sends each firing (from a webhook or a schedule) to one run as a message, under the firing's key, which the run's store takes once; the run must have a spend cap, and a firing never answers a run that waits on its person (it is skipped). A trigger holds at most 20 firings due (a firing to a working run waits for it): past them a webhook event and a run now answer `429` with `Retry-After`, recording nothing, and a schedule's time is skipped. A webhook trigger's create retried under its Idempotency-Key answers the same trigger with a note in place of the secret. A note that would keep a webhook signing secret (`whsec_`, this server's or any other's) is refused by learning's checks. Capabilities list `sources: ["schedule", "webhook"]` and `features.triggers.webhook`.
|
|
95
|
+
- A message the server writes into a run, a raised cap's follow-up or an approval's resume, can carry its origin
|
|
96
|
+
(`{ kind: "server", reason: "cap_raised" | "approval" }`, or `"approval_declined"` with `said`, the words of the person's
|
|
97
|
+
message that declined the call). The Timeline then shows it as a phase row, "AgentRun: <its first line>", never as
|
|
98
|
+
"You: …", and a declined approval's words as the person's own row beside it; the model reads the same text. A run door's `POST /submit` takes `origin`. On a harness run the
|
|
99
|
+
origin is written on the message's user entry. On pi, whose user entry carries no data, a marker entry
|
|
100
|
+
(`agentrun.message_origin`, its text) goes first, and the Timeline matches it to the next user entry with that exact text.
|
|
101
|
+
The server's row carries `origin: "server"` (a new optional field of a Timeline row), and it counts, as a person's
|
|
102
|
+
message does, as the message its turn took: serve reads a run's messages (their arrival, where a stop stands) through one
|
|
103
|
+
predicate. pi-durable-agent's timeline exports `MessageOrigin`, `MESSAGE_ORIGIN`, `originOf`, `messageOrigins` (the one
|
|
104
|
+
reader) and `isMessageRow`, and pi-durable-disk exports `MESSAGE_ORIGIN_KIND`. A door's `POST /submit` takes exactly the
|
|
105
|
+
reasons `cap_raised`, `approval` and `approval_declined`.
|
|
106
|
+
- A tool's key the server is started with (Browserbase's, Parallel's, monid's, TypeSafe's) is checked once as the server starts, with the same call that costs nothing a saved key gets, in the background, so the start never waits on it. `GET /v2/settings/tool-keys` shows its `check`: `accepted`, `not_checked` and why, or `refused` (`Browserbase refused BROWSERBASE_API_KEY (401: Unauthorized) when this server started: set the right one where AgentRun starts, then restart it`). A tool that needs a refused key (the browser on Browserbase's, monid's tools on monid's) reads unavailable in capabilities with the same words, instead of available until a run fails.
|
|
107
|
+
- Runs execute in a Modal sandbox (box `modal`). An agent whose place is `modal` gets its `bash`, `read`, `write` and `edit` in a Modal sandbox, the way a Daytona box works. It is Modal's default sandbox runtime (gVisor), not a virtual machine. The server holds the token and the SDK client, makes the sandbox, seeds it with the run's `work/`, copies what changed back at each turn's end and before the run's end, and ends it at the run's end, a cancel or an archive. A sandbox that is gone is made again on the next call. The run's process reaches its sandbox only through the server's box relay, which makes only that run's own tool calls. The Modal sandbox has no network: Modal takes a host list, but the server cannot read a sandbox's list back to check that it holds, so each box is made blocked, and capabilities say so in `network_reason`. It takes the CPU and memory limits a Docker box takes: 2 CPUs and 4 GiB by default, which `AGENTRUN_BOX_CPUS` and `AGENTRUN_BOX_MEMORY` change.
|
|
108
|
+
- The background tools no longer trust files in `work/background/`, which the run's own file tools can write. Before, a pid written there was a group `bash_signal` and the run's end would signal (a forged `1` meant every process in the box), and a link planted at `output.log`, `command`, `started` or `exit` read another file of the box. A link planted at `ended` was a file the run's end truncated.
|
|
109
|
+
- The group, the exit code, the start time, the command and the run's-end mark are now kept in the box's own directory, out of `work/`. The files in `work/background/<id>/` are display copies that no call reads back, each written in the box's own directory and moved over its name from inside `work/background/<id>`, which is entered and checked by its real path. A link planted at the name or at the directory is never followed.
|
|
110
|
+
- `output.log` is opened first and checked as opened: it must be the log itself by its real path, and a regular file. Every read is then of that open file, so a link swapped in after the check is never read. A link planted at it is refused in words.
|
|
111
|
+
- A directory made in `work/background/` that the box did not start reads as gone and is never signalled.
|
|
112
|
+
- Capabilities name the browser vendor the server picked: `tools[].key` for `browser` is the key row of the vendor picked or resolved (`kernel` where Kernel is picked or resolved, else `browserbase`), so a page links a missing Kernel key to Kernel's row, and `features.browser` is the vendor the browser resolves to (`browserbase` or `kernel`), else `none`.
|
|
113
|
+
- A run made before the browser was pickable, opened again while Browserbase's keys are missing, reads its browser unavailable for that launch only: its kept choice stays Browserbase, so keys restored later make its next launch run there. Before, the refusal was kept and no key restored it; a run that kept it so reads as Browserbase (or Kernel, for Kernel's refusal) again at its next launch, saved back. A run that resolved to no browser at its first launch (`auto` with no key) or to `chrome` stays as it was.
|
|
114
|
+
- A run whose model provider stops the answer on its content filter now ends `failed` with `error.code` `moderated` and
|
|
115
|
+
says so in plain words: "The model provider stopped this answer (its content filter). Rephrase the request, or try
|
|
116
|
+
another model." Before, it ended `run_failed` with the provider's jargon ("Response incomplete: content_filter"). The
|
|
117
|
+
Timeline's error row keeps the harness's words for the stop (pi-ai's on pi, the kernel's on claude-agent and codex). On pi the run reads pi-ai's words for the stop on each API. On
|
|
118
|
+
claude-agent and codex the session's model proxy reads the provider's stop (Anthropic's `refusal`, an OpenAI answer
|
|
119
|
+
`incomplete` for `content_filter`) and the harness ends the turn at once: the CLI no longer asks for the refused answer
|
|
120
|
+
again, turn after turn. Only the turn's own answer request ends it: a side call the CLI makes beside the turn (one
|
|
121
|
+
without the session's tools) that the provider stops is logged and left to the CLI. The refused request is booked at
|
|
122
|
+
the usage its end reports. The kernel exports `CONTENT_FILTERED`, the text such a turn ends with; a provider policy may
|
|
123
|
+
say a stop through `filtered` and a side call through `answers`, and the model proxy tells its machine through
|
|
124
|
+
`onFiltered`.
|
|
125
|
+
- **A Daytona box's host list holds after a restart, and an odd read of it never leaves a sandbox behind**
|
|
126
|
+
- serve: a run's Daytona box found at its next call is kept only when its domain list is the one `AGENTRUN_BOX_ALLOW` names now (the same hosts, in any order). A box made under a wider list, or one whose list Daytona does not say, is destroyed and made again, so a narrowed setting holds for a run whose server restarted.
|
|
127
|
+
- pi-transport: a box's facts carry its hosts in `allow`. A `domainAllowList` read back as a list of hosts is taken; any value that is neither a string nor a list deletes the sandbox and refuses the create as `unsupported`, where it threw before and left the sandbox.
|
|
128
|
+
- serve: a Daytona box with no network after Daytona refused its list says why in `network_reason` (`reason` stays for an unavailable box), and the log line gives Daytona's own words (`event=box_network ... message="..."`).
|
|
129
|
+
- A decision receipt keeps its request's error whole up to 64 KB (it was cut at 2000 characters), marking a longer one `error_truncated`. A workflow run's graph redacts a decision's error before it cuts it, and holds back the tail of one stored cut (marked, or exactly 2000 characters from before), as it does a call's, so a held key across the cut shows no part.
|
|
130
|
+
- A decision's row in a run's store keeps its receipt's `error_truncated`, so a completed run's decision error stored cut at 64 KB is still held back at its tail on the graph, where a held value the cut split would sit.
|
|
131
|
+
- A workflow run's decision rows on the Timeline hold no held key: a provider's error, a source's title, an answer or a refused question that quotes one shows `[redacted]`. Each row's summary and text are redacted whole before they are cut, and an error stored cut has its last characters held back, where a key the cut split would sit. A key saved after a workflow run ended is redacted from its decision rows on the next read.
|
|
132
|
+
- `GET /v2/capabilities`' `features.browser` is `browserbase` when `tools[]` lists `browser` as available, and `none` when it does not. It was always `none`, so a client reading `features` hid a browser the server runs.
|
|
133
|
+
- The parts of every workflow run's graph that serve keeps redacted, and each run's last whole graph kept for a busy store's read, share one cache bounded at 32 MB, which evicts the least recently used entries one at a time. It used to keep up to 2048 parts per run with no bound across runs, and dropped them all at once past that.
|
|
134
|
+
- A workflow run's graph keeps what the run wrote whole and cuts only when it serves it, after redaction: a key saved after the graph was read is redacted from a later read too, the one a busy store answers from the kept view included. Each label, error and decision state is redacted once per held key set, not on every poll.
|
|
135
|
+
- A workflow run's graph (`GET /v2/runs/{id}/graph`) shows its nodes, decisions and calls (each call's input, output and error) with no held secret in them, by the same rule as the run's answer: a key the server holds or handed the run reads `[redacted]`. Each part is redacted once per content and held key set, so polling a running workflow's graph does not redact it again on every read. A key saved after a read is redacted from the next one.
|
|
136
|
+
- A workflow run's graph redacts held keys before it cuts a text, so a cut can no longer leave part of a key: a map item's label (cut at 200 characters), a call's error (cut at 2000, now logged whole up to 64 KB), and a decision's state stored cut past 64 KB (its last characters, where a cut key would sit, are held back).
|
|
137
|
+
- A message the person stopped before the harness began it is no longer lost. A Codex or Claude run stopped in its first seconds (Codex still starting), then told "Go on.", answered "I'm missing the earlier task context": the stop withdrew the first message, and the follow-up reached the model alone. Now the stopped message stays in the conversation. The next message carries it first, with a line saying it was stopped before any work on it began, and the stopped turn still never runs on its own. Several stopped messages are carried in order. A stopped steer is not carried. A crash after the next message was taken, before the harness recorded it, still recovers with the stopped words.
|
|
138
|
+
- What a run learns is kept item by item. The grader's verdict was read as all or nothing: when it dropped one note and kept another, nothing merged. Now the notes, skill and workflow draft it keeps (or holds for the owner's OK) merge and the ones it drops are left out, and the run's learning names the first one left out. A drop on Planted still keeps nothing from the run, and a grader that keeps every item and says no merge still merges nothing. The checks before the grader work the same way: a note out of shape is left out and the rest goes on (named in the run's learning `problems`), while a secret, a count over its cap, a deletion or a path outside the folder still refuses the whole proposal. And a run's note with no `type:` is a project note, as Claude Code's memory reads one, where it used to drop the whole proposal.
|
|
139
|
+
- Learning no longer drops a preference you asked an agent to remember on a server with a Jev key. With `TYPESAFE_API_KEY` set, each new note went through a page-injection classifier before the grader, and a stated preference ("always answer in tables") reads like an instruction to it, so it was dropped as "Not kept: a new note read like instructions planted in a page, not a lesson." The classifier cannot see where a note came from. That screen is gone: the grader's Planted question decides, with what the user said in the run in view. The `screen` and `screen_down` reasons are no longer produced; older runs that hold them still read. One grader now judges every new note, skill and draft: with no `--grade-model` (and no `AGENT_MODEL_STRONG`), that is the agent's own model, the only judge of what it learns. When learning is on, name a strong grade model.
|
|
140
|
+
- The end-of-run learning prompt says when a job is a workflow draft rather than a skill (one that runs end to end as model and tool-call steps from a defined input to a defined output, or that the person asks to keep as a workflow), and its example draft is whole and valid: schemas declared once, `input` and `output` naming them by `schemaId`, a chain of a `web_fetch` call (when the agent has it) and a model node. Before, agents asked for a workflow kept a skill, and the drafts they wrote were refused (an inline schema in `input`, or none named), as the only example elided its parts. A test validates the prompt's example with the workflow DSL and the learning checker. The prompt also names the node kinds a learned workflow may use: model and tool-call nodes only.
|
|
141
|
+
- A learned workflow's call reads on a run's timeline as the workflow it ran and what it gave: "Ran the learned workflow price-report", then "Ran the learned workflow price-report: total 49.75", its output in one line through the same redaction as any tool's summary. It read "Using tool: learned_workflow" / "ok" before.
|
|
142
|
+
- A workflow output's number that equals a held all-digit key in value is withheld as `[redacted]`, even when its text differs from the key's (a leading zero, `1e21`, a long key read lossy). Long runs of a GitHub fine-grained token's start (`github_pat_`) or of a JWT's first part are now redacted in time linear in their length; what is redacted is unchanged.
|
|
143
|
+
- A model request under a spend cap is booked by one rule on every harness: the kernel's `bookRequest`, from how the
|
|
144
|
+
request ended (`Ended`). The rule is never to under-count.
|
|
145
|
+
- **A whole answer** books its own cost, or its hold when that cost cannot be read. On pi, that used to make what the run
|
|
146
|
+
had spent unknown.
|
|
147
|
+
- **An error status before any event**, or a request refused at connect, books nothing.
|
|
148
|
+
- **A failure once the request left, a gateway's 504 or 524, or an answer after an attempt that was lost** books the
|
|
149
|
+
hold.
|
|
150
|
+
- **A stop** books what streamed: its content, and the part of a hidden reasoning budget that did not stream.
|
|
151
|
+
- **A content-filter end** on pi books the hold: pi-ai ends it as an error after events, which can have been billed. On
|
|
152
|
+
the proxy, a filtered answer is an answer and books its own cost.
|
|
153
|
+
|
|
154
|
+
On pi, the cap now gives pi-ai a fetch that records each attempt pi-ai makes, so a reset before any response books the
|
|
155
|
+
hold where it booked $0, and a 429 then an answer is priced once. An API whose transport that fetch cannot see (Codex's
|
|
156
|
+
WebSocket, Bedrock, Google, Cloudflare) books the hold for a failure before any event. A later process reads the figure
|
|
157
|
+
this one booked: a pi request that failed before any event marks its hold, and the runner writes `bookedUsd` and `rule` on
|
|
158
|
+
its records. The model proxy passes how a request ended as `afterRequest`'s third argument.
|
|
159
|
+
If the store cannot take such a mark within 15 s, the request fails, saying its end could not be recorded, and a later
|
|
160
|
+
process reads it at its hold.
|
|
161
|
+
- An OpenCode run the server stopped in its first seconds (a restart, a deploy) now picks up where it was when the server comes back, and answers the person's message. Before, the turn was ended as if the person had stopped it, and the run waited for input with the message unanswered. A person's own Stop still stops the turn for good, and "Go on." is a turn of its own.
|
|
162
|
+
- A paid tool's spend-cap refusal (a browser, monid or Parallel call) no longer counts money held for requests still
|
|
163
|
+
answering as spent. It is now one sentence, like a model request's refusal: what the run spent, and what it holds for
|
|
164
|
+
calls still answering, of its cap; what the call could cost; and the cap that would run it, at least a cent above the
|
|
165
|
+
current one. Every amount uses one format. A model request refused for no price, no output ceiling, an unmeasured input
|
|
166
|
+
or an unknown spend now says "not sent" once, and writes its cap in that format too.
|
|
167
|
+
- A run create retried with the same `Idempotency-Key` after the server went down mid-create now answers the run the first try made, never a second run. The agent store records the key's origin in the transaction that writes the run: `store.startRun({ agent, origin: { key, fingerprint? } })` starts one run per key and, asked again (or by two starts at once), returns that run with `existing: { fingerprint? }` and writes nothing; `store.runOfOrigin(key)` reads it. The new `run_origins` table comes without a new store version. `POST /v2/agents/{agent_id}/runs` gives the store its key's slot and body, hashed, so a retry after a restart replays the run (`Idempotent-Replayed: true`) and another body under the key is still `409 idempotency_mismatch`; a create's key is kept with its run, past `limits.idempotency_ttl_s`.
|
|
168
|
+
A run the server went down on after the store made it and before it was set up (no input saved in its `serve.json`) used to be relaunched with no input and stay queued for good; the next start now fails it with `error.details.reason` `server_lost_at_setup`, and never launches it.
|
|
169
|
+
- A Docker box's network label (`agentrun.net`) is the same for the same hosts in whatever order and case `AGENTRUN_BOX_ALLOW` names them, so reordering the setting no longer makes a run's box again. A box labelled before this with a list that was not in sorted order is made again once, at its run's next open. The serve README no longer says Docker Desktop on WSL2 always passes the runtime check: it keeps its data outside the distro, so its box has no network unless the distro has that directory.
|
|
170
|
+
- An OpenCode tool call leaves nothing behind once its client is gone and the run's MCP server has closed. Its progress timer stops, and nothing more is written to its response, the moment its client goes away; the call itself still counts as running until it settles, so a drive's end still waits for its real outcome. When the server closes, a call that is still running after its 5 s window is let go: its timer is stopped, it no longer counts as running, and its answer, if it ever comes, is written nowhere. Before, a host tool that never settled kept a live timer writing progress to a closed response, and stayed counted as running, for as long as the server process lived.
|
|
171
|
+
- A spend cap refusal names a raise that runs what it refused. The cent it rounds up to is read within the same float tail the cap's fit check allows, so a total a hair past a whole cent names the cent above it, not that cent.
|
|
172
|
+
- Schedules keep firing after a crash or a bad trigger. A trigger's firings are driven one at a time, in order, so a firing a crash left due settles to the run it had before the next start's own firing is checked, which then starts its run instead of being skipped as waiting on it. A trigger whose cron line or zone no longer reads (a newer cron library or time zone data refuses it) is turned off alone with `disabled: {reason: "source_unreadable", detail}`, at a start or when it comes due, and every other schedule goes on firing; the log names it instead of a failed write, and nothing is retried for it. A first start that sends `trigger.failed` takes failures an earlier server recorded as already told. A trigger's input is checked at create and PATCH as its runs are given it, with the line saying what fired it.
|
|
173
|
+
- `GET /usage`: a run whose cost is unknown (a model request a restart cut, a paid call a crash cut, a provider with no price) adds what it is known to have spent so far to the total and its lines, and is still counted in `unpriced_runs`. A total is never below a line of its own (a run's browser time no longer drops out of the total), and with `unpriced_runs` above 0 it is a lower bound.
|
|
174
|
+
- GET /stats counts a run that has just ended as ended, as GET /runs/{id} already says, never as running or as a run of unknown cost. A run reads ended as soon as its turn ends, and its end, with its metrics, reaches the agent store after its process has let it go. Before, /stats counted it meanwhile as a running run: status unknown, cost unknown, effort unset, no tokens. Now, while its end is on its way, it is counted completed (or failed, or stopped) in the run counts and the totals, and its tokens, cost and effort are left out until the store has them, when it counts whole. `AgentStoreReader.analytics` takes `pending`, the runs whose end the caller holds, by the state their end will have.
|
|
175
|
+
- A request you stop under a cap counts the reasoning it never streamed. A model whose reasoning streams only as a summary (the Responses API's reasoning, Claude 4-class thinking) is billed for far more than the summary's bytes. A stop after about 10,000 hidden reasoning tokens on a gpt-5-class model with a 20 KB context cost about $0.106 and counted $0.038, so deliberate stops could pass a cap. A stopped request that reasons now also counts the part of its reasoning budget that did not stream: input + streamed + 1,024 + max(0, reasoning budget - reasoning streamed), never more than its hold. Real usage still replaces the figure when it comes.
|
|
176
|
+
- **On pi:** a reasoning model's stopped request counts its thinking level's budget (on Anthropic's API, the `budget_tokens` it was sent with, for a model whose thinking takes one). A Claude model that thinks adaptively (every current one on Anthropic's API) is sent no budget, and its thinking is bounded only by its output limit, so it counts that limit less 1,024 tokens: in practice its hold. A stop after a 300-byte thinking summary on Sonnet 5.5 with a 20 KB context under a $1 cap counted $0.142 at medium and $0.224 at high, against about $0.45 for 40,000 adaptive thinking tokens. The request's output limit is now the one actually sent: the cap had taken a thinking budget out of it that pi-ai never sends (8,192 tokens at medium), so the request was held at more than it was sent with. With no level, on an API whose model reasons at its own default, it counts its whole output limit. With thinking off on Anthropic's API, on a model whose thinking can be off, nothing more.
|
|
177
|
+
- **Adaptive thinking counts up to the hold.** On every current Claude model, on pi and on `claude-agent`, the provider is given no thinking budget, so a stopped request counts up to the hold the cap took for it. Under a cap with little left beside that hold, the request after the stop can be refused.
|
|
178
|
+
- **On `codex`:** the effort's budget (minimal 1,024, low 2,048, medium 8,192, high 16,384), none at effort `none`, and the output limit when the body names no effort.
|
|
179
|
+
- **On `opencode`:** the same as `codex` (the same Responses API): what a stop counts as streamed is the content its deltas carried, not the wire, plus the unstreamed part of its effort's budget. On the walk through OpenCode's proxy (a request at $100 a million output tokens under a $0.50 cap, stopped after 1,146 characters of answer text after the stream's echo of the request) the stop booked 106,831 bytes, its whole $0.50 hold, and refused "Go on."; it now counts $0.217, and "Go on." goes.
|
|
180
|
+
- **On `claude-agent`:** the thinking budget, or `max_tokens` when thinking is adaptive, for every request that thinks; none with thinking off. Thinking that streamed is subtracted, so a stop after a budget's worth of visible thinking counts nothing on top.
|
|
181
|
+
- **Kernel:** a provider policy may read a request's hidden reasoning from its body (`reasoningHidden`). It may also read the reasoning in each streamed event (`reasoningBytesOf`). The model proxy books a stopped response with both (`stoppedHiddenTokens`, `stoppedReasoningBytes`), and the runner counts all it sent plus the part of the budget its reasoning did not cover.
|
|
182
|
+
- **What streamed is the content, not the wire.** On `claude-agent` and `codex` a stop counted the response's bytes as sent, the provider's framing included: about 11.7 bytes a character of text on the Responses API and 24 on the Messages API. A codex request at $100 a million output under a $0.50 cap, stopped after 1,146 characters, booked its whole hold and refused "Go on.". It now counts each text, reasoning and tool-argument delta's UTF-8 bytes, as pi counts its streamed blocks: $0.217, and the next request goes. A provider policy reads them (`contentBytesOf`).
|
|
183
|
+
- **A stop before the provider's first header** on `claude-agent` and `codex` now counts as a stop with nothing streamed (its input and 1,024 tokens, as on pi), not its whole hold. A response the provider answered with an error status still counts at its hold.
|
|
184
|
+
- A message the person stopped the instant it was sent is no longer lost on claude-agent, and the same window is closed on Codex and OpenCode. Asked "Reply with exactly this code and nothing else: CARRY-CLAUDE-7", stopped within its first second, then told "Go on.", a claude-agent run answered "There's nothing earlier in this conversation for me to continue from": Claude takes a message within its first second, so the stop landed after the harness placed it and before the CLI was handed it, and nothing carried it. Now a stop's settle carries a placed message its CLI never took into the next one, as it carries one stopped before it was placed. On claude-agent that is a message the CLI's own transcript, as the session keeps it, does not hold: that transcript is the history a resumed CLI is given, so a carried message is never sent twice. On Codex it is a message Codex's own rollout, as the session keeps it, does not hold. OpenCode marks a message just before it sends it (`prompt_async`), and a marked message is never carried: a crash between the mark and the send loses it rather than sending it twice. After a stop, no new turn is started.
|
|
185
|
+
- **A recovered message is not carried again.** After a crash between a message's placement and its CLI's record, the recovery message carries its words. It now records which messages it carries, before it goes (a kernel effect by its id on claude-agent, its `PROMPT_STREAM` record on OpenCode). Once the CLI holds the recovery message, a stop's settle and a later recovery both count those messages sent, so nothing is sent twice, even after a second crash. Codex's recovery already did this through its client id.
|
|
186
|
+
- **A follow-up's own prompt** (the host's, named to the settle) is withdrawn and never carried into the person's next message, as the follow-up says: a host prompt that never ran is not sent. A person's message waiting beside it is left as it is.
|
|
187
|
+
- A Codex or Claude run stopped right after a tool finished, then told "Go on.", showed the follow-up as "You (steer): Go on." in the timeline, as if it had joined the stopped turn. The timeline now reads the turn's end that serve writes, so the follow-up shows as "You: Go on.".
|
|
188
|
+
- A person's own message shows as they typed it, with any held key redacted. Its Timeline row (summary and text) shows a pasted key as `[redacted]`, and a pasted URL keeps its fragment and query (a console link's `#/runs/<id>` no longer reads as the bare origin). A run's title, taken from an agentic run's first message or a workflow run's input, holds no held key on the run's page, the runs list, Mission Control or an agent's runs, including a key a long value's cut would have split. The agent still gets its message and input exactly as given: only what is shown changes.
|
|
189
|
+
- The webhook ledger test closes its first server once each try has its answer, not once the receiver has the request, so a slow CI runner no longer cuts a try and gets the message twice; the test is out of quarantine.
|
|
190
|
+
- The tool gate's `Executor` contract says who bounds an approved call: the executor does. The gate puts no wall-clock bound on it (only a stop or a cancel cuts it, through its `signal`), so an executor bounds its own work and answers a timeout as an error result.
|
|
191
|
+
- The serve README's spend cap section says why a stopped request on a Claude model that thinks adaptively counts its whole thinking budget: the provider reports the thinking it billed only at the end of its stream, which a stopped stream never receives, so that budget is the safe figure.
|
|
192
|
+
|
|
5
193
|
## 0.1.0-beta.29 (2026-11-04)
|
|
6
194
|
|
|
7
195
|
- New held package `@parcha/agentrun-serve`: the Agentrun v2 API (`agentrun.v2/0`, the contract the hosted API serves) on
|