@parcha/agentrun-kernel 0.1.0-beta.65 → 0.1.0-beta.66
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 +11 -0
- package/dist/run-booking.d.ts +2 -1
- package/dist/run-booking.js +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.66 (2026-11-27)
|
|
6
|
+
|
|
7
|
+
- A runner's graceful `close()` now resolves only after each live run's tool hosts have let go of what they hold, and their charges are booked under the claim the runner still holds. Before, the shutdown sealed the run's journal and aborted its ledger first, so a browser session's release charge was refused ("a tool host's beforeRelease failed: the loop stopped (shutdown)") and a priced computer's last stretch went unbooked. A shutdown's seal now lets the release hooks' commits through until they return; the claim's fence still refuses them once the claim is lost. On the run's cap, money already owed (a computer's time, a browser session's release) is booked after the run's stop, since nothing starts with it; every other step is still refused after a stop. <!-- changes/close-books-release.md -->
|
|
8
|
+
|
|
9
|
+
The wait is bounded, and the close's window now runs from its start:
|
|
10
|
+
- A run's release waits for its tool hosts up to a computer provider's cleanup bound (`cleanupMs`, 30 s by default) and a 5 s margin, never past the close's window. A host still going then is cut: each open browser session's time up to the cut is charged (pi-browser's `charge` handle), and the run's root records an `agentrun.release.cut` entry with the bound, the time taken and how many hosts finished. The session's release, when it lands (on this claim or the next one's), bills only the time after that charge. If the charge went past the release's own time, the release bills 0 s, and its `agentrun.browser_charged` entry carries `overbooked_s`. A reserve the cut claim left held is given back at the next claim's reopen. The cut reaches every conversation of the run, its subagents' included. pi-browser's `charge` now skips a session already charged through now, so a cut books no $0 charge under it.
|
|
11
|
+
- A lost create's recovery under way in the process (`recoveriesInFlight()`, new in `@parcha/agentrun-computer`, with `recoverCreate` now exported) is waited for at the close: each up to its own bound, or the drain, and the margin. A run's own process (`run-child`) waits for its own recoveries before it exits, and its runner gives that exit the release's bound.
|
|
12
|
+
- A person's stop gives a run's own process the release's bound and 5 s for the cut's booking on top of its 30 s stop, so a release that never answers is cut, charged and recorded before the process is ended. A release already under way when a shutdown arrives follows it: its cut is moved to the close's window, and the shutdown's seal lets the release's commits through. A run a person's stop already stops when the runner closes keeps that stop as its end, and its release is cut by the close's window too, in the runner's process or its own, so its cut is charged and recorded before the close ends.
|
|
13
|
+
- The close is now the drain plus the lease less its margin (31 s with the image's 6 s drain), or the cleanup bound and 10 s of margins from the close's start, whichever is longer: 40 s by default. Claims are renewed until the close returns. `startRunner` takes `cleanupMs` for a runner whose providers use a longer one.
|
|
14
|
+
- The deploy templates give a runner more time to stop: 45 s in `deploy/compose.yaml`, the Helm chart (`terminationGracePeriodSeconds`), Coolify and Dokploy, 45 s of Railway draining (`RAILWAY_DEPLOYMENT_DRAINING_SECONDS`), and 50 s on Fly (`kill_timeout`). A deployment of its own gives a runner at least 45 s, and at least `cleanupMs` + 15 s with a longer cleanup bound.
|
|
15
|
+
|
|
5
16
|
## 0.1.0-beta.65 (2026-11-27)
|
|
6
17
|
|
|
7
18
|
- A pi session opened again in a turn now reads the turn back from its conversation before a call the model made runs, not after: a pi-native tool (bash, web_fetch, a subagent) whose read fails is blocked before it does anything, where before it ran and its result was replaced by an error, inviting the model to run it again. <!-- changes/turn-budget-read-before-call.md -->
|
package/dist/run-booking.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export interface RunBookingOptions {
|
|
|
14
14
|
parked?(): boolean;
|
|
15
15
|
/** How long a waiter waits with none of the steps it waits on settling before it is refused (default WAIT_STALL_MS). */
|
|
16
16
|
stallMs?: number;
|
|
17
|
-
/** The run's stop (a stop, a cancel, a lost claim): every waiter leaves the line at it, admitted for
|
|
17
|
+
/** The run's stop (a stop, a cancel, a lost claim): every waiter but an owed step leaves the line at it, admitted for
|
|
18
|
+
* nothing. */
|
|
18
19
|
stopped?: AbortSignal;
|
|
19
20
|
}
|
|
20
21
|
/** How soon a waiter reads the run's records again, first and at the slowest (it doubles between them). */
|
package/dist/run-booking.js
CHANGED
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
// cancel, a lost claim), when the run stops (`stopped`, for a paid call or a decision too), when its booking stops (`halted`: thrown, as a stop that came during the check), or when the
|
|
46
46
|
// run parks meanwhile (`parked`: refused in its own words, so nothing more is sent until a raise).
|
|
47
47
|
// - Nothing is admitted once its signal is aborted: a step that comes, or reaches its turn, after its client went or the
|
|
48
|
-
// run stopped is refused with the signal's reason, before any read, so no call starts or is charged after a stop.
|
|
48
|
+
// run stopped is refused with the signal's reason, before any read, so no call starts or is charged after a stop. Money
|
|
49
|
+
// already owed (`paid.owed`) is the run's stop's exception: nothing starts with it, and the run books it as it lets go.
|
|
49
50
|
import { sessionSpendOf } from "./runner.js";
|
|
50
51
|
import { freeRequestsIn, localRequestsIn } from "./kernel/cap/free.js";
|
|
51
52
|
/** How soon a waiter reads the run's records again, first and at the slowest (it doubles between them). */
|
|
@@ -209,8 +210,10 @@ export function runBooking(sessions, before, options = {}) {
|
|
|
209
210
|
};
|
|
210
211
|
return async (request) => {
|
|
211
212
|
// What ends its wait: its own client's going (a model request's), or the run's stop (any step's: a paid call's or a
|
|
212
|
-
// decision's has no client of its own here)
|
|
213
|
-
|
|
213
|
+
// decision's has no client of its own here), but for money already owed: nothing starts with it, so the stop never
|
|
214
|
+
// refuses it (a computer's last stretch, a session's release, booked as the run lets go of them after its stop).
|
|
215
|
+
const stopped = request.paid?.owed ? undefined : options.stopped;
|
|
216
|
+
const signal = request.signal && stopped ? AbortSignal.any([request.signal, stopped]) : (request.signal ?? stopped);
|
|
214
217
|
// Every step joins the line as it comes, before its first ask, and asks only once it is first: steps that come together
|
|
215
218
|
// are asked in the order they came, so one behind a step that must wait never goes ahead of it. The first leaving
|
|
216
219
|
// (admitted, refused or gone) wakes the next at once. A paid call whose own session has a request in flight goes ahead
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-kernel",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.66",
|
|
4
4
|
"description": "Agent harnesses other than Pi, starting with Codex, behind one seam: a DSL node's runNode and an AgentRun run on a harness adapter, durable in AgentRun's own store.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentrun",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"test": "node --test --test-concurrency=8 'test/*.test.mjs'"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@parcha/agentrun-dsl": "0.1.0-beta.
|
|
65
|
+
"@parcha/agentrun-dsl": "0.1.0-beta.66",
|
|
66
66
|
"ajv": "8.18.0",
|
|
67
67
|
"typebox": "1.3.27"
|
|
68
68
|
},
|