@parcha/agentrun-serve 0.1.0-beta.42 → 0.1.0-beta.44
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 +126 -0
- package/README.md +221 -31
- package/dist/cli.js +42 -8
- package/dist/composio-preset.d.ts +4 -3
- package/dist/composio-preset.js +12 -4
- package/dist/composio-triggers.d.ts +20 -2
- package/dist/composio-triggers.js +183 -17
- package/dist/computer-lost.d.ts +11 -0
- package/dist/computer-lost.js +19 -0
- package/dist/computer-record.d.ts +10 -2
- package/dist/computer-record.js +50 -18
- package/dist/computer-setting.d.ts +1 -0
- package/dist/computer-setting.js +2 -2
- package/dist/console/assets/index-BUktRvS-.css +1 -0
- package/dist/console/assets/index-nB9kTfIN.js +711 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.js +0 -4
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +3 -0
- package/dist/harness-table.d.ts +51 -3
- package/dist/harness-table.js +101 -13
- package/dist/harness.d.ts +18 -1
- package/dist/harness.js +21 -9
- package/dist/host.d.ts +12 -10
- package/dist/host.js +18 -16
- package/dist/import-sources.js +25 -5
- package/dist/import-worker.d.ts +3 -0
- package/dist/import-worker.js +7 -5
- package/dist/import.d.ts +22 -1
- package/dist/import.js +141 -28
- package/dist/learn/audit.d.ts +123 -0
- package/dist/learn/audit.js +159 -0
- package/dist/learn/check.d.ts +3 -0
- package/dist/learn/check.js +1 -1
- package/dist/learn/compile.d.ts +50 -74
- package/dist/learn/compile.js +90 -124
- package/dist/learn/delete.d.ts +17 -0
- package/dist/learn/delete.js +44 -0
- package/dist/learn/folder.d.ts +9 -0
- package/dist/learn/folder.js +13 -2
- package/dist/learn/promote.d.ts +92 -200
- package/dist/learn/promote.js +65 -187
- package/dist/learn/replay-calls.d.ts +5 -0
- package/dist/learn/replay-calls.js +12 -1
- package/dist/learn/secrets.d.ts +8 -0
- package/dist/learn/secrets.js +12 -0
- package/dist/learn/skills.d.ts +4 -0
- package/dist/learn/skills.js +19 -5
- package/dist/learn/workflow-nodes.d.ts +23 -3
- package/dist/learn/workflow-nodes.js +30 -12
- package/dist/learned-nodes.d.ts +9 -34
- package/dist/learned-nodes.js +11 -23
- package/dist/learned-workflow.d.ts +6 -8
- package/dist/learned-workflow.js +18 -57
- package/dist/learning-batch.d.ts +13 -5
- package/dist/learning-batch.js +34 -8
- package/dist/learning-cost.d.ts +111 -4
- package/dist/learning-cost.js +120 -3
- package/dist/learning-evals.d.ts +2 -0
- package/dist/learning-evals.js +4 -3
- package/dist/learning-routes.d.ts +8 -0
- package/dist/learning-routes.js +18 -1
- package/dist/learning-setting.d.ts +16 -1
- package/dist/learning-setting.js +34 -2
- package/dist/learning.d.ts +1 -1
- package/dist/listen-first.d.ts +30 -0
- package/dist/listen-first.js +115 -0
- package/dist/llms.txt +2 -1
- package/dist/mcp-servers-store.d.ts +12 -12
- package/dist/model.d.ts +8 -4
- package/dist/model.js +16 -8
- package/dist/openapi.js +203 -87
- package/dist/owner.d.ts +8 -0
- package/dist/owner.js +11 -0
- package/dist/paid-calls.d.ts +6 -0
- package/dist/paid-calls.js +11 -1
- package/dist/place.d.ts +8 -3
- package/dist/place.js +13 -9
- package/dist/provider.js +15 -1
- package/dist/run-launch.d.ts +6 -3
- package/dist/run-launch.js +2 -0
- package/dist/run-learning-served.d.ts +1 -1
- package/dist/run-model-key.d.ts +64 -0
- package/dist/run-model-key.js +147 -0
- package/dist/runner/adapter-loop.d.ts +10 -0
- package/dist/runner/adapter-loop.js +26 -4
- package/dist/runner/adapter-run-spec.d.ts +6 -3
- package/dist/runner/adapter-run-spec.js +83 -25
- package/dist/runner/adapters/index.d.ts +4 -2
- package/dist/runner/adapters/index.js +13 -4
- package/dist/runner/audit.d.ts +68 -0
- package/dist/runner/audit.js +349 -0
- package/dist/runner/beside.d.ts +2 -1
- package/dist/runner/beside.js +6 -3
- package/dist/runner/claim-secrets.d.ts +49 -0
- package/dist/runner/claim-secrets.js +110 -1
- package/dist/runner/cli-run-spec.d.ts +2 -1
- package/dist/runner/cli-run-spec.js +44 -15
- package/dist/runner/commands.d.ts +3 -6
- package/dist/runner/feedback-round.d.ts +3 -2
- package/dist/runner/feedback-round.js +8 -7
- package/dist/runner/harness-loops.js +31 -23
- package/dist/runner/journal-kinds.d.ts +5 -7
- package/dist/runner/journal-kinds.js +0 -7
- package/dist/runner/learning-dispatch.d.ts +0 -16
- package/dist/runner/learning-dispatch.js +4 -47
- package/dist/runner/learning-end.d.ts +55 -13
- package/dist/runner/learning-end.js +128 -44
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +1 -4
- package/dist/runner/learning-loop.d.ts +2 -38
- package/dist/runner/learning-loop.js +8 -116
- package/dist/runner/loop-contract.d.ts +6 -0
- package/dist/runner/loop-contract.js +4 -0
- package/dist/runner/loop.js +6 -2
- package/dist/runner/main.d.ts +1 -0
- package/dist/runner/main.js +25 -8
- package/dist/runner/memory-claim.d.ts +9 -6
- package/dist/runner/memory-claim.js +12 -9
- package/dist/runner/promotion.d.ts +55 -54
- package/dist/runner/promotion.js +232 -585
- package/dist/runner/reflect-hook.d.ts +14 -0
- package/dist/runner/reflect-hook.js +28 -3
- package/dist/runner/runner.js +57 -4
- package/dist/runner/store-secrets.js +9 -5
- package/dist/runner/workflow-first.d.ts +6 -5
- package/dist/runner/workflow-first.js +17 -12
- package/dist/runner/workflow-spec.js +10 -2
- package/dist/runs-over-store.d.ts +5 -4
- package/dist/runs-over-store.js +13 -3
- package/dist/sdk/workflows.d.ts +1 -1
- package/dist/server.d.ts +64 -50
- package/dist/server.js +516 -134
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/seal.d.ts +20 -2
- package/dist/store/seal.js +24 -8
- package/dist/store/sqlite/run-launch.d.ts +4 -1
- package/dist/store/sqlite/run-launch.js +12 -0
- package/dist/store/sqlite/store.d.ts +3 -2
- package/dist/store/sqlite/store.js +119 -16
- package/dist/store/store.d.ts +41 -3
- package/dist/store-reads/analytics.js +11 -1
- package/dist/store-reads/learning.d.ts +57 -7
- package/dist/store-reads/learning.js +194 -28
- package/dist/store-reads/loop.d.ts +4 -39
- package/dist/store-reads/loop.js +10 -79
- package/dist/store-reads/stats.js +13 -3
- package/dist/store-view.d.ts +5 -1
- package/dist/store-view.js +12 -1
- package/dist/telemetry.d.ts +59 -0
- package/dist/telemetry.js +153 -0
- package/dist/tool-keys-store.d.ts +1 -1
- package/dist/tool-keys.d.ts +2 -2
- package/dist/tool-plane.d.ts +12 -12
- package/dist/tools.d.ts +11 -11
- package/dist/tools.js +18 -5
- package/dist/trigger-adapter.d.ts +3 -0
- package/dist/trigger-adapters.d.ts +4 -0
- package/dist/trigger-adapters.js +13 -0
- package/dist/trigger-composio.d.ts +58 -1
- package/dist/trigger-composio.js +160 -6
- package/dist/triggers.d.ts +4 -0
- package/dist/triggers.js +22 -3
- package/dist/validate.d.ts +11 -7
- package/dist/validate.js +8 -7
- package/dist/workspace/computer-for-claim.d.ts +15 -5
- package/dist/workspace/computer-for-claim.js +228 -32
- package/dist/workspace/resolve-computer.d.ts +8 -2
- package/dist/workspace/resolve-computer.js +1 -1
- package/dist/workspace/run-tools.d.ts +1 -1
- package/dist/workspace/run-tools.js +14 -3
- package/package.json +10 -9
- package/dist/console/assets/index-C3gNPz58.css +0 -1
- package/dist/console/assets/index-DYJ_wj27.js +0 -711
- package/dist/learn/general.d.ts +0 -69
- package/dist/learn/general.js +0 -75
- package/dist/learn/refit.d.ts +0 -48
- package/dist/learn/refit.js +0 -264
- package/dist/runner/step-guard.d.ts +0 -62
- package/dist/runner/step-guard.js +0 -93
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,132 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.44 (2026-11-17)
|
|
6
|
+
|
|
7
|
+
- A run can bring its own model key, such as a LiteLLM virtual key minted for it: `model_key` on `POST /v2/runs`, `POST /v2/agents/{agent_id}/runs` and `POST /v2/runs/{run_id}/messages`. Every model request tied to the run carries it in place of the server's key, through the model proxy: its turns, subagents, learned workflows' nodes, workflow model nodes and end-of-run look-back. AgentRun never mints, lists or revokes it.
|
|
8
|
+
- Custody follows `mcp_auth`: taken out of the body first, sealed with the run bound to the gateway's origin, opened at each claim (a reclaim after a crash too), erased by the write that ends the turn, redacted, and never seen by the harness, its tools or its sandbox. A message's key replaces the run's from the turn it starts.
|
|
9
|
+
- No setting: a server with a gateway (`AGENT_MODEL_BASE_URL`) and no model key of its own starts and reads ready, and its callers bring their own. A run whose model goes to the gateway with no key to spend is 422 `model_key_required` at its start, as is a message that would start a new turn without one; a trigger's firing on such a server fails the same way.
|
|
10
|
+
- Behavior change for a gateway that takes no key: a server with `AGENT_MODEL_BASE_URL` and no `AGENT_MODEL_API_KEY` used to send `none` as the key; its runs now need `model_key`. Set `AGENT_MODEL_API_KEY` to any value to keep the old behavior.
|
|
11
|
+
- claude-agent with `ANTHROPIC_BASE_URL` on the gateway's origin no longer needs a standing `ANTHROPIC_API_KEY`: it runs on the run's key.
|
|
12
|
+
- `model_key` where the run's model never goes to the gateway (no gateway, a native run, a model routed elsewhere) is 422 at `model_key`.
|
|
13
|
+
- Spend after a run's turn ends is never sent on the run's key or the server's: a run that brought its own key queues no learning grade (dropped `grade_failed`, in words), starts no shadow audit or replay check, and a server with no key skips them, refuses an owner's replay (409) and learning from a CSV, and opens no grade feedback round.
|
|
14
|
+
- A harness is one entry in serve's harness table: capabilities, a revision's save check, the runner and the console all read the table. An owner can add harnesses with a harness module. Start the server (and any separate runner) with `--harness-module MODULE` (repeatable) or `AGENTRUN_SERVE_HARNESS_MODULES` (comma-separated). MODULE is a path, or a package installed with `npm install --prefix <data>/harnesses <package>`, that exports the `entries(builtins)` shape test tables already use.
|
|
15
|
+
|
|
16
|
+
A module adds whole entries of new ids. A module's harness runs on its own runner's adapter, and a run of it reserves the memory its entry declares (`runMib`). A module's harness without adapter facts runs pi's tools, and capabilities list it on each of those tools (`tools[].harnesses`, now ids of the table, not an enum) and on MCP grants, so an agent on it keeps its tool choices. A module that gives an id outside `^[a-z][a-z0-9-]{0,39}$`, names an id serve's own runs carry (`learning`, `sdk`, `workflow`, `claude-agent-sdk`, `codex-sdk`) or every object already has (`constructor`), names a built-in harness (pi, claude-agent, codex, opencode), names an id another module adds, or leaves out a member refuses the start of the server or of a separate runner, naming the module and the id.
|
|
17
|
+
|
|
18
|
+
Capabilities' `harnesses` now carry each harness's `label` and `promises`: `resume` (`exact`, `load`, `restart`), `tool_gate` (`every_call`, `permission`, `config`) and `billing` (`proxy`, `plan`). The built-in harnesses promise exact resume, every call gated, and proxy billing. A harness id in the API is now a string (pattern `^[a-z][a-z0-9-]{0,39}$`), not an enum of the four built-in ones. The console offers a harness the server adds after the built-in ones, under the label the server gives it; one named `decision` stays a harness, never the Decision starter.
|
|
19
|
+
- An agent whose computer is a browser can record its runs: `computer: {"kind": "browser", ..., "record": true}` makes a video of each browser session's page, `recordings/<computer>.mp4` with one file per session, under the same caps, pause and stop rules as a desktop's or a phone's, listed in the run read's `recordings` and served by the files route. A browser with `record: true` was refused with 422 before.
|
|
20
|
+
- The video is the live view's own CDP screencast of the session, shared with a person's viewer (one screencast per session, never a second); each frame is stamped as it comes, so a page that sits still does not shorten the video.
|
|
21
|
+
- `@parcha/pi-browser`'s live view takes a host's watch of a session's frames, with or without a viewer: `liveView.watch(tag, { frame, ended })`. A viewer that joins a stream already running is sent the page, any dialog and the newest frame.
|
|
22
|
+
- The server can count itself, anonymously: `server_started`, a daily `heartbeat` and `first_run_completed`, each with a random id kept in the data directory, the version, the platform and how many runs ended as a range. **This release sends nothing**: the receiver's key is not set, and the release that sets it will say so. `AGENTRUN_TELEMETRY=0` or `DO_NOT_TRACK=1` turns it off, as do `CI` and `--faux`; `AGENTRUN_TELEMETRY=debug` prints each event and sends none. [docs/telemetry.md](https://github.com/Parcha-ai/agentrun/blob/main/docs/telemetry.md) lists every field.
|
|
23
|
+
The start that first could send prints one notice on stderr and sends nothing at that start.
|
|
24
|
+
A send never delays a start, a run or a stop; a failed one is dropped.
|
|
25
|
+
- On an agent's page in the console, shown side by side (1024 px and wider), the agent's name, description and id stay in place and the details under them (its facts, tools, configuration and live jobs) scroll in their own box; the workspace beside them (runs, versions, learning, analytics) scrolls by itself. The whole page scrolled before, taking the name with it. Each box's scrollbar is slim, sits in a gutter of its own beside the cards, never over their edge, and shows only while the box is being scrolled or the pointer is on the bar; an edge the content goes on past fades out. The name, description and id take at most half the column: a description longer than that scrolls in a box of its own between the name and the id, so the details under them can always be reached. In one column, on a narrower window, the page scrolls whole as before.
|
|
26
|
+
- The console's coding-agent menu (Connect agent, Build an agent, Run agent and the like) opens under its control from the control's left edge. It was placed by the chevron's right edge, so a control narrower than the 240 px menu, near the left of the page, pushed the menu left of the control and over the navigation. Where the left edge would leave the viewport (a control at the right of a toolbar), the menu still opens from the control's right edge.
|
|
27
|
+
- More of a Composio trigger's config credentials are now sealed.
|
|
28
|
+
- The name rule reads each word as its singular, so `tokens`, `secrets`, `api_keys` and `private_keys` are sealed. It also takes `hapikey`, `pat`, `pwd`, `passcode`, `jwt`, `dsn` and `connection_string`. Names such as `key_id`, `keyword`, `status`, `pattern`, `path` and `address` stay as they are.
|
|
29
|
+
- A field that the event's schema marks with `format: "password"` or `writeOnly: true` is sealed whatever its name, and the events list names it under `sealed`. To check this, the create now reads the event's schema from Composio.
|
|
30
|
+
- A number in a credential's field is sealed like a string, at any depth. Composio still gets it as a number, and answers show `"[sealed]"`. A PATCH that leaves it out keeps it. A run's output is cut of its decimal text when that text is 8 characters or more.
|
|
31
|
+
- On SQLite, the cleanup after the start-time sealing waits briefly and tries once more when another connection is writing to the store. If it still can't finish, the log says `store_scrub_not_done` and the next start finishes it.
|
|
32
|
+
- Deleting a trigger retires its sealed values into a sealed row until the runs that saw them end. The docs used to say the values are removed.
|
|
33
|
+
- A Composio trigger's config seals addresses that carry a credential, and stops sealing counts.
|
|
34
|
+
- A credential word right next to a count word names a count, so `max_tokens`, `token_count`, `token_limit`, `tokens_used` and `maxTokens` stay as they are, a number in one too. `access_token`, `token`, `api_tokens`, `refresh_token`, `token_secret` and `bot_token` are still sealed. A field the event's schema marks as a password is sealed whatever its name.
|
|
35
|
+
- An address in any scheme (`https`, `postgres`, `redis`, `amqp`, `mongodb+srv`...) with a user part (`user:pass@`, `:pass@`, or a token alone as in `https://TOKEN@host`), or with a query or fragment parameter named like a credential (`token`, `api_key`, `access_token`, `sig`), is sealed whole, whatever its field's name. A create with one below the config's top level is refused `422`; one an earlier server kept is masked on reads and sealed at the next start. An address with none stays as it is.
|
|
36
|
+
- After a start, the server reads the schema of each event an older trigger uses, once, and seals the fields it marks, logging `composio_config_sealed`. A create answer kept under an Idempotency-Key for that trigger is masked too. If that file can't be written, the log says `idempotency_not_saved` with a code and the trigger stays sealed; the next save writes the record masked, and a start before then masks it before serving: each kept create answer is checked against its trigger's sealed fields. It writes a trigger only while it is as it read it; one changed or deleted meanwhile is left for the next start, with nothing sealed left behind for it. It runs no `VACUUM` while serving: the log says `store_scrub_not_done` with `reason=deferred`, and the next start's scrub finishes before it serves. When Composio can't be reached, it logs `composio_config_schemas_unread` once with a code and tries again at the next start. The start doesn't wait for this.
|
|
37
|
+
- A field named `sig` is now sealed.
|
|
38
|
+
- A Composio trigger's config field named like a credential is now sealed when the trigger is saved. This covers names like `developer_api_key`, `api_key`, `client_secret`, `access_token` and `password`: any field where a word of the name is secret, password, passwd, passphrase, token, credential, apikey, authorization, bearer or cookie, or where the last word is key, and the value is a string. The value is kept in the composio source's sealed settings, next to the subscription's secret. Composio still receives it when the server creates the trigger instance. Every trigger answer (create, GET, list, PATCH, template apply) shows `"[sealed]"` in place of the value and names the field in the source's new read-only `sealed_config`.
|
|
39
|
+
- A create whose config holds such a value below its top level (inside an object or a list) is refused with a 422 that names the field. Composio's trigger configs are flat.
|
|
40
|
+
- A PATCH that leaves a sealed field out, or sends `"[sealed]"`, keeps the value. Sending a different value is a config change and is refused, as any config change to a composio trigger already is. To change a key, delete the trigger and make a new one; the refusal says so.
|
|
41
|
+
- Deleting the trigger retires its sealed values into a sealed row until the runs that saw them end. A trigger saved before this release with such a value in plain text is answered masked at once, at any depth, and sealed at the next start; its Composio instance is not changed. On SQLite the store's files keep no copy of the old row after that rewrite, including copies that earlier updates of the row left in free space. If that cleanup can't finish (another connection holds the database's log), the log says `store_scrub_not_done` and the next start finishes it. The log names the trigger and the field, never the value.
|
|
42
|
+
- The events list (`GET /v2/settings/mcp-servers/{name}/composio/events`) names each event's sealed fields under `sealed`, and the console's form takes those as password inputs. A trigger's page shows them as sealed.
|
|
43
|
+
- When a call to Composio involves a trigger's sealed value, a refusal is answered and logged in the server's own words (the step and the HTTP status), never Composio's. On other calls, Composio's words still pass on with the API key removed, including its JSON-escaped and percent-encoded forms.
|
|
44
|
+
- An Idempotency-Key's record in the data directory now keeps an HMAC of the request body under a key derived from the server's seal key, not the body itself, and keeps a trigger create's answer masked. Other answers, such as a run's input, replay as they were. Records an older server wrote (kept for up to a day) are rewritten at start, and the log says how many.
|
|
45
|
+
- Console polish:
|
|
46
|
+
- **Use your agent** stands at the same height as **Send request** beside it, in the API playground's three footers (it was a toolbar-sized control beside a form-sized button). The coding-agent control takes a `size`, a Button's.
|
|
47
|
+
- An agent card's icon is level with the agent's name and its chips: it sat 2 px above the line's centre.
|
|
48
|
+
- A page's header shows the icon its navigation item does: Mission Control's and Connected agents' headers showed other icons.
|
|
49
|
+
- `scripts/dial-conformance.mjs` creates no machine until its public address reaches it. Its `GET /v2/health` now carries the run's id in `x-dial-conformance-run`, and the script asks `AGENTRUN_PUBLIC_URL/v2/health` once a second until three answers in a row carry that id, for up to 10 minutes. A host that swaps instances, such as Render on a deploy, keeps answering from the previous process for a while. Before this, a machine that dialed in that window was refused its token there (401) and never joined, so every Core case failed with "create did not answer within 180 s". While it waits the script says so, and it says how long the wait took. If the address never reaches it, the run fails in words without creating anything.
|
|
50
|
+
- The API playground's operation picker keeps one width. The field was as wide as the operation picked, so it grew and shrank with each choice, and its list, as wide as the field, wrapped "POST · Apply a template" onto two lines. The field is now as wide as its longest operation needs on one line, and the list is never narrower than its longest row. The console's `Picker` takes this as `steady`; every other picker is unchanged. A real-browser flow (`playground-operation-width` in `npm run test:e2e`) measures it at 1280 and 390 px: one field width whichever operation is picked, every row of the list on one line, no sideways scroll, and in a narrower space a field that shrinks and cuts its words with an ellipsis.
|
|
51
|
+
- A run whose sandbox is lost mid-run now gets a new one. Before, every later tool call went to the deleted sandbox and failed, and the run could still end `completed`.
|
|
52
|
+
- A sandbox is lost when its provider no longer has it: the hosted connection says it was deleted, or a call answers gone and the provider's read of the machine answers not found.
|
|
53
|
+
- The tool call that finds it lost fails in the provider's words. The next tool call starts a new sandbox under the same claim (its own create request, the claim's labels and epoch) and runs there, also when the lost sandbox was kept through a park. A start that fails is tried again at the next tool call under the same request, and does not count toward the bound. In Mode 2 the new sandbox mounts the run's folder with a new Archil mount credential, and the lost one's credential is removed.
|
|
54
|
+
- The timeline says `Its computer was lost; started a new one (<name>).`
|
|
55
|
+
- A claim starts at most 2 new sandboxes. The next loss fails the run at once, whichever call finds it (the owner's computer channel too), even if the model answers without another call, served with error code `computer_unavailable` and the provider's words.
|
|
56
|
+
- A 5xx, a timeout, or a failed read of the machine is not a loss and starts nothing. Desktops, phones, paired computers and an agent's own computer are never started again this way. The run's end and the owner's computer channel never start one either.
|
|
57
|
+
- A learned workflow this release's DSL refuses is held with the DSL's reason and recompiled once; it no longer reads `serving` while every run hands back.
|
|
58
|
+
- The first run a refused revision serves hands back as before, and writes one promotion hold for that digest: `reason` "this release's workflow DSL refuses it: <code> at <path>: ...", cut of the host's secrets, with neither `check` nor `audit`. Concurrent and later runs write nothing more; the agent takes them. The promotions read says `held`, and the agent's next run asks the one recompile with that reason; a recompile that is held again stops.
|
|
59
|
+
- Shadow audits draw only runs the workflow answered alone (path `workflow`). A run it handed back is never drawn and never counts as a served run for `learning.audit_later_after`, `learning.stop_window` or `not_auditable`.
|
|
60
|
+
- A first agent that needs no shell starts at once, and a local model's reasoning stays out of its answer.
|
|
61
|
+
- A new agent with no place whose tools need no shell (`tools: []`, or tools such as `read`, `write` and `web_fetch`) is saved with no place and runs on the runner. It used to get the Docker box, so its first run waited for a container it never used. An agent with no tools named still gets the box and bash, and so does one that names `bash` or a background tool. A revision with no place resolves the same way at each run, and the console's agent page and editor say where it runs by the same rule.
|
|
62
|
+
- A model the catalog doesn't list (a local model behind `AGENT_MODEL_BASE_URL`, or a gateway's own alias), run with no thinking level, is no longer sent `reasoning: {effort: "none"}`. It now thinks at its lowest level, so a model that reasons anyway gets its reasoning split out of the answer. On Ollama with a thinking model such as `qwen3:4b`, that reasoning used to come back at the start of the answer text. A run that sets a thinking level is sent that level, as before.
|
|
63
|
+
- The README said a Docker run's container is made on its first `bash` call. It is made when a runner takes the run, and the README now says so.
|
|
64
|
+
- AgentRun Server binds its port and prints `Starting <url>/` before it loads the rest of itself, so a start on a slow or loaded disk names its address in seconds, not minutes. Until it is ready it answers that it is warming: `GET /v2/health` is `503` with `status: "warming"` and `checks.store: "opening"`, the API answers `503 unavailable` with a `Retry-After`, and a browser gets a page that reloads itself. On a cold disk, a request sent while the server's modules load is answered once they have. Then the banner prints as before, and its `Open ` line still means ready.
|
|
65
|
+
`npx @parcha/agentrun` takes the `Starting` line as the server listening: it names the address on stderr at once, and its start bound (60 s, or `AGENTRUN_START_TIMEOUT_MS`) no longer stops a server that is up and still loading. A start that does pass the bound says so and names `AGENTRUN_START_TIMEOUT_MS`.
|
|
66
|
+
A port already taken when the server starts is left to the start's own wait, as before, so a restart still waits for the server it replaces and takes its port.
|
|
67
|
+
- `GET /v2/runs?status=…` and `GET /v2/agents/{id}/runs?status=…` read only the runs still going over their journals: an ended run's status comes from its row, the status its view already gave. The filter rebuilt every run's view to compare statuses, so its time grew with every run the server held (about 1.2 s at 100 runs, on the server's main thread), and Mission Control's Needs you strip asks three of these lists every 10 s, which slowed every other request while the console was open. At 100 runs the three lists now answer in a few milliseconds each.
|
|
68
|
+
- The console's first visit says where the setup code is, and gets a new one without a restart. Someone whose coding agent deployed the server reached the Setup code field with no way to find the code, or with one past its 30 minutes.
|
|
69
|
+
- Under the field, a server at a Render address (`*.onrender.com`) names the service's Environment tab (`AGENTRUN_TOKEN`) and its Logs tab; any other server names the log line (`Set up this server: ...#code=`), where that log is (the terminal, `docker logs`, Render's Logs tab) and the API token that stands in for the code. Both say that a code works once and lasts 30 minutes, as the refusals of an expired or wrong code now do.
|
|
70
|
+
- **Get a new code**, under the field, and the new route behind it, `POST /v2/setup/code`, taken with no credential: the server prints a new `Set up this server:` line to its log when the last code is expired or spent, and keeps one that is still good, so asking never voids a link someone holds. It answers `{printed, expires_at}` and never the code; 403 once the owner is set or where setup takes no code. The console then says where the new line is and until what time it works. The page still never holds the code.
|
|
71
|
+
- The setup skill (`docs/SKILL.md`) has the assistant give the person the code's place, or the newest setup link, in the same message as the console address, saying in it that the link works once, when it expires and how to replace an expired one; it renews with `POST /v2/setup/code` rather than a restart, and never pastes the API token into the chat.
|
|
72
|
+
- `deploy/README.md` has a section, "The first visit's setup code", with the same places and the renewal.
|
|
73
|
+
- Setup's import of this machine's sessions takes only the projects the owner chooses, and a large history no longer exhausts the server's memory. The console's setup page lists the projects found, each with how many sessions it holds, from which tools, and how long ago the latest ended. None is ticked, and nothing is imported unless a project is ticked. Before, one box imported every project, and a session with many subagents was read into memory at once: about 5 GB of them took the server to 3.9 GB in six seconds, the import stopped with nothing written, and every later start tried again.
|
|
74
|
+
- `GET /v2/setup/import` before the owner is set now also answers `candidates`: one `{id, name, path, sessions, sources, last_active}` per project, the latest active first, at most 500. `projects` and `sessions` still count everything found.
|
|
75
|
+
- `POST /v2/setup` takes `import` as a list of those ids (at most 500) and imports those projects alone: no other project is read for keys or written. `import: true` still imports every project. `false`, an empty list or no field imports nothing. Anything else is a 422 on `import`, and sets no owner. The choice is kept with the owner's yes, so an import a stop interrupted goes on with the same projects at the next start. `skipped` then counts what was left out of the chosen projects alone, not of projects the owner did not choose.
|
|
76
|
+
- A run is read whole, so a session whose files and subagents' files are over 256 MB together is left out whole and counted in `skipped` (the CLI says "sessions over 256 MB"). It is never cut short: one subagent file over 256 MB leaves its session out too, where before the session was imported without that subagent's usage and nothing said so. The rest of the history imports. `agentrun-serve import` and its `--dry-run` leave the same sessions out.
|
|
77
|
+
- The import's worker has a heap of its own, at most 2 GB. An import that needs more ends as a stopped import, with the reason in the server's log.
|
|
78
|
+
- An import that three starts began and none ended (its worker failed, or the server ended during it) is given up: the owner's yes is dropped, later starts do not take it up, and `GET /v2/setup/import` answers `{"state": "failed"}` to the owner, which the console says. A stop by the server's own shutdown is not counted. To try again, run `agentrun-serve import` with the server stopped. The three starts are counted across the whole import, a start that took some sessions before the server was killed included, and `failed` is answered until the next start, after which the route answers as with no import asked. A kept choice that cannot be read (a damaged file) is given up at once and imports nothing: it is never taken for "every project".
|
|
79
|
+
- The projects listed before the owner is set (`candidates`) have the values of the server's own keys cut from `name` and `path`, as the import cuts them from a folder's name. They are answered only where the import is offered, a server on this machine's loopback with open setup and no public address, to a request from its own page.
|
|
80
|
+
- The console's Triggers page is framed as its other list pages are. It has the header bar with the place's icon and name, and its five New buttons sit in that bar at toolbar size with New schedule, the main one, last; it had a large title in the page and large buttons beside it. With no trigger yet, the panel that offers the five kinds has no tinted frame around it: its words start at the page's left edge, under the header's, and its five buttons are alike, since none of them is the main one.
|
|
81
|
+
- The Learning tab shows the owner's bill: run after run, what the agent has cost with learning (every run that does a job, its look-back, grade, audit shadow run and its share of its workflow revision's compile and check, booked dollars only), cumulative, against the agent doing all of it (the mean of its own runs before its first run on a served path, times the runs), with a break-even marker where the bill falls to that line and stays, or "not yet" with the gap. Under it, the audit line (agreement over the hold window and all time, each hold at the run the server placed it on) and the serving workflow's nodes with their tiers, code checks and the check it was promoted on.
|
|
82
|
+
- `GET /agents/{id}/learning/cost` has `bill`: its points, the baseline, the first served run, `break_even` or `gap_usd` (spend booked after the last point included), the runs withheld, each revision's compile and check spend as its next `compile_after` served runs carry it (a revision is its workflow and its digest: two workflows of the same text each pay their own way), what no run carries (`unattributed_usd`: the booked total less every run's all-in) and each hold at its run (`holds`).
|
|
83
|
+
- `GET /agents/{id}/learning/promotions` has each serving workflow's `champion`: its nodes with their tiers and code checks and the check it was promoted on, read by the champion's recorded digest and commit.
|
|
84
|
+
- `GET /runs/{id}` has `path`, and its `cost.usd` is the job's own: `cost.learning_usd` is what learning spent for the run (its look-back, a compile turn left out, its grade, its audit's shadow run, its share of its revision's compile and check) and `cost.all_in_usd` the two. A compile turn is its revision's; one whose drafts all failed is in the bill's `unattributed_usd`. Every run's `all_in_usd` plus `unattributed_usd` is the bill's total.
|
|
85
|
+
- A shadow run is in no run list, sends no webhook and is no run of `GET /stats` or the analytics' counts; its cost stays in their dollars, on the day and in the groups of the run it audits.
|
|
86
|
+
- The cost series' run figures, the bill's dollars and a run's `cost.usd`, `cost.learning_usd` and `cost.all_in_usd` are as booked, their float noise rounded off at 1e-12, no longer rounded to 1e-6: a decision's sub-micro-dollar cost is in them, and a run's `cost.usd` is what its usage row books.
|
|
87
|
+
- The server has `deleteLearning`, the learning half of an agent's delete: the learning folder (its git history and audits.jsonl) and the agent's promotion, grade and eval records, refused while learning work is in flight, and safe to call again after a crash.
|
|
88
|
+
- Upgrading: `cost.usd` on `GET /runs/{id}` is now the job's own spend, so a run's look-back and compile spend move to `cost.learning_usd` (a compile turn's to the runs its revision serves), as does a served run's audit shadow cost. Read `cost.all_in_usd` for what learning added to the run.
|
|
89
|
+
- A Codex run under a small spend cap no longer stops as early on a hold that overstated its next request.
|
|
90
|
+
|
|
91
|
+
A request that only adds items to the session's last billed request is now held at that bill plus the bytes of the items it adds, with the local count's margin. The bill is all of that request's `input_tokens`, cached tokens included. Any other difference falls back to the local count, as before: changed instructions, tools, reasoning or model, or an earlier item edited, removed or moved.
|
|
92
|
+
|
|
93
|
+
Once the run has seen its model reason, a request's least output is 1,024 tokens plus twice the most reasoning one answer reported, within its effort's allowance. Before that it is the whole allowance, as before.
|
|
94
|
+
|
|
95
|
+
The request is still sent with all the output the cap fits, and the hold is still its worst case, so the cap is never passed. When the provider cuts an answer at the output the cap limited it to, the turn says so. A final answer cut that way ends the run with "the run's $0.50 cap stopped the model at N tokens before it finished its answer: raise the cap to at least $X to let it finish", where $X is the cap that sends that request whole with the run's wrap-up reserve still kept beside it.
|
|
96
|
+
|
|
97
|
+
An image in a custom tool call's output (Codex code mode's exec) is now counted at its billed tokens, as one in a function call's output already was.
|
|
98
|
+
- A Composio trigger's config seals more addresses, and a `PATCH` no longer undoes a seal made while it ran.
|
|
99
|
+
- An address in any scheme with an `@` after `scheme://` and before any whitespace is sealed whole, so a password holding a raw `/`, `?` or `#` (`mongodb://u:pa/ss@host`) is caught too. An `@` in a path or query is sealed as well.
|
|
100
|
+
- A `PATCH` that carries a `source` writes it only on the trigger as it read it. If another write changed the trigger meanwhile (the after-start seal, or a poll's next time), the `PATCH` is checked again on the trigger as it is then, up to three times, then answers `412 precondition_failed`. The check compares the trigger's source as well as its time, so two writes in the same millisecond can't pass for one; the after-start seal's own write is checked the same way. One read before a seal is refused rather than writing the value back in the clear.
|
|
101
|
+
- Deleting a trigger masks every config field of the create answers kept for it under an `Idempotency-Key`, and saves them at once. A start masks those of a trigger already gone the same way before it serves, so no replay hands back a value no trigger is left to seal.
|
|
102
|
+
- Console polish:
|
|
103
|
+
- Every page's top bar is 48 px, so its bottom edge meets the one under the navigation's logo. Most bars were 1 px taller, and the agent editor's 17 px taller. Section titles look alike: Mission Control's was the only one not in capitals.
|
|
104
|
+
- A run's page has its breadcrumb in that bar, above its title.
|
|
105
|
+
- Templates has the sections' top bar. A template's page and the install page lead back to the list from it.
|
|
106
|
+
- Settings → Computers offers Test connection only for a provider whose keys are saved, and a key that changes clears the last result. Paste, Replace and Remove sit beside their key.
|
|
107
|
+
- An agent's run search has its magnifier inside the field, and Mission Control's three Try it buttons look alike.
|
|
108
|
+
- The server starts on a data directory that is a mounted disk. Its first-start check for an earlier version's files stopped with `EACCES` on the disk's `lost+found`, which belongs to root with mode 700. It now skips any path it can't look into. An earlier version wrote its files as the server's own user, so they can't be hiding there.
|
|
109
|
+
|
|
110
|
+
## 0.1.0-beta.43 (2026-11-17)
|
|
111
|
+
|
|
112
|
+
- The old learning promotion loop is gone. A learned workflow has one path to serving: its one check against the agent's own answers, then promote, or hold and one recompile. Nothing else moves it.
|
|
113
|
+
- DSL: step guards are removed. A node takes no `guard` field (the vocabulary's `GUARD_SIGNALS`, `GUARD_FIELDS`, `GUARDED_NODE_KINDS` and `SELF_CONFIDENCE_KINDS`, the `guardStep` dependency, the `guard` escalation kind and the `$confidence` channel), and `softEscalates` is gone with the refit that read it: a replay obeys every escalate.
|
|
114
|
+
- A promotion record keeps `workflow`, `digest`, `at`, `decided` (`promote`, `hold` or `replaying`), `reason`, `check`, `runs`, `inputs`, `replay_id` and `commit`. `source`, `replay`, `refit`, `checked`, `since`, `held_on` and `skipped_by` are gone, and so are the `queued` and `skipped` decisions: a revision waits for a running check and records nothing. A threshold refit, a graded hold, a graded replay and the walk over a workflow's guards are removed with them.
|
|
115
|
+
- `GET /agents/{agent_id}/learning/loop` returns `{ agent, completed_runs, compiles }`: `guards` is gone. `POST .../revisions/{digest}/replays` takes `inputs: "held"` or a number from 1 to 200 and re-checks the revision on the agent's own completed runs; with no earlier check it picks the agent's last `compile_after` completed runs. The cost series' `replay` is the serving check's numbers, with the agreement check it passed (`agreed` of `alone`, its bar `agree_min`).
|
|
116
|
+
- The compile turn asks only for a new workflow or one revision of a held one. A hand-back, a wrong grade and the money rule's stop ask for no revision. A compile whose drafts all fail their checks is a compile too: it writes a hold whose reason names the failed check, a failed first compile earns the one recompile, and a failed recompile stops; nothing is asked again for that revision. The generality pre-check on Jev (`AGENTRUN_SERVE_LEARNING_GENERAL_THRESHOLD`) is removed: the grader reads every note.
|
|
117
|
+
- Upgrading: delete `guard` from every learned workflow and from any DSL a client authors, and stop reading `guards`, a record's `source`, `replay` or `refit`, and the `queued` and `skipped` decisions; read `check` instead. Check records saved in states this release no longer writes (queued, skipped, ...) are ignored; the revision is checked again. An agent with learning history from before this release should turn learning off and on (or delete its learning folder) to start clean.
|
|
118
|
+
- Reduce repeated work when importing large Codex histories and discovering existing connector sessions. Codex transcript reconstruction merges deferred user messages in one ordered pass. Connector discovery allocates session and project identities in a batch while retaining locked, durable canonical IDs and connection consent checks.
|
|
119
|
+
- A run whose folder is on Archil and whose computer mounts that folder now removes its scratch (`.agentrun/tmp` and `.agentrun/output`) at its end. Before, the release logged `remove ".agentrun/tmp": … 409 OperationAborted … another client holds a write delegation` and left the scratch in the owner's folder. The run's end removed the scratch over Archil's file API while the computer's mount still held the folder's write delegation, and each such end first waited out the Workspace's 60 s retry window. The run's end now removes the scratch through the computer when it mounts the folder; the computer's deletes sync to the disk before they answer.
|
|
120
|
+
- The sweep still runs at the run's end, before its end commit. A follow-up that the commit reopens, claimed at once in the same folder, keeps its own scratch.
|
|
121
|
+
- If the computer no longer answers, a Mode 1 run's sweep removes through the run's own folder, as before. A Mode 2 run's scratch stays, and the release logs why.
|
|
122
|
+
- Both the pi spec and the CLI harnesses' spec sweep this way.
|
|
123
|
+
- A learned workflow that serves is audited against the agent itself. A run it serves first is drawn at 1 in `learning.audit_every` (10), then 1 in `learning.audit_every_later` (20) once its revision has served `learning.audit_later_after` (50) runs; the draw is seeded from the run's id. A drawn run starts a shadow run at its end: the same agent on the same input with learning off. A capped run's shadow is capped at what the run's cap left, so the two never spend past it; with less than $0.01 left no shadow starts (its row says `skipped: "no allowance"`), and a shadow never waits on a person: one that would (an approval its tool settings ask, a question, a raise of its cap) ends there at once, no one asked, and its row is `parked` with no verdict, never counted toward a hold. While the shadow is queued or running the served run's `cost.usd`, `cost.all_in_usd` and learning cost read null, and a learning batch closes no row on it until the shadow ends. Only runs started over the API are audited, and only for an agent every tool of which only reads (an MCP tool by its `readOnlyHint`, a built-in by the replay's read list): a shadow never writes a second time. The shadow is no row of the run list, GET /runs/{id} reads it with `audit_of`, and its cost is the served run's learning cost (in its `cost.usd` and the agent's cost series).
|
|
124
|
+
- Each finished audit is a row of `audits.jsonl` in the agent's learning folder, read with GET /agents/{agent_id}/learning/audits: `{run, shadow_run, workflow, digest, promoted_at, source, agreed, served_cost, shadow_cost, turn, at}`, `turn` the served run's answer row the audit compared (its answer when the audit began; a follow-up's later answer is never compared). An owner's grade of a run the workflow answered alone is a row too (`source: "grade"`). A shadow's audit is written to the ledger when it starts, so it is settled however many runs start after it.
|
|
125
|
+
- `learning.hold_disagree` (3) disagreements in the newest `learning.hold_window` (10) rows of the revision's current promotion (`promoted_at`) hold the workflow (a promotion hold carrying the rows on its new `audit` field). The agent's next run asks one recompile with those disagreements as data, and the check runs on its usual inputs plus the disagreeing ones. A second hold within `learning.stop_window` (100) served runs stops it (`audit.stopped`, "stopped: the workflow disagreed with the agent twice") and asks no compile.
|
|
126
|
+
- A check whose every input stopped at a write stops with the cause and spends no recompile.
|
|
127
|
+
- A check's `outcomes` add up to its `n`: a replay run never created by the check's deadline is `failed` there too, and the record's new `check.unstarted` counts those. A check none of whose runs was created reads `failed` on GET .../replays/{replay_id}.
|
|
128
|
+
- The promotions read's `serving` gains `state` (`serving`, `checking`, `held` or `stopped`), `check` (the newest decided check's numbers), `audit` (the hold bar and the counted rows), `audits_off` (why none of the agent's runs is audited, e.g. "audits off: send_email can write", else null) and `not_auditable` (the serving revision's runs a trigger started, never audited).
|
|
129
|
+
- Upgrading: a promotion hold with `audit` is an audit's; one without it is its check's. A client that builds the `serving` objects must add the five new fields. The six numbers are optional on `definition.learning`; each is a whole number from 1 to 1000, `hold_disagree` at most `hold_window`, else a 422 on `definition.learning`.
|
|
130
|
+
|
|
5
131
|
## 0.1.0-beta.42 (2026-11-17)
|
|
6
132
|
|
|
7
133
|
- A learned workflow is compiled once and checked once against the agent's own answers. An agent definition's `learning` takes an object, `{ compile_after?, agree_min?, alone_min? }`, which is on (as `true`) with those numbers set; each one left out is its default (20, 0.8, 0.7), and `true` is every default. A number out of range or an unknown key is a 422 `wrong_type` on `definition.learning`.
|
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Installed, `agentrun-serve` is a launcher that needs a POSIX `sh` with a builtin
|
|
|
37
37
|
It prints where it listens and, at the start that made it, the token:
|
|
38
38
|
|
|
39
39
|
```
|
|
40
|
+
Starting http://127.0.0.1:7340/ (warming: health says so and the API answers 503 until the server is ready)
|
|
40
41
|
agentrun-serve on http://127.0.0.1:7340/v2 (agent store in ~/.local/share/agentrun/agents)
|
|
41
42
|
AGENTRUN_BASE_URL=http://127.0.0.1:7340/v2
|
|
42
43
|
AGENTRUN_API_KEY=ar_local_...
|
|
@@ -45,6 +46,13 @@ Boxes: docker (on by default; set AGENTRUN_BOXES to change).
|
|
|
45
46
|
Set your password: http://127.0.0.1:7340/setup (the first visit sets it)
|
|
46
47
|
```
|
|
47
48
|
|
|
49
|
+
The `Starting` line comes as soon as the port is bound, before the server loads the rest of itself; the lines after it
|
|
50
|
+
come once it is ready, and `Open ` still means ready. In between, `GET /v2/health` answers `503` with `status: "warming"`,
|
|
51
|
+
the API answers `503 unavailable` (retryable, with a `Retry-After`), and a browser gets a page that reloads itself. On a
|
|
52
|
+
cold, slow disk, loading the server's modules holds the process for most of that time: a request sent then is answered
|
|
53
|
+
once they have loaded. A port already taken at the start is left to the start's own listen, which waits for a server it
|
|
54
|
+
replaces, as it always has, and prints no `Starting` line.
|
|
55
|
+
|
|
48
56
|
A Docker box's image is built on its first run, which shows that on its timeline. `npx @parcha/agentrun` prints the
|
|
49
57
|
`Boxes:` line on stderr, after its own line on stdout. On a machine where Docker is not running, the `Boxes:` line says so instead (`Boxes: none, so new agents run on the
|
|
50
58
|
runner. Docker isn't running on this machine (no docker command on PATH): install or start Docker, then restart
|
|
@@ -167,6 +175,15 @@ package and pins; [harnesses](#harnesses)), the bulk of its start; quiet keeps i
|
|
|
167
175
|
PUT of `/settings/tools` and a save or delete of a tool key change no harness's offer, so they remake capabilities at
|
|
168
176
|
once without checking again (a key some harness reads would, with `why=key`).
|
|
169
177
|
|
|
178
|
+
## Anonymous usage counts
|
|
179
|
+
|
|
180
|
+
The server can send three anonymous events: `server_started`, a daily `heartbeat` and `first_run_completed`. Each holds
|
|
181
|
+
a random id kept in the data directory (`.telemetry.json`), the version, the platform and how many runs ended as a
|
|
182
|
+
range; never a prompt, a file, a key or a name. This release sends nothing: the receiver's key is not set.
|
|
183
|
+
`AGENTRUN_TELEMETRY=0` or `DO_NOT_TRACK=1` turns it off, as do `CI` and `--faux`; `AGENTRUN_TELEMETRY=debug` prints each
|
|
184
|
+
event on stderr and sends none. The start that first could send prints one notice and sends nothing at that start.
|
|
185
|
+
[docs/telemetry.md](../../docs/telemetry.md) lists every field.
|
|
186
|
+
|
|
170
187
|
## In a container
|
|
171
188
|
|
|
172
189
|
The image is public: `ghcr.io/parcha-ai/agentrun-server` (`:beta`, or an exact version such as `:v0.1.0-beta.27`).
|
|
@@ -301,7 +318,8 @@ A data directory serves one AgentRun Server at a time: a second server on the sa
|
|
|
301
318
|
`GET /v2/health`, with no credential like capabilities, answers `200 {status: "ok", checks: {store: "ok", disk: "ok"}}`
|
|
302
319
|
when the agent store opens for a read and the data directory's disk has at least 64 MiB free (`AGENTRUN_MIN_FREE_MB`),
|
|
303
320
|
and `503` with `status: "failing"` and which check failed (`store: "does_not_open"`, `disk: "below_floor"`, or
|
|
304
|
-
`disk: "cannot_check"` when the free space cannot be read) otherwise.
|
|
321
|
+
`disk: "cannot_check"` when the free space cannot be read) otherwise. While the server is still starting it answers `503`
|
|
322
|
+
with `status: "warming"` and `store: "opening"`.
|
|
305
323
|
It names no path, size or version. One route serves as both liveness and readiness: any answer says the server is up,
|
|
306
324
|
and a 200 says it can work, and the platforms here take one path.
|
|
307
325
|
|
|
@@ -340,26 +358,28 @@ while the agent's loop, its log and every key stay on the server, whatever its h
|
|
|
340
358
|
remove, or the place it most likely meant, to copy (`"place": {"mode": "sandbox", "box": "docker"}`). One that names a
|
|
341
359
|
place keeps it, `runner` included. An edit that names no place keeps the agent's.
|
|
342
360
|
|
|
343
|
-
The box is a new agent's default machine. A new agentic agent whose definition names no place
|
|
344
|
-
(`{"mode": "sandbox", "box": "docker"}`) wherever this server has docker
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
361
|
+
The box is a new agent's default machine for a shell. A new agentic agent whose definition names no place and no `tools`
|
|
362
|
+
is saved in the Docker box (`{"mode": "sandbox", "box": "docker"}`) wherever this server has docker, with `["bash",
|
|
363
|
+
"bash_background", "bash_output", "bash_input", "bash_signal", "bash_list"]`, so the agent has a shell and can run a
|
|
364
|
+
command in the background ([background processes](#background-processes)). The place is written on the agent's first
|
|
365
|
+
revision, so its answers show it. A definition that names its tools keeps exactly those, an empty list included, and
|
|
366
|
+
gets the box only when one of them runs only there (`bash` or a background tool). One whose tools need no shell (`[]`,
|
|
367
|
+
or `read`, `write`, `web_fetch` and the like) is saved with no place and runs on the runner, so its first run starts at
|
|
368
|
+
once instead of waiting on a container. Where docker is unavailable, a new agent is saved with no place. So is one whose
|
|
369
|
+
tools name one the box refuses (`browser`, runner-only for now). A workflow is never given a box.
|
|
370
|
+
|
|
371
|
+
`capabilities.places.default_place` is the place a new agent with a shell gets here, and where a revision that names no
|
|
372
|
+
place and has a shell tool runs. It is worked out again at each run, the same way as at create: an agentic revision with
|
|
373
|
+
no place and a shell tool runs in the Docker box wherever this server has docker now, and on the runner where it does
|
|
374
|
+
not. A workflow, a revision whose tools need no shell, and one whose tools name one the box refuses run on the runner. A save checks a revision with no place against where it would run, so `bash`
|
|
355
375
|
with no place saves where docker is there and is `422` where it is not. When that is the runner,
|
|
356
376
|
`default_reason` says why in docker's own words, such as `new agents run on the runner, because the docker box is
|
|
357
377
|
unavailable here: Docker isn't running on this machine (no docker command on PATH): install or start Docker, then
|
|
358
378
|
restart AgentRun`. The console's new-agent form says docker's reason too, under its place picker. The console's new-agent form starts on `default_place`, with bash ticked when that place is a sandbox.
|
|
359
379
|
What a person picks or unticks there is what is sent.
|
|
360
380
|
|
|
361
|
-
A run runs in its revision's place, else where `default_place` says at that run (a workflow,
|
|
362
|
-
name one the box refuses, on the runner). A run request names no place: `POST /agents/{id}/runs`
|
|
381
|
+
A run runs in its revision's place, else where `default_place` says at that run (a workflow, a revision whose tools need
|
|
382
|
+
no shell, and one whose tools name one the box refuses, on the runner). A run request names no place: `POST /agents/{id}/runs`
|
|
363
383
|
with `place` is `422 input_invalid`, as with any field the body does not keep. The run keeps the place it resolved to,
|
|
364
384
|
and `GET /v2/runs/{id}` shows it as `place`. A harness's own tools in the box, when they come, will be an option of
|
|
365
385
|
`sandbox` (such as `native_tools: true`), never a third mode.
|
|
@@ -382,14 +402,13 @@ A definition naming a box this server does not have saves with a warning on `def
|
|
|
382
402
|
|
|
383
403
|
With docker on (by default, when `AGENTRUN_BOXES` is not set; or listed in it) and a Docker daemon this server's user
|
|
384
404
|
may use, a run whose place is
|
|
385
|
-
`{"mode": "sandbox", "box": "docker"}` gets one container, made
|
|
386
|
-
|
|
405
|
+
`{"mode": "sandbox", "box": "docker"}` gets one container, made when a runner takes the run, before its first model
|
|
406
|
+
request, whatever tools it calls. Those four tools are pi's own, on every harness. `bash` runs in the container. `read`, `write` and `edit`
|
|
387
407
|
run on this server, on the `work/` the container binds, because a `docker exec` costs half a second or more per call:
|
|
388
408
|
they follow no link anywhere on the way (one pointing inside `work/` included), take only a regular file with one hard
|
|
389
409
|
link, and write through a temporary file renamed over the old one, keeping its mode (a new file is `0644`). A refusal
|
|
390
410
|
says so and names the box's path; `bash`, in the container, can still reach the file. Where this server reaches
|
|
391
|
-
directories by path (no `/proc/self/fd`, as on macOS), or a box binds nothing, all four run in the container
|
|
392
|
-
the first of them.
|
|
411
|
+
directories by path (no `/proc/self/fd`, as on macOS), or a box binds nothing, all four run in the container.
|
|
393
412
|
`web_fetch`, `web_search` and monid's endpoints stay on this server, and so do
|
|
394
413
|
the run's loop, its log, its model calls and every key. What the server itself files in `work/` (monid's long answers,
|
|
395
414
|
the browser's evidence) never goes through a link a box's command planted there: each directory is held open on the
|
|
@@ -707,6 +726,16 @@ They apply to Docker computers only: a vendor's computer (Daytona, Modal, E2B, O
|
|
|
707
726
|
size its provider makes it, and is never given them. A value the Docker provider refuses stops the server's start, in
|
|
708
727
|
the provider's words.
|
|
709
728
|
|
|
729
|
+
**A lost sandbox.** A run's sandbox can be lost mid-run: its vendor deleted it (from its own console or API), or no
|
|
730
|
+
longer has it. The tool call that finds it lost fails in the provider's words. The run's next tool call starts a new
|
|
731
|
+
sandbox under the same claim and runs there, also when the lost one was kept through a park. A start that fails is
|
|
732
|
+
tried again at the next tool call, under the same request, and does not count. In Mode 2 the new sandbox mounts the run's folder again with a new mount
|
|
733
|
+
credential, and the lost one's credential is removed. The run's folder is kept; what was on the lost sandbox outside it
|
|
734
|
+
(its processes, `/tmp`) is gone. The timeline says `Its computer was lost; started a new one (<name>).` A claim starts
|
|
735
|
+
at most 2 new sandboxes. The loss after that fails the run at once, whichever call finds it with error code `computer_unavailable`, in the provider's
|
|
736
|
+
words. A provider error that does not show the sandbox gone (a 5xx, a timeout, its read of the machine failing) starts
|
|
737
|
+
nothing. A desktop, a phone, a paired computer and an agent's own computer are never started again this way.
|
|
738
|
+
|
|
710
739
|
**A phone's apps.** A phone has its stock apps. To give every phone more, the operator names APK files on the machine
|
|
711
740
|
that drives the phones (the server's, or its runner's) in that machine's environment, each pinned by its sha256:
|
|
712
741
|
`PHONE_HARNESS_APKS=/srv/apks/wikipedia.apk@sha256:<64 hex digits>`, a comma list. Only the operator sets it: no agent
|
|
@@ -749,7 +778,9 @@ one computer that it keeps between runs, instead of a fresh one for each run:
|
|
|
749
778
|
account never take each other's. The janitor deletes an agent's computer only once its agent no longer wants it.
|
|
750
779
|
|
|
751
780
|
**A video of each run.** `computer: {"kind": "desktop", "provider": "e2b", "record": true}` records the computer's
|
|
752
|
-
screen during each of the agent's runs. Off by default; a desktop or a
|
|
781
|
+
screen during each of the agent's runs. Off by default; a desktop, a phone or a browser (a sandbox is 422). A browser's is
|
|
782
|
+
each session's page, one file per session (its computer), from the live view's own screencast of it, which the viewer
|
|
783
|
+
shares: frames come as the page changes.
|
|
753
784
|
|
|
754
785
|
- **It shows everything on the screen.** That includes what a person types while they have taken over the computer, and
|
|
755
786
|
any password, key or private page shown on it. Pixels can't be redacted. Turn it on only for an agent whose screen
|
|
@@ -930,6 +961,13 @@ A desktop, a phone and a browser run in either mode. The run's folder is at
|
|
|
930
961
|
followed: reading one is refused, a write through a linked folder is refused, and `bash` refuses a working directory
|
|
931
962
|
with a link on the way.
|
|
932
963
|
|
|
964
|
+
**The run's scratch.** `bash`'s `TMPDIR` is `.agentrun/tmp` in the run's folder, and a cut answer's full output is in
|
|
965
|
+
`.agentrun/output/`. The run's end removes both before its end commit: through the computer when it mounts the folder,
|
|
966
|
+
else through the folder itself. A computer that mounts the folder from Archil holds Archil's write delegation for it
|
|
967
|
+
until its release, so Archil refuses the server's own deletes there until then; the computer's deletes sync to the disk
|
|
968
|
+
before they answer. If that computer no longer answers, a Mode 2 run's scratch stays and the release logs why. A park
|
|
969
|
+
that keeps the computer removes neither.
|
|
970
|
+
|
|
933
971
|
**An agent with no setting.** With no `computer` and no `place`, the server decides at each run's start: in Mode 1, the
|
|
934
972
|
Docker sandbox where this server's Docker answers, else no computer; in Mode 2, no computer. A workflow always runs with
|
|
935
973
|
no computer.
|
|
@@ -1036,13 +1074,90 @@ A run is refused before it starts, `409 agent_not_runnable`, saying which, for a
|
|
|
1036
1074
|
fixed yet, or a revision saved before these checks. A run needs only the tiers it uses: an agentic one its model or the default, a workflow the tiers its nodes name, so a
|
|
1037
1075
|
workflow of fast nodes runs with `AGENT_MODEL_FAST` and no `AGENT_MODEL`. A run thinks at its `effort` (`low`, `medium`,
|
|
1038
1076
|
`high`), else at its agentic revision's `thinking` (`low` to `max`), else at the host's `AGENT_THINKING` (one of those
|
|
1039
|
-
levels exactly), else at its harness's own default; it is never off
|
|
1077
|
+
levels exactly), else at its harness's own default; it is never off (pi never asks a model the catalog does not list,
|
|
1078
|
+
such as a local one, to stop reasoning: it thinks at its lowest level, its reasoning kept out of the answer), and a model node that names its own thinking level
|
|
1040
1079
|
keeps it. The level is fixed in the run's launch when it starts, and its metrics name the level its harness ran at: one
|
|
1041
1080
|
above the harness's highest runs at that highest (Codex and OpenCode stop at `xhigh`). An agentic run whose level is
|
|
1042
1081
|
`low`, `medium` or `high` also gets a short note on how to work, right after its instructions, on every harness
|
|
1043
1082
|
(`src/effort-guidance.ts`): `low` answers directly, `medium` plans briefly and checks once, `high` plans each part, fills
|
|
1044
1083
|
the gaps and reviews. A run with no level, or one above `high`, gets no note.
|
|
1045
1084
|
|
|
1085
|
+
### Per-run model keys (LiteLLM virtual keys)
|
|
1086
|
+
|
|
1087
|
+
A caller can hand each run its own model key, such as a [LiteLLM](https://docs.litellm.ai/docs/proxy/virtual_keys)
|
|
1088
|
+
virtual key minted for that run, with `model_key` on `POST /v2/runs`, `POST /v2/agents/{agent_id}/runs` and
|
|
1089
|
+
`POST /v2/runs/{run_id}/messages`. AgentRun uses that key for every model request tied to the run and never mints,
|
|
1090
|
+
lists or revokes it: the caller owns the key's life.
|
|
1091
|
+
|
|
1092
|
+
**Run without a server key: callers pass a per-run key.** There is no setting. Point `AGENT_MODEL_BASE_URL` at the
|
|
1093
|
+
gateway and give the server no model key of its own (no `AGENT_MODEL_API_KEY`, nothing saved in Settings → Model keys).
|
|
1094
|
+
The server and its runners start, and capabilities read ready, with no standing key. Then:
|
|
1095
|
+
|
|
1096
|
+
- A run with `model_key` spends on that key alone.
|
|
1097
|
+
- A run without one, whose model goes to the gateway, is 422 `model_key_required` at its start, before any model call.
|
|
1098
|
+
- A message that would start a new turn (the run's last turn ended) without `model_key` is also 422
|
|
1099
|
+
`model_key_required`, and nothing is written.
|
|
1100
|
+
|
|
1101
|
+
A server that does hold a key spends it on a run that brings none, as before, and never on a run that brings its own.
|
|
1102
|
+
|
|
1103
|
+
Where the key goes: to the gateway at `AGENT_MODEL_BASE_URL` only, which every pi and codex model and every workflow
|
|
1104
|
+
model node is sent to, and to Anthropic's Messages endpoint when `ANTHROPIC_BASE_URL` names the same origin (claude-agent
|
|
1105
|
+
on the gateway). A key sent with a run whose model goes elsewhere (no gateway, a native run, a model routed to a
|
|
1106
|
+
provider's own API) is 422 at `model_key`, never kept unused.
|
|
1107
|
+
|
|
1108
|
+
```sh
|
|
1109
|
+
# Mint a virtual key for this run (LiteLLM's proxy, with its master key; your backend does this, never the agent).
|
|
1110
|
+
KEY=$(curl -s https://litellm.example.com/key/generate \
|
|
1111
|
+
-H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'content-type: application/json' \
|
|
1112
|
+
-d '{"duration": "1h", "max_budget": 2, "metadata": {"run": "ticket-4521"}}' | jq -r .key)
|
|
1113
|
+
|
|
1114
|
+
# Hand it to the run.
|
|
1115
|
+
curl -s http://127.0.0.1:7340/v2/agents/support/runs -H "Authorization: Bearer $AGENTRUN_TOKEN" \
|
|
1116
|
+
-H 'content-type: application/json' \
|
|
1117
|
+
-d "{\"input\": {\"content\": \"Triage ticket 4521\"}, \"model_key\": \"$KEY\"}"
|
|
1118
|
+
|
|
1119
|
+
# A follow-up turn gets a key of its own.
|
|
1120
|
+
curl -s http://127.0.0.1:7340/v2/runs/$RUN_ID/messages -H "Authorization: Bearer $AGENTRUN_TOKEN" \
|
|
1121
|
+
-H 'content-type: application/json' -d "{\"content\": \"And the refund?\", \"model_key\": \"$NEXT_KEY\"}"
|
|
1122
|
+
|
|
1123
|
+
# When the run's turn has ended (run.ended), revoke it.
|
|
1124
|
+
curl -s https://litellm.example.com/key/delete -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
|
|
1125
|
+
-H 'content-type: application/json' -d "{\"keys\": [\"$KEY\"]}"
|
|
1126
|
+
```
|
|
1127
|
+
|
|
1128
|
+
Custody, as for a per_run MCP server's `mcp_auth`:
|
|
1129
|
+
|
|
1130
|
+
- The key is taken out of the body before anything reads it. It is never in the run's saved body, its timeline, its
|
|
1131
|
+
view, a log or an `Idempotency-Key`'s fingerprint. A retry with a new key answers the first request's run and keeps
|
|
1132
|
+
its first key.
|
|
1133
|
+
- It is sealed with the run under the server's seal key, bound to the gateway's origin then. A runner opens it at each
|
|
1134
|
+
claim, a reclaim after a runner's crash included. A gateway moved since never receives it.
|
|
1135
|
+
- Each model route reads it per request through the kernel model proxy. The harness, its tools and its sandbox never
|
|
1136
|
+
see it, and the run's redactor cuts it from anything the run writes.
|
|
1137
|
+
- A message's `model_key` replaces the run's key from the next model request on: the runner reads it again when it
|
|
1138
|
+
takes the message, before the message reaches the session. That holds while the turn is still going, and for a run
|
|
1139
|
+
that started on the server's key and gets its first key from a message. If that read fails, it is tried again; if it
|
|
1140
|
+
keeps failing, the message waits untaken and is delivered again, never run on the key held before it or the
|
|
1141
|
+
server's. A stop or cancel sent after it still reaches the run. A message without one keeps the key the run holds.
|
|
1142
|
+
|
|
1143
|
+
**The revoke-at-turn-end contract.** The write that ends a run's turn erases its key, and the run reports the turn
|
|
1144
|
+
ended (`run.ended`, the run's `completed`, `failed` or `stopped` status) only after that write. Every model request
|
|
1145
|
+
tied to the turn finishes before then: the job, its subagents, its learned workflows' nodes, its end-of-run look-back
|
|
1146
|
+
and compile turns. So a caller may revoke the key as soon as it sees the turn end, and no request of that run will
|
|
1147
|
+
answer 401 for it. Model spend that would run after the turn ends is never sent on the run's key or the server's:
|
|
1148
|
+
|
|
1149
|
+
| Spend | With the run's key | Server holds no key, run brought none |
|
|
1150
|
+
| --- | --- | --- |
|
|
1151
|
+
| The learning run's grade (after the turn) | Not queued: the proposal is dropped `grade_failed`, in words | Skipped in words |
|
|
1152
|
+
| A shadow audit, a learned workflow's replay check | Skipped, logged | Skipped, logged |
|
|
1153
|
+
| A grade's feedback round (`PUT /runs/{id}/grade`) | A new turn with no key: the server's, else not opened | Not opened; the grade is kept |
|
|
1154
|
+
| An owner's replay, learning from a CSV, an SDK run's look-back | Tied to no run's key | 409 or skipped, in words |
|
|
1155
|
+
| A trigger's firing | Starts a run with no key | 422 `model_key_required` for the firing |
|
|
1156
|
+
|
|
1157
|
+
Jev and the other decision providers run on their own keys (`TYPESAFE_API_KEY`, `PARALLEL_API_KEY`,
|
|
1158
|
+
`OPENROUTER_API_KEY`), which are not model keys and which a run's key does not replace. On a run that brings its own
|
|
1159
|
+
key, no model key is on the env its decision nodes run under, so Jev's route on an openrouter.ai gateway's key is off.
|
|
1160
|
+
|
|
1046
1161
|
### On a ChatGPT plan
|
|
1047
1162
|
|
|
1048
1163
|
A server needs no model key to start, on any of its deploys. With none, capabilities say `models.ready: false` and
|
|
@@ -1398,7 +1513,8 @@ saying why. Kernel's browsers run headless, and keep no downloads, so a run on K
|
|
|
1398
1513
|
run's process over its pipe, as the rest do. A session's custody (its lease, its tag, what it was
|
|
1399
1514
|
doing) is kept in the run's own store, so a run opened again on its directory reconciles the sessions it held. Each
|
|
1400
1515
|
page it reads is filed under the run's `work/evidence/`, each read in a file of its own (`0001-browser_read.md`, ...),
|
|
1401
|
-
reads at once included.
|
|
1516
|
+
reads at once included. No vendor records it; an agent whose browser computer says `record: true` gets its own video
|
|
1517
|
+
of each session ([A video of each run](#computers)). The owner watches the browser live, takes it over and hands it back, and
|
|
1402
1518
|
the agent can ask them to (below). When the run is let go (its work done, or a SIGTERM)
|
|
1403
1519
|
the sessions it still holds are released at their vendor. An agent's browser stays signed in from one run to the next
|
|
1404
1520
|
([saved sign-ins](#saved-sign-ins)).
|
|
@@ -2238,6 +2354,44 @@ key, in order, and undoes what it made when a later step fails:
|
|
|
2238
2354
|
deleted with the last.
|
|
2239
2355
|
- The trigger here. Its `source` names what was made: `instance_id` and `hook`.
|
|
2240
2356
|
|
|
2357
|
+
A config field named like a credential is sealed at the create. That is a field whose value is a string (not empty) or
|
|
2358
|
+
a number, and where a word of the name, read as its singular (`tokens` as `token`), is secret, password, passwd,
|
|
2359
|
+
passphrase, passcode, pwd, pat, token, credential, apikey, hapikey, jwt, dsn, sig, authorization, bearer or cookie;
|
|
2360
|
+
where connection is followed by string (`connection_string`); or where the last word is key (`api_key`, `api_keys`). A
|
|
2361
|
+
credential word right next to a count word (max, min, num, number, count, limit, total, used, usage, budget, remaining,
|
|
2362
|
+
per, length, size or quota) names a count, not a credential: `max_tokens`, `token_count`, `token_limit`, `tokens_used`
|
|
2363
|
+
and `maxTokens` stay as they are, a number in one too, while `access_token`, `refresh_token` and `bot_token` are sealed.
|
|
2364
|
+
A string that is an address carrying a credential, in any scheme (`https`, `postgres`, `redis`, `amqp`,
|
|
2365
|
+
`mongodb+srv`...), is sealed whole, whatever its field's name and at any depth: one with a user part (`user:pass@`,
|
|
2366
|
+
`:pass@`, or a token alone as in `https://TOKEN@host`), or with a query or fragment parameter named by the rule above
|
|
2367
|
+
(`token`, `api_key`, `access_token`, `sig`) that has a value. An address with none stays as it is; one whose user part
|
|
2368
|
+
holds no secret (`ssh://git@host`) is sealed all the same. A field the event's schema marks with `format: "password"` or
|
|
2369
|
+
`writeOnly: true` is sealed whatever its name; the create reads the event's schema from Composio for this. A create with
|
|
2370
|
+
such a value below the config's top level is refused `422`, naming it. For example, HubSpot's deal-stage event takes
|
|
2371
|
+
`{app_id, developer_api_key}`. Composio's trigger schemas rarely mark a field secret, so the name mostly decides. A
|
|
2372
|
+
number is sealed as its decimal text and stays a number in what Composio gets; a run's output is cut of that text when
|
|
2373
|
+
it is 8 characters or more, as a string's is. The value is kept in the composio source's sealed settings, next to the subscription's
|
|
2374
|
+
secret. Composio gets it once, in the instance's upsert. Every answer has `"[sealed]"` in its place, and
|
|
2375
|
+
`source.sealed_config` names the field. The events list names these fields per event under `sealed`, and the console
|
|
2376
|
+
takes them as passwords. A PATCH that leaves a sealed field out or sends `"[sealed]"` keeps it. Any other value is a
|
|
2377
|
+
change to the config and is refused, as every config change is: to change a key, delete the trigger and make a new one.
|
|
2378
|
+
The trigger's delete retires the value into a sealed row until the runs that saw it end. A trigger saved by an earlier server with such a value in plain text is answered
|
|
2379
|
+
masked by the same rule at once, at any depth (one below the top level named in `sealed_config` by its JSON Pointer),
|
|
2380
|
+
and sealed at the next start by the same rule. After that start, without holding it up, the server reads the schema of
|
|
2381
|
+
each event such a trigger uses, once, and seals the fields it marks the same way, logging `composio_config_sealed` per
|
|
2382
|
+
trigger. It writes a trigger only while the trigger is as it read it: one changed or deleted meanwhile is left (its
|
|
2383
|
+
values sealed for it removed again, the log saying `composio_config_not_sealed`) for the next start. Being already
|
|
2384
|
+
serving, it runs no `VACUUM`: the rewrite runs with `secure_delete` on, the marker below stays, the log says
|
|
2385
|
+
`store_scrub_not_done` with `reason=deferred`, and the next start's scrub finishes it before it serves. When Composio
|
|
2386
|
+
can't be reached, the log says `composio_config_schemas_unread` once with a code and the next start tries again. On SQLite that rewrite runs with
|
|
2387
|
+
`secure_delete` on, then a `VACUUM` and a WAL checkpoint,
|
|
2388
|
+
so the store's files keep no copy of the old row: neither the one rewritten nor one an earlier update of the row left in
|
|
2389
|
+
free space. A marker beside the database (`store.sqlite.scrub`) is written before the rewrite and removed once the
|
|
2390
|
+
checkpoint is done. A `VACUUM` held off by another connection's write past the store's busy wait is tried once more
|
|
2391
|
+
after a short pause. A start that finds the marker (the server stopped mid-way, or another connection held the
|
|
2392
|
+
`VACUUM` or the checkpoint back, logged as `store_scrub_not_done`) runs the scrub again. On Postgres the old row version stays until the
|
|
2393
|
+
database vacuums it. The log line names the trigger and the field, never the value.
|
|
2394
|
+
|
|
2241
2395
|
The create is refused before Composio is asked anything with `409 composio_no_public_url` when the server has no public
|
|
2242
2396
|
address (`AGENTRUN_PUBLIC_URL`): Composio could not reach it. `features.triggers.public_url` on `GET /v2/capabilities`
|
|
2243
2397
|
says whether there is one, never the address, and the console turns New app trigger off without one, with the line
|
|
@@ -2651,7 +2805,8 @@ codex mcp add agentrun --url "$AGENTRUN_BASE_URL/mcp" --bearer-token-env-var AGE
|
|
|
2651
2805
|
## Harnesses
|
|
2652
2806
|
|
|
2653
2807
|
A definition names the harness that runs it: `pi` (the default, and what a definition that names none gets),
|
|
2654
|
-
`claude-agent`, `codex
|
|
2808
|
+
`claude-agent`, `codex`, `opencode`, or one of this server's harness modules adds (below). Any other is
|
|
2809
|
+
`422 input_invalid` on `definition.harness`. Every answer names it. An edit
|
|
2655
2810
|
(`PUT /agents/{id}/definition`) that names no harness keeps the agent's, as it keeps its skill files; name `pi` to move it
|
|
2656
2811
|
back.
|
|
2657
2812
|
`GET /v2/capabilities` lists each in `harnesses`, with `available` and, when not, the `reason`, and `default_model`: the
|
|
@@ -2725,6 +2880,39 @@ inlined in its system prompt.
|
|
|
2725
2880
|
`GET /v2/openapi.json` marks each `x-agentrun-serve: "harness/1"`, beside the other properties it adds (`model/1`,
|
|
2726
2881
|
`serve/1`), and lists them in `info.x-agentrun-serve.fields`.
|
|
2727
2882
|
|
|
2883
|
+
### Harness modules
|
|
2884
|
+
|
|
2885
|
+
A harness is one entry in serve's harness table (`src/harness-table.ts`). Capabilities, a save's check, the runner and
|
|
2886
|
+
the console all read that table. An owner adds harnesses with a harness module: start the server with
|
|
2887
|
+
`--harness-module MODULE` (repeatable), or set `AGENTRUN_SERVE_HARNESS_MODULES=a,b`. A separate `agentrun-serve runner`
|
|
2888
|
+
takes the same flag and setting, and needs them to run the module's harnesses. MODULE is a path, or a package installed
|
|
2889
|
+
with `npm install --prefix <data>/harnesses <package>`.
|
|
2890
|
+
|
|
2891
|
+
A module exports `entries(builtins)`, which returns new entries by id. Each entry gives `label`, `steer`, `runMib`,
|
|
2892
|
+
`oneAlwaysFits`, `runs`, `onWire`, `model`, `priceModel`, `refusal` and its `runner`, and may give `promises`. A run of
|
|
2893
|
+
the harness runs on its runner's `adapter(launch, extra)`, and is admitted by the `runMib` its entry declares. A module
|
|
2894
|
+
adds harnesses and never replaces one. The start of the server, or of a separate runner, is refused, naming the module
|
|
2895
|
+
and the id, when a module:
|
|
2896
|
+
- gives an id that does not match `^[a-z][a-z0-9-]{0,39}$`;
|
|
2897
|
+
- names an id serve's own runs carry: `learning`, `sdk`, `workflow`, `claude-agent-sdk` or `codex-sdk`;
|
|
2898
|
+
- names a built-in harness;
|
|
2899
|
+
- names an id another module adds;
|
|
2900
|
+
- gives an entry that is missing a member;
|
|
2901
|
+
- does not resolve.
|
|
2902
|
+
|
|
2903
|
+
A module's entry that gives no adapter `facts` runs on the general spec, with pi's tools: capabilities list its id on
|
|
2904
|
+
every tool pi runs (`tools[].harnesses`) and on MCP grants (`features.mcp_client.harnesses`), so an agent on it keeps
|
|
2905
|
+
its tool choices. One that gives `facts` runs the host tools, as the other built-in harnesses do.
|
|
2906
|
+
|
|
2907
|
+
The harnesses a module adds are listed in `capabilities.harnesses` after the built-in ones. Each offer there carries a
|
|
2908
|
+
`label` and `promises`:
|
|
2909
|
+
- `resume`: `exact`, `load` or `restart`.
|
|
2910
|
+
- `tool_gate`: `every_call`, `permission` or `config`.
|
|
2911
|
+
- `billing`: `proxy` or `plan`.
|
|
2912
|
+
|
|
2913
|
+
The built-in harnesses promise `exact`, `every_call` and `proxy`. These fields are marked
|
|
2914
|
+
`x-agentrun-serve: "harness-table/1"`.
|
|
2915
|
+
|
|
2728
2916
|
## Decision workflows
|
|
2729
2917
|
|
|
2730
2918
|
A workflow's typed questions (its `judge`, `pick`, `sift`, `route` and `ask` nodes) run on a decision provider when
|
|
@@ -2861,7 +3049,11 @@ AgentRun Server is for one person, who signs in to the console with a password (
|
|
|
2861
3049
|
no `AGENTRUN_PUBLIC_URL`, listening on loopback (the default), the start prints `Set your password: <url>/setup`, and the
|
|
2862
3050
|
first visit sets it, 12 characters or more. With a public address, or listening on any other address (`0.0.0.0` in the
|
|
2863
3051
|
image, a LAN address), the start prints `Set up this server: <url>/setup#code=<code>`, and setup takes that code (or the
|
|
2864
|
-
token, in the code field or as the Bearer): anyone who reaches the port could otherwise set the password first.
|
|
3052
|
+
token, in the code field or as the Bearer): anyone who reaches the port could otherwise set the password first. A code
|
|
3053
|
+
works once and lasts 30 minutes. `POST /v2/setup/code`, with no credential (the console's **Get a new code**), prints a
|
|
3054
|
+
new one to the log when the last is expired or spent and keeps one still good, so this request never voids a link
|
|
3055
|
+
someone holds; it answers `{printed, expires_at}`, never the code, and 403 once the password is set, while it is being set, or where setup
|
|
3056
|
+
takes no code. A restart prints a new code too. The server keeps a scrypt hash of the password, never the password, in `DIR/owner.json`, and signs its
|
|
2865
3057
|
session cookies with the key in `DIR/.session-secret`; both are 0600, and no run reaches either. A session lasts 30 days.
|
|
2866
3058
|
**Sign out** (`POST /v2/auth/sign-out`) signs out this browser: its session is revoked on the server (a copy of its
|
|
2867
3059
|
cookie stops working too) and its cookie cleared, and every other browser stays signed in. **Sign out everywhere** (`POST /v2/auth/sign-out-everywhere`) ends every session on every browser and phone,
|
|
@@ -2985,6 +3177,10 @@ work is done and before the answer is sent, so a retry after a restart gets the
|
|
|
2985
3177
|
between the work and the save loses it, and a save that fails still answers. A run create's key is also kept with its
|
|
2986
3178
|
run in the agent store, written with the run itself, so a retry after any restart, or after that day, gets that run (as
|
|
2987
3179
|
it is now, marked `Idempotent-Replayed: true`), and another body under the key is still `409 idempotency_mismatch`.
|
|
3180
|
+
The file keeps no request body. A key's fingerprint is an HMAC of the body under a key derived from the seal key. A
|
|
3181
|
+
trigger create's answer is kept as a read answers it (a composio trigger's sealed config as `"[sealed]"`); every other
|
|
3182
|
+
answer, a run's input among them, is kept and replayed as it was. A record an earlier server wrote with the body itself
|
|
3183
|
+
is rewritten at the start, and the log says how many.
|
|
2988
3184
|
|
|
2989
3185
|
A completed agentic run's `result` is `{output: null, final_answer}`; a completed workflow run's is
|
|
2990
3186
|
`{output: <the workflow's output>, final_answer: null}`.
|
|
@@ -3162,13 +3358,7 @@ neither, on the agent's own model. `GET /capabilities` names it as `learning.gra
|
|
|
3162
3358
|
cheap model is a poor grader, so point the strong tier (or `--grade-model`) at a strong one. The grader reads each active
|
|
3163
3359
|
note's index line, the whole text only of the notes the proposal supersedes, what the user said in the run (cut of the
|
|
3164
3360
|
server's secrets, as the proposal keeps it), and the new notes, so its prompt stays under 200,000 characters however
|
|
3165
|
-
many notes the folder holds.
|
|
3166
|
-
per new note (the Jev model and keys decision nodes use) asks whether it states a method, a source, a fact or a
|
|
3167
|
-
preference that holds for this job's other inputs, and a note rated below 0.5
|
|
3168
|
-
(`AGENTRUN_SERVE_LEARNING_GENERAL_THRESHOLD`, from 0 to 1) is dropped there, its reason on the verdict; its cost is
|
|
3169
|
-
the grade's. When Jev cannot run, the grader reads every note: the runner's log says why, the run's learning says the
|
|
3170
|
-
check could not run, and the grade's cost is unknown, never the grader's alone (a Jev request that failed may still
|
|
3171
|
-
have been charged). The grader answers General
|
|
3361
|
+
many notes the folder holds. The grader answers General
|
|
3172
3362
|
for every item, and one it says is not general is never kept, whatever else it decides. No injection screen runs
|
|
3173
3363
|
before it: a page classifier cannot see where a note came
|
|
3174
3364
|
from, and read a preference the user stated as a planted instruction; the grader's Planted question decides: a rule the
|