@usine/executor 0.6.1-next.547.gd7e00bc.1.1 → 0.6.1-next.575.g3f7aea9.1.1
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/README.md +20 -4
- package/dist/bind-mount.d.ts +4 -0
- package/dist/bind-mount.d.ts.map +1 -0
- package/dist/bind-mount.js +9 -0
- package/dist/bind-mount.js.map +1 -0
- package/dist/container-limits.d.ts +2 -0
- package/dist/container-limits.d.ts.map +1 -0
- package/dist/container-limits.js +8 -0
- package/dist/container-limits.js.map +1 -0
- package/dist/disk-full.d.ts +12 -0
- package/dist/disk-full.d.ts.map +1 -0
- package/dist/disk-full.js +36 -0
- package/dist/disk-full.js.map +1 -0
- package/dist/executor.d.ts +9 -2
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +8 -0
- package/dist/executor.js.map +1 -1
- package/dist/prepared-attempt.js +2 -2
- package/dist/prepared-attempt.js.map +1 -1
- package/dist/provision.d.ts +13 -5
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +54 -9
- package/dist/provision.js.map +1 -1
- package/dist/remote/container.d.ts.map +1 -1
- package/dist/remote/container.js +2 -9
- package/dist/remote/container.js.map +1 -1
- package/dist/remote/machine.d.ts +11 -2
- package/dist/remote/machine.d.ts.map +1 -1
- package/dist/remote/remote.d.ts.map +1 -1
- package/dist/remote/remote.js +16 -6
- package/dist/remote/remote.js.map +1 -1
- package/dist/ssh/disk.d.ts +18 -0
- package/dist/ssh/disk.d.ts.map +1 -0
- package/dist/ssh/disk.js +102 -0
- package/dist/ssh/disk.js.map +1 -0
- package/dist/ssh/gateway/model-route.d.ts.map +1 -1
- package/dist/ssh/gateway/model-route.js +4 -2
- package/dist/ssh/gateway/model-route.js.map +1 -1
- package/dist/ssh/image.d.ts +32 -1
- package/dist/ssh/image.d.ts.map +1 -1
- package/dist/ssh/image.js +171 -0
- package/dist/ssh/image.js.map +1 -1
- package/dist/ssh/model.d.ts +6 -1
- package/dist/ssh/model.d.ts.map +1 -1
- package/dist/ssh/model.js.map +1 -1
- package/dist/ssh/preflight.d.ts +4 -3
- package/dist/ssh/preflight.d.ts.map +1 -1
- package/dist/ssh/preflight.js +10 -4
- package/dist/ssh/preflight.js.map +1 -1
- package/dist/ssh/provisioner/machines.js +2 -2
- package/dist/ssh/provisioner/machines.js.map +1 -1
- package/dist/ssh/provisioner/tailnet/bootstrap.d.ts +5 -2
- package/dist/ssh/provisioner/tailnet/bootstrap.d.ts.map +1 -1
- package/dist/ssh/provisioner/tailnet/bootstrap.js +48 -16
- package/dist/ssh/provisioner/tailnet/bootstrap.js.map +1 -1
- package/dist/ssh/runtime.d.ts +1 -1
- package/dist/ssh/runtime.d.ts.map +1 -1
- package/dist/ssh/runtime.js +3 -8
- package/dist/ssh/runtime.js.map +1 -1
- package/dist/ssh/ssh.d.ts.map +1 -1
- package/dist/ssh/ssh.js +9 -2
- package/dist/ssh/ssh.js.map +1 -1
- package/dist/supervisor/container.d.ts +66 -0
- package/dist/supervisor/container.d.ts.map +1 -0
- package/dist/supervisor/container.js +522 -0
- package/dist/supervisor/container.js.map +1 -0
- package/dist/supervisor/image.d.ts +20 -0
- package/dist/supervisor/image.d.ts.map +1 -0
- package/dist/supervisor/image.js +30 -0
- package/dist/supervisor/image.js.map +1 -0
- package/dist/supervisor/model-relay.d.ts +8 -0
- package/dist/supervisor/model-relay.d.ts.map +1 -0
- package/dist/supervisor/model-relay.js +87 -0
- package/dist/supervisor/model-relay.js.map +1 -0
- package/dist/supervisor/names.d.ts +3 -0
- package/dist/supervisor/names.d.ts.map +1 -0
- package/dist/supervisor/names.js +5 -0
- package/dist/supervisor/names.js.map +1 -0
- package/dist/supervisor/sources.d.ts +30 -0
- package/dist/supervisor/sources.d.ts.map +1 -0
- package/dist/supervisor/sources.js +165 -0
- package/dist/supervisor/sources.js.map +1 -0
- package/dist/supervisor/storage.d.ts +24 -0
- package/dist/supervisor/storage.d.ts.map +1 -0
- package/dist/supervisor/storage.js +124 -0
- package/dist/supervisor/storage.js.map +1 -0
- package/dist/supervisor/supervisor.d.ts +3 -0
- package/dist/supervisor/supervisor.d.ts.map +1 -0
- package/dist/supervisor/supervisor.js +3 -0
- package/dist/supervisor/supervisor.js.map +1 -0
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -12,7 +12,23 @@ Worker preflight checks each coding-agent brain with the shared `admitBrain` pol
|
|
|
12
12
|
|
|
13
13
|
## Orchestrator model access
|
|
14
14
|
|
|
15
|
-
`@usine/executor/gateway` exports `gatewayModelRouteFor(worker, repository, gateway)` for model runtimes on the orchestrator, including the coordinator and supervisor. It opens SSH forwards to the admin API and model proxy, checks the proxy's caller-token requirement, and registers an anonymous attachment. `credential(protocol)` reports the gateway's credential kind; `request(protocol, body, headers, signal)` streams a model response with the caller token. Provider credentials remain on the gateway. The attachment renews every two minutes, restores missing gateway state under the same ID, and detaches on scope closure.
|
|
15
|
+
`@usine/executor/gateway` exports `gatewayModelRouteFor(worker, repository, gateway)` for model runtimes on the orchestrator, including the coordinator and supervisor. It opens SSH forwards to the admin API and model proxy, checks the proxy's caller-token requirement, and registers an anonymous attachment. `credential(protocol)` reports the gateway's credential kind; `request(protocol, body, headers, signal)` streams a model response with the caller token, after it removes from `headers` every header that the gateway reads a caller credential from. Provider credentials remain on the gateway. The attachment renews every two minutes, restores missing gateway state under the same ID, and detaches on scope closure.
|
|
16
|
+
|
|
17
|
+
## Supervisor sandbox
|
|
18
|
+
|
|
19
|
+
`@usine/executor/supervisor` provides one container per supervisor turn on the orchestrator host. `containerSandboxLayer({ root, image, runtime, route, limits, imagePullTimeout })` finds Podman, then Docker, unless `runtime` names one. Startup prepares `image` in the background, using a cached image when available and retrying failed preparation every minute. A turn waits up to 30 seconds for the image before refusing with a retry message. The container has no network, a read-only root filesystem, no capabilities and no new privileges, and runs as the orchestrator's user. An `ExecShell` seat enters it with `<runtime> exec`.
|
|
20
|
+
|
|
21
|
+
`limits` defaults to `SupervisorLimits`: 1 CPU, 1024 MiB memory without swap, 256 processes/threads, 64 MiB `/tmp` and 512 MiB per conversation. Shared memory is capped at 16 MiB and container logs are disabled. Opening verifies the runtime's cgroup v2 limits and refuses a seat if they are not enforced. Runtime commands, including startup, have a 30-second timeout; image pulls have no timeout unless `imagePullTimeout` is set. Pull output is drained with a diagnostic tail of 8,192 characters.
|
|
22
|
+
|
|
23
|
+
On both Docker and Podman, each conversation uses a preallocated ext4 image in `<root>/disks/<sha256>.ext4`, mounted with `fuse2fs` at `<root>/conversations/<sha256>`. It bounds container writes and Pi's host-side session files. Linux, FUSE access, `user_allow_other` in `/etc/fuse.conf`, `fuse2fs`, `fusermount`, `e2fsprogs` and `util-linux` are required. Allocation or mount failure refuses the turn. An existing image must match the configured size; resizing requires an offline migration. The conversation's writable home persists across turns. Its workspace and every source are read-only bind mounts, passed with CSV-quoted `--mount` arguments that reject missing sources. Directory and settings creation replaces unsafe entries without following symlinks.
|
|
24
|
+
|
|
25
|
+
The container relay forwards model requests over a Unix socket to the orchestrator. The HTTP server accepts at most eight connections and reads at most `limits.modelRequestMib` per body (32 MiB by default). It forwards only `POST /anthropic-messages/v1/messages` and `POST /openai-responses/v1/responses` for `SandboxRequest.model`, removes caller credential headers, and returns a generic 502 on route failure. The harness token contains no credential.
|
|
26
|
+
|
|
27
|
+
Turn end, shutdown and startup remove containers by `usine.supervisor.root` and `usine.supervisor.conversation` labels and verify their removal. A remaining container prevents a new turn from accessing that conversation's filesystem. Cleanup owns this lifecycle even when a session stops the relay; after an orchestrator crash, startup removes leftovers. Preparation failures leave the supervisor unavailable with a reason while the instance remains usable.
|
|
28
|
+
|
|
29
|
+
`makeSupervisorSources(root, origin)` prepares shallow source exports. Repository names reject `.` and `..` segments; cache and tree directories use SHA-256 names. Fetch sets `transfer.fsckObjects=true`, and exports remove absolute symlinks before publication. Preparations of one repository run one at a time. A tree stays available while a turn holds it and is removed when it is no longer the head and has no holders.
|
|
30
|
+
|
|
31
|
+
`test/supervisor/container-runtime.test.ts` runs on `USINE_SANDBOX_TEST_RUNTIME`, with `USINE_SANDBOX_TEST_IMAGE` (default `docker.io/library/node:22-slim`). CI runs Docker with the filesystem prerequisites. The suite checks isolation, persistence, relay-stop cleanup and restart, and disk, process and memory exhaustion while an outside SQLite database remains writable.
|
|
16
32
|
|
|
17
33
|
## Attempt lifetime
|
|
18
34
|
|
|
@@ -55,7 +71,7 @@ A push that GitHub refuses for a file over its size limit (`GH001`) fails the sa
|
|
|
55
71
|
|
|
56
72
|
A request whose `resume` names a pushed salvage fetches the revision and applies the salvage on top. A salvage forked from the fetched commit is checked out as is; one from an older base is rebased onto it, with `commitAuthor` as the committer. A salvage with no changes beyond the revision is dropped. One that doesn't rebase cleanly is left out: the worktree starts from the revision, `RunSpec.conflictingSalvage` names it, and its branch keeps the work. A missing ref falls back to the revision.
|
|
57
73
|
|
|
58
|
-
Startup reconciliation lists each worker connection's `attempts/` once per executor instance, and adapters skip historical attempts missing from the listing without checking paths. A failed listing stays cached for that startup and is retried after a restart. Existing checkouts keep the record-before-remove salvage order; succeeded attempts only need removal. `recover` returns `gone` when neither the attempt's
|
|
74
|
+
Startup reconciliation lists each worker connection's `attempts/` once per executor instance, and adapters skip historical attempts missing from the listing without checking paths. A failed listing stays cached for that startup and is retried after a restart. Existing checkouts keep the record-before-remove salvage order; succeeded attempts only need removal. `recover` returns `gone` when neither the attempt's checkout nor a machine created for the attempt is left: a local checkout that is missing, a missing checkout on the long-lived machine of an SSH or exe.dev worker, a provisioned SSH machine that is deleted, or a Cloudflare sandbox that is gone. Otherwise it returns `found`. On an SSH worker's long-lived machine, listing the leftovers first reclaims the containers and credentials that no attempt holds, so a missing checkout leaves nothing of the attempt to reconcile. `recover` has no `CheckoutRequest`, so its caller passes the salvage commit's author as an effect, which runs only before a salvage: the orchestrator reads the App's bot account there.
|
|
59
75
|
|
|
60
76
|
`Executor.sweep` removes the files on the workers that no attempt holds or can use. The orchestrator runs it after startup recovery and at each reconcile. It never fails and logs what it couldn't remove. The SSH executor removes Codex homes and Claude project directories there (see [Behind a gateway](#behind-a-gateway)); the local, exe.dev, and Cloudflare executors remove nothing.
|
|
61
77
|
|
|
@@ -69,7 +85,7 @@ This replaces the 0.x `Executor.launch(prepared, io)` and `Executor.cleanup(prep
|
|
|
69
85
|
|
|
70
86
|
Call `executor.preflight(worker, brains, maxConcurrentAttempts)` with the roster's `BrainSpec` values and the worker's `max_concurrent_attempts` before scheduling. It returns a `PreflightReport`, whose `degraded` gives the reason when the worker runs attempts without a capability that keeps them apart, such as an SSH worker without Docker, whose `containerLimits` gives the CPU, memory, and process limits of each attempt container on an SSH worker with Docker, and whose `findings` lists what the preflight found missing that attempts run without; `fullPreflight` is the report without any of them.
|
|
71
87
|
|
|
72
|
-
SSH image preparation logs local image presence and inspection time before starting a container. Preflight pulls the image and logs the pull duration and `downloaded`, based on the image IDs before and after the pull.
|
|
88
|
+
SSH image preparation logs local image presence and inspection time before starting a container. Preflight pulls the image and logs the pull duration and `downloaded`, based on the image IDs before and after the pull. After each successful pull, it removes the other images of the image's repository and logs what it removed. It keeps the current image, the most recently built other image, and every image that a container uses. After a rollback, the retained image can be newer than the current image. A failed removal is logged and doesn't fail the pull.
|
|
73
89
|
|
|
74
90
|
A failed pull logs its attempt number, exit code, duration, and up to 1,000 characters of stderr. If the image is absent, preparation retries on the same machine after 5 seconds and then 15 seconds, for at most three pulls. Preflight fails with the last pull error if the image remains absent. A failed pull can use an existing local image.
|
|
75
91
|
|
|
@@ -172,7 +188,7 @@ Attempt containers mount `/dev/shm` and `/tmp` in memory and set `TMPDIR=/tmp` f
|
|
|
172
188
|
|
|
173
189
|
`@usine/executor/ssh` runs the same contract on any Linux machine that the orchestrator reaches over SSH ([ADR 0029](../../docs/adr/0029-worker-kinds-and-adapter-set.md)); `infra/hetzner` creates one on Hetzner Cloud. Each worker has an SSH destination, an optional identity file and port, and a root under which it keeps `workers/<name>/repos`, `attempts`, and `credentials`. The machine needs Git, rootless Podman or Docker, and the roster's harness logins for the SSH user.
|
|
174
190
|
|
|
175
|
-
Preflight checks the SSH connection, a writable root, Git, memory for `maxConcurrentAttempts`, the container runtime, and the roster's harnesses where children run. With a container runtime, it pulls the attempt image, checks that the image's user has the SSH user's ID, finds the container limits, and probes the harnesses in a container from the image that removes itself. With a container runtime, it also checks that the SSH user can read the host kernel journal or ring buffer, and reports a finding if it can't. Without either runtime, it probes them over SSH and reports the worker as degraded. A Docker that doesn't answer the SSH user, the `docker` group or a writable socket without the `docker` CLI, an image that can't be pulled and isn't on the machine, or another user ID is a `container` `WorkerCapabilityError`: an SSH user that can use Docker never runs an attempt.
|
|
191
|
+
Preflight checks the SSH connection, a writable root, Git, memory for `maxConcurrentAttempts`, the container runtime, the free disk space, and the roster's harnesses where children run. The free disk space check reads `df` for the root and the container runtime's image storage; below `SshWorkerAddress.minFreeDiskGib` (10 if unset) on either, it fails with a `disk` `WorkerCapabilityError` that states the free space and the threshold. `prepare` repeats the check before a new checkout, and a reattachment skips it. A command of the executor that reports `ENOSPC` or `No space left on device` during preflight or `prepare` also fails with a `disk` error. With a container runtime, it pulls the attempt image, checks that the image's user has the SSH user's ID, finds the container limits, and probes the harnesses in a container from the image that removes itself. With a container runtime, it also checks that the SSH user can read the host kernel journal or ring buffer, and reports a finding if it can't. Without either runtime, it probes them over SSH and reports the worker as degraded. A Docker that doesn't answer the SSH user, the `docker` group or a writable socket without the `docker` CLI, an image that can't be pulled and isn't on the machine, or another user ID is a `container` `WorkerCapabilityError`: an SSH user that can use Docker never runs an attempt.
|
|
176
192
|
|
|
177
193
|
### Attempt containers
|
|
178
194
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const mountField: (key: string, value: string) => string;
|
|
2
|
+
/** A bind mount with CSV quoting, which preserves commas and colons in paths. */
|
|
3
|
+
export declare const bindMount: (source: string, destination: string, access: "readonly" | "writable") => string;
|
|
4
|
+
//# sourceMappingURL=bind-mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-mount.d.ts","sourceRoot":"","sources":["../src/bind-mount.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,SAAS,MAAM,KAAG,MACb,CAAC;AAE5C,iFAAiF;AACjF,eAAO,MAAM,SAAS,WAAY,MAAM,eAAe,MAAM,UAAU,UAAU,GAAG,UAAU,WAMjF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const mountField = (key, value) => `"${key}=${value.replaceAll('"', '""')}"`;
|
|
2
|
+
/** A bind mount with CSV quoting, which preserves commas and colons in paths. */
|
|
3
|
+
export const bindMount = (source, destination, access) => [
|
|
4
|
+
"type=bind",
|
|
5
|
+
mountField("source", source),
|
|
6
|
+
mountField("destination", destination),
|
|
7
|
+
...(access === "readonly" ? ["readonly"] : []),
|
|
8
|
+
].join(",");
|
|
9
|
+
//# sourceMappingURL=bind-mount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-mount.js","sourceRoot":"","sources":["../src/bind-mount.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE,CAC/D,IAAI,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAE5C,iFAAiF;AACjF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,WAAmB,EAAE,MAA+B,EAAE,EAAE,CAChG;IACE,WAAW;IACX,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,aAAa,EAAE,WAAW,CAAC;IACtC,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-limits.d.ts","sourceRoot":"","sources":["../src/container-limits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QAMnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const CONTAINER_LIMITS_SCRIPT = String.raw `
|
|
2
|
+
read quota period < /sys/fs/cgroup/cpu.max
|
|
3
|
+
awk -v q="$quota" -v p="$period" -v cpus="$1" 'BEGIN { exit !(q != "max" && p > 0 && q >= int(cpus * p + 0.5) - 1 && q <= int(cpus * p + 0.5) + 1) }'
|
|
4
|
+
[ "$(cat /sys/fs/cgroup/memory.max)" = "$2" ]
|
|
5
|
+
[ "$(cat /sys/fs/cgroup/memory.swap.max)" = 0 ]
|
|
6
|
+
[ "$(cat /sys/fs/cgroup/pids.max)" = "$3" ]
|
|
7
|
+
`;
|
|
8
|
+
//# sourceMappingURL=container-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-limits.js","sourceRoot":"","sources":["../src/container-limits.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMhD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkerName } from "@usine/core/worker";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { type ExecutorError } from "./executor.ts";
|
|
4
|
+
/** Returns whether `error`, or a cause it wraps, reports that the disk is full. */
|
|
5
|
+
export declare const reportsDiskFull: (error: ExecutorError) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns `effect` with a failure of one of the executor's own commands that ran out of disk
|
|
8
|
+
* space on `worker` replaced by a `disk` capability error, so the Worker waits for a preflight
|
|
9
|
+
* that passes instead of the Attempt failing as if its task were blocked.
|
|
10
|
+
*/
|
|
11
|
+
export declare const classifyDiskFull: <A, R>(worker: WorkerName, effect: Effect.Effect<A, ExecutorError, R>) => Effect.Effect<A, ExecutorError, R>;
|
|
12
|
+
//# sourceMappingURL=disk-full.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-full.d.ts","sourceRoot":"","sources":["../src/disk-full.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,eAAe,CAAC;AAK1E,mFAAmF;AACnF,eAAO,MAAM,eAAe,UAAW,aAAa,KAAG,OActD,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,UAC3B,UAAU,UACV,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,KACzC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAkBjC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Effect, Predicate } from "effect";
|
|
2
|
+
import { WorkerCapabilityError } from "./executor.js";
|
|
3
|
+
/** What Node, Git, Docker, and Podman print when a write fails because the disk is full. */
|
|
4
|
+
const DISK_FULL = /ENOSPC|no space left on device/iu;
|
|
5
|
+
/** Returns whether `error`, or a cause it wraps, reports that the disk is full. */
|
|
6
|
+
export const reportsDiskFull = (error) => {
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
let current = error;
|
|
9
|
+
while (Predicate.isObject(current) && !seen.has(current)) {
|
|
10
|
+
seen.add(current);
|
|
11
|
+
if ("message" in current &&
|
|
12
|
+
Predicate.isString(current.message) &&
|
|
13
|
+
DISK_FULL.test(current.message))
|
|
14
|
+
return true;
|
|
15
|
+
current = "cause" in current ? current.cause : undefined;
|
|
16
|
+
}
|
|
17
|
+
return Predicate.isString(current) && DISK_FULL.test(current);
|
|
18
|
+
};
|
|
19
|
+
const isDiskFull = (error) => !(error._tag === "WorkerCapabilityError" && error.capability === "disk") &&
|
|
20
|
+
reportsDiskFull(error);
|
|
21
|
+
/**
|
|
22
|
+
* Returns `effect` with a failure of one of the executor's own commands that ran out of disk
|
|
23
|
+
* space on `worker` replaced by a `disk` capability error, so the Worker waits for a preflight
|
|
24
|
+
* that passes instead of the Attempt failing as if its task were blocked.
|
|
25
|
+
*/
|
|
26
|
+
export const classifyDiskFull = (worker, effect) => Effect.catchIf(effect, isDiskFull, (error) => Effect.logWarning("A worker command ran out of disk space; the worker needs a preflight", {
|
|
27
|
+
worker,
|
|
28
|
+
error: error._tag,
|
|
29
|
+
message: error.message,
|
|
30
|
+
}).pipe(Effect.andThen(Effect.fail(WorkerCapabilityError.make({
|
|
31
|
+
worker,
|
|
32
|
+
capability: "disk",
|
|
33
|
+
message: `Worker "${worker}" ran out of disk space: ${error.message}`,
|
|
34
|
+
cause: error,
|
|
35
|
+
})))));
|
|
36
|
+
//# sourceMappingURL=disk-full.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-full.js","sourceRoot":"","sources":["../src/disk-full.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAsB,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE1E,4FAA4F;AAC5F,MAAM,SAAS,GAAG,kCAAkC,CAAC;AAErD,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAW,EAAE;IAC/D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;IAChC,IAAI,OAAO,GAAY,KAAK,CAAC;IAC7B,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClB,IACE,SAAS,IAAI,OAAO;YACpB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;YACnC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAE/B,OAAO,IAAI,CAAC;QACd,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,CAAC;IACD,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAoB,EAAW,EAAE,CACnD,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,uBAAuB,IAAI,KAAK,CAAC,UAAU,KAAK,MAAM,CAAC;IACxE,eAAe,CAAC,KAAK,CAAC,CAAC;AAEzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAAkB,EAClB,MAA0C,EACN,EAAE,CACtC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAC3C,MAAM,CAAC,UAAU,CAAC,sEAAsE,EAAE;IACxF,MAAM;IACN,KAAK,EAAE,KAAK,CAAC,IAAI;IACjB,OAAO,EAAE,KAAK,CAAC,OAAO;CACvB,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,OAAO,CACZ,MAAM,CAAC,IAAI,CACT,qBAAqB,CAAC,IAAI,CAAC;IACzB,MAAM;IACN,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,WAAW,MAAM,4BAA4B,KAAK,CAAC,OAAO,EAAE;IACrE,KAAK,EAAE,KAAK;CACb,CAAC,CACH,CACF,CACF,CACF,CAAC"}
|
package/dist/executor.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { type Brand, Context, Effect, Option, Redacted, type Result, Schema, Sco
|
|
|
15
15
|
export declare const githubBotLogin: (kind: WorkerKind, appLogin: BotLogin) => BotLogin;
|
|
16
16
|
export declare const ExecutorOperation: Schema.Literals<readonly ["preflight", "prepare", "launch", "cancel", "cleanup"]>;
|
|
17
17
|
export type ExecutorOperation = typeof ExecutorOperation.Type;
|
|
18
|
-
export declare const WorkerCapability: Schema.Literals<readonly ["machine", "toolchain", "memory", "harness-login", "credentials", "gateway", "container", "provider"]>;
|
|
18
|
+
export declare const WorkerCapability: Schema.Literals<readonly ["machine", "toolchain", "memory", "disk", "harness-login", "credentials", "gateway", "container", "provider"]>;
|
|
19
19
|
export type WorkerCapability = typeof WorkerCapability.Type;
|
|
20
20
|
declare const ExecutorOperationError_base: Schema.Class<ExecutorOperationError, Schema.TaggedStruct<"ExecutorOperationError", {
|
|
21
21
|
/** `cleanup` includes removing a checkout, its credential, or credentials left by an earlier process. */
|
|
@@ -53,6 +53,8 @@ declare const WorkerCapabilityError_base: Schema.Class<WorkerCapabilityError, Sc
|
|
|
53
53
|
* - `toolchain`: Git or a brain's harness doesn't run.
|
|
54
54
|
* - `memory`: less than 1.5 GiB per concurrent Attempt, no swap for more than one, or memory
|
|
55
55
|
* not reported.
|
|
56
|
+
* - `disk`: the machine has less free disk space than its threshold, or a command of the
|
|
57
|
+
* executor ran out of disk space.
|
|
56
58
|
* - `harness-login`: a brain's harness isn't logged in.
|
|
57
59
|
* - `credentials`: an exe.dev integration isn't ready, or the Worker kind can't issue a
|
|
58
60
|
* read-only credential for a `permissions: read` Loop.
|
|
@@ -63,7 +65,7 @@ declare const WorkerCapabilityError_base: Schema.Class<WorkerCapabilityError, Sc
|
|
|
63
65
|
* - `provider`: a provisioned Worker's provider refuses its token, or its image, SSH key,
|
|
64
66
|
* network, server type, or location doesn't exist there.
|
|
65
67
|
*/
|
|
66
|
-
readonly capability: Schema.Literals<readonly ["machine", "toolchain", "memory", "harness-login", "credentials", "gateway", "container", "provider"]>;
|
|
68
|
+
readonly capability: Schema.Literals<readonly ["machine", "toolchain", "memory", "disk", "harness-login", "credentials", "gateway", "container", "provider"]>;
|
|
67
69
|
readonly message: Schema.NonEmptyString;
|
|
68
70
|
/** The observed value, for example unrecognized `git --version` output or the harness readiness report. */
|
|
69
71
|
readonly cause: Schema.Defect;
|
|
@@ -159,6 +161,11 @@ declare const CheckoutRequest_base: Schema.Class<CheckoutRequest, Schema.Struct<
|
|
|
159
161
|
readonly maxAttemptMinutes: Schema.Option<Schema.Int>;
|
|
160
162
|
/** The maximum tokens consumed by the parent and all children, or `None` for no limit. Holds don't pause it. */
|
|
161
163
|
readonly maxAttemptTokens: Schema.Option<Schema.Int>;
|
|
164
|
+
/**
|
|
165
|
+
* The minutes an idle child that answered waits for its background work to start a turn, or
|
|
166
|
+
* `None` for no limit; copied into the RunSpec.
|
|
167
|
+
*/
|
|
168
|
+
readonly maxBackgroundWaitMinutes: Schema.withConstructorDefault<Schema.Option<Schema.Int>>;
|
|
162
169
|
/** The Pi parent's reasoning effort. The launch fails if the model doesn't support it. */
|
|
163
170
|
readonly parentEffort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
|
|
164
171
|
/** What coordinates the Attempt's children, copied into the RunSpec. */
|
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,EAAwC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAmB,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAe,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAY,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAc,MAAM,6BAA6B,CAAC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CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;IACnE;;;;;;;OAOG;qBACc,CACf,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC,EAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,uBAAuB,GAAG,qBAAqB,CAAC;IACjF;;;;;OAKG;oBACa,CACd,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,KACjB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9C,mIAAmI;sBACjH,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5D;;;;OAIG;oBACa,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,4CAA4C;uBACzB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9D,wFAAwF;qBACvE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;;AA3ChE;;GAEG;AACH,qBAAa,cAAe,SAAQ,mBA0CU;CAAG;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/executor.js
CHANGED
|
@@ -34,6 +34,7 @@ export const WorkerCapability = Schema.Literals([
|
|
|
34
34
|
"machine",
|
|
35
35
|
"toolchain",
|
|
36
36
|
"memory",
|
|
37
|
+
"disk",
|
|
37
38
|
"harness-login",
|
|
38
39
|
"credentials",
|
|
39
40
|
"gateway",
|
|
@@ -74,6 +75,8 @@ export class WorkerCapabilityError extends Schema.TaggedError("@usine/executor/W
|
|
|
74
75
|
* - `toolchain`: Git or a brain's harness doesn't run.
|
|
75
76
|
* - `memory`: less than 1.5 GiB per concurrent Attempt, no swap for more than one, or memory
|
|
76
77
|
* not reported.
|
|
78
|
+
* - `disk`: the machine has less free disk space than its threshold, or a command of the
|
|
79
|
+
* executor ran out of disk space.
|
|
77
80
|
* - `harness-login`: a brain's harness isn't logged in.
|
|
78
81
|
* - `credentials`: an exe.dev integration isn't ready, or the Worker kind can't issue a
|
|
79
82
|
* read-only credential for a `permissions: read` Loop.
|
|
@@ -177,6 +180,11 @@ export class CheckoutRequest extends Schema.Class("@usine/executor/CheckoutReque
|
|
|
177
180
|
maxAttemptMinutes: Schema.Option(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
178
181
|
/** The maximum tokens consumed by the parent and all children, or `None` for no limit. Holds don't pause it. */
|
|
179
182
|
maxAttemptTokens: Schema.Option(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
183
|
+
/**
|
|
184
|
+
* The minutes an idle child that answered waits for its background work to start a turn, or
|
|
185
|
+
* `None` for no limit; copied into the RunSpec.
|
|
186
|
+
*/
|
|
187
|
+
maxBackgroundWaitMinutes: Schema.Option(Schema.Int.check(Schema.isGreaterThan(0))).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
|
|
180
188
|
/** The Pi parent's reasoning effort. The launch fails if the model doesn't support it. */
|
|
181
189
|
parentEffort: Effort,
|
|
182
190
|
/** What coordinates the Attempt's children, copied into the RunSpec. */
|
package/dist/executor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,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
|
// owner's scope handles the checkout.
|
|
79
79
|
const seed = yield* guardSeed(request, io).pipe(Effect.onExit((exit) => Exit.isSuccess(exit) || Cause.hasInterruptsOnly(exit.cause)
|
|
80
80
|
? Effect.void
|
|
81
|
-
: Effect.logWarning("The Attempt's runaway guard cannot start; releasing its checkout without launching it", { attemptId }).pipe(Effect.andThen(prepared.recordSalvage(io
|
|
81
|
+
: Effect.logWarning("The Attempt's runaway guard cannot start; releasing its checkout without launching it", { attemptId }).pipe(Effect.andThen(prepared.recordSalvage(io)), Effect.andThen(releaseSalvaged(exit)))));
|
|
82
82
|
const guard = yield* attemptGuard({
|
|
83
83
|
attemptId,
|
|
84
84
|
maxAttemptMinutes: request.maxAttemptMinutes,
|
|
@@ -98,7 +98,7 @@ export const preparedAttemptsFor = (stop, warnParent, registered, guardSeed, rec
|
|
|
98
98
|
ceiling,
|
|
99
99
|
errorTag: error._tag,
|
|
100
100
|
})), Effect.ignore)));
|
|
101
|
-
yield* prepared.recordSalvage(io
|
|
101
|
+
yield* prepared.recordSalvage(io);
|
|
102
102
|
// Closing the owner's scope interrupts the session before the checkout and credential
|
|
103
103
|
// finalizers. acquireUseRelease interrupts the forked fiber when the caller waiting on join
|
|
104
104
|
// is interrupted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-attempt.js","sourceRoot":"","sources":["../src/prepared-attempt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAEL,YAAY,GAEb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAiB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAyBjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAA0F,EAC1F,UAGwC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B,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAChD,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,MAAM,CAAC,UAAU,CAAC,oCAAoC,EAAE;oBACtD,SAAS;oBACT,OAAO;oBACP,QAAQ,EAAE,KAAK,CAAC,IAAI;iBACrB,CAAC,CACH,EACD,MAAM,CAAC,MAAM,CACd,CACF,CACF,CAAC;gBACF,KAAK,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAClC,sFAAsF;gBACtF,4FAA4F;gBAC5F,kBAAkB;gBAClB,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,iBAAiB,CACpC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAC5E,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,SAAS,CAChB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACzD,CAAC,CAAC;SACuB,CAAC;IAC9B,CAAC,CAAC,CACH,CAAC;IAEJ,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC,CAAC,CAAC"}
|
package/dist/provision.d.ts
CHANGED
|
@@ -61,10 +61,16 @@ export interface ProvisionOptions<E> {
|
|
|
61
61
|
}
|
|
62
62
|
export interface ProvisionedWorktree {
|
|
63
63
|
readonly workspace: AttemptWorkspace;
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Waits for the workspace scope to close and returns the salvage, or `None` after a successful
|
|
66
|
+
* Attempt that no background wait limit ended, or a clean worktree.
|
|
67
|
+
*/
|
|
65
68
|
readonly salvaged: Effect.Effect<Option.Option<AttemptSalvage>, AttemptFailure>;
|
|
66
|
-
/**
|
|
67
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Sets the sink that cleanup records salvage in and reads the transcript from; call before
|
|
71
|
+
* launch. If salvage isn't recorded, cleanup keeps the worktree on disk.
|
|
72
|
+
*/
|
|
73
|
+
readonly recordSalvage: (sink: SalvageSink) => Effect.Effect<void>;
|
|
68
74
|
/**
|
|
69
75
|
* Skips checkout removal when the scope closes, so a restart can reattach the parent task or
|
|
70
76
|
* repeat a harvest whose result was not stored.
|
|
@@ -81,6 +87,8 @@ export interface ProvisionedWorktree {
|
|
|
81
87
|
*/
|
|
82
88
|
readonly gitHooks: Option.Option<string>;
|
|
83
89
|
}
|
|
90
|
+
/** The part of an Attempt's sink that its checkout's cleanup uses. */
|
|
91
|
+
type SalvageSink = Pick<AttemptChannel.Sink, "salvage" | "transcript">;
|
|
84
92
|
interface ReleaseOptions<E> {
|
|
85
93
|
readonly request: CheckoutRequest;
|
|
86
94
|
readonly host: string;
|
|
@@ -96,7 +104,7 @@ interface ReleaseOptions<E> {
|
|
|
96
104
|
export declare const provisionWorktree: <E extends Error>(options: ProvisionOptions<E>) => Effect.Effect<{
|
|
97
105
|
workspace: AttemptWorkspace;
|
|
98
106
|
salvaged: Effect.Effect<Option.Option<import("@usine/core/attempt/salvage").SalvagePartlyPushed | SalvagePushed | import("@usine/core/attempt/salvage").SalvageRejected | import("@usine/core/attempt/salvage").SalvageRetained>, import("@usine/core/attempt/failure").AgentFailure | import("@usine/core/attempt/failure").BlockedFailure | import("@usine/core/attempt/failure").ChildSessionBudgetFailure | import("@usine/core/attempt/failure").DefectFailure | import("@usine/core/attempt/failure").GitHubPushFailure | import("@usine/core/attempt/failure").InfraFailure | import("@usine/core/attempt/failure").ProviderCapacityFailure | import("@usine/core/attempt/failure").QuestionFailure | import("@usine/core/attempt/failure").RunawayFailure, never>;
|
|
99
|
-
recordSalvage: (
|
|
107
|
+
recordSalvage: (sink: SalvageSink) => Effect.Effect<void, never, never>;
|
|
100
108
|
keepForReattach: Effect.Effect<void, never, never>;
|
|
101
109
|
keepUntilStopped: Effect.Effect<void, never, never>;
|
|
102
110
|
gitHooks: Option.Option<string>;
|
|
@@ -114,7 +122,7 @@ export interface ReattachOptions<E> extends ReleaseOptions<E> {
|
|
|
114
122
|
export declare const reattachWorktree: <E extends Error>(options: ReattachOptions<E>) => Effect.Effect<{
|
|
115
123
|
workspace: AttemptWorkspace;
|
|
116
124
|
salvaged: Effect.Effect<Option.Option<import("@usine/core/attempt/salvage").SalvagePartlyPushed | SalvagePushed | import("@usine/core/attempt/salvage").SalvageRejected | import("@usine/core/attempt/salvage").SalvageRetained>, import("@usine/core/attempt/failure").AgentFailure | import("@usine/core/attempt/failure").BlockedFailure | import("@usine/core/attempt/failure").ChildSessionBudgetFailure | import("@usine/core/attempt/failure").DefectFailure | import("@usine/core/attempt/failure").GitHubPushFailure | import("@usine/core/attempt/failure").InfraFailure | import("@usine/core/attempt/failure").ProviderCapacityFailure | import("@usine/core/attempt/failure").QuestionFailure | import("@usine/core/attempt/failure").RunawayFailure, never>;
|
|
117
|
-
recordSalvage: (
|
|
125
|
+
recordSalvage: (sink: SalvageSink) => Effect.Effect<void, never, never>;
|
|
118
126
|
keepForReattach: Effect.Effect<void, never, never>;
|
|
119
127
|
keepUntilStopped: Effect.Effect<void, never, never>;
|
|
120
128
|
gitHooks: Option.Option<string>;
|
package/dist/provision.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../src/provision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAe,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AM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxE,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjD;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,YAAa,eAAe,KAAG,eAS9D,CAAC;AAEH,oGAAoG;AACpG,eAAO,MAAM,cAAc,YAAa,eAAe;;;;;;;;;CAGrD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,CAAC,SAAS,KAAK,EACf,WAAW,iDAGO,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,gDA2CrE,CAAC"}
|
package/dist/provision.js
CHANGED
|
@@ -62,6 +62,11 @@ export const linkedWorktree = (ops, layout, writeExecutable) => ({
|
|
|
62
62
|
}
|
|
63
63
|
}),
|
|
64
64
|
});
|
|
65
|
+
/** Whether `envelope` reports a session whose answer returned at its background wait limit. */
|
|
66
|
+
const finishedAtWaitLimit = (envelope) => envelope._tag === "OutboundEnvelope" &&
|
|
67
|
+
envelope.payload._tag === "SessionEvent" &&
|
|
68
|
+
envelope.payload.event._tag === "SessionFinished" &&
|
|
69
|
+
envelope.payload.event.backgroundWaitLimitPassed;
|
|
65
70
|
/** Returns the `CleanupStep` that logs a failed step with the Attempt's fields. */
|
|
66
71
|
const cleanupFor = (options) => (resource, effect) => effect.pipe(Effect.tapError((error) => Effect.logError("Attempt cleanup operation failed", {
|
|
67
72
|
attemptId: options.request.attemptId,
|
|
@@ -72,17 +77,54 @@ const cleanupFor = (options) => (resource, effect) => effect.pipe(Effect.tapErro
|
|
|
72
77
|
message: String(error),
|
|
73
78
|
})), Effect.ignore);
|
|
74
79
|
/**
|
|
75
|
-
* Registers the checkout's finalizer. On a non-success exit,
|
|
76
|
-
*
|
|
77
|
-
*
|
|
80
|
+
* Registers the checkout's finalizer. On a non-success exit, or a success where a session's answer
|
|
81
|
+
* returned at its background wait limit, salvages a checked-out worktree before removing it; a
|
|
82
|
+
* worktree with unpreserved work stays on disk. `waitLimit` is the background wait limit, in
|
|
83
|
+
* minutes, that the Attempt's children ran with. `checkedOut` contains the base commit once a
|
|
84
|
+
* worktree exists.
|
|
78
85
|
*/
|
|
79
|
-
const registerRelease = Effect.fn("Executor.registerRelease")(function* (options, confirmStop = Effect.void) {
|
|
86
|
+
const registerRelease = Effect.fn("Executor.registerRelease")(function* (options, waitLimit, confirmStop = Effect.void) {
|
|
80
87
|
const { layout, ops, request } = options;
|
|
81
88
|
const checkedOut = yield* Ref.make(Option.none());
|
|
82
89
|
const salvaged = yield* Deferred.make();
|
|
83
90
|
const recorder = yield* Ref.make(Option.none());
|
|
84
91
|
const cleanup = cleanupFor(options);
|
|
85
92
|
const kept = yield* Ref.make(Option.none());
|
|
93
|
+
/**
|
|
94
|
+
* Returns whether the transcript reports a session whose answer returned at its background wait
|
|
95
|
+
* limit. The child's background work then ended before the Attempt's work was pushed. Returns
|
|
96
|
+
* `true` if the transcript can't be read, so that cleanup keeps the work.
|
|
97
|
+
*/
|
|
98
|
+
const waitLimitPassed = Effect.fn("Executor.waitLimitPassed")(function* () {
|
|
99
|
+
const fields = {
|
|
100
|
+
attemptId: request.attemptId,
|
|
101
|
+
worker: request.worker,
|
|
102
|
+
host: options.host,
|
|
103
|
+
worktree: layout.worktree,
|
|
104
|
+
};
|
|
105
|
+
yield* Effect.annotateCurrentSpan(fields);
|
|
106
|
+
if (Option.isNone(waitLimit)) {
|
|
107
|
+
yield* Effect.logInfo("The successful Attempt ran without a background wait limit; its checkout is removed without salvage", fields);
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const limited = { ...fields, maxBackgroundWaitMinutes: waitLimit.value };
|
|
111
|
+
const sink = yield* Ref.get(recorder);
|
|
112
|
+
if (Option.isNone(sink)) {
|
|
113
|
+
yield* Effect.logInfo("The Attempt ended before its launch, so it has no transcript that shows an answer at its background wait limit; its checkout is removed without salvage", limited);
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
const transcript = yield* Effect.result(sink.value.transcript);
|
|
117
|
+
if (Result.isFailure(transcript)) {
|
|
118
|
+
yield* Effect.logWarning("Could not read the transcript of a successful Attempt with a background wait limit; salvaging its checkout", { ...limited, errorTag: transcript.failure._tag });
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (!transcript.success.some(finishedAtWaitLimit)) {
|
|
122
|
+
yield* Effect.logInfo("No session's answer returned at the Attempt's background wait limit; its checkout is removed without salvage", limited);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
yield* Effect.logInfo("A session's answer returned at its background wait limit; salvaging the checkout of the successful Attempt", limited);
|
|
126
|
+
return true;
|
|
127
|
+
});
|
|
86
128
|
// `kept` is checked even after a successful launch: a failed result write keeps the checkout.
|
|
87
129
|
yield* Effect.addFinalizer(Effect.fn("Executor.releaseWorktree")(function* (exit) {
|
|
88
130
|
yield* Effect.annotateCurrentSpan({
|
|
@@ -115,7 +157,8 @@ const registerRelease = Effect.fn("Executor.registerRelease")(function* (options
|
|
|
115
157
|
return;
|
|
116
158
|
}
|
|
117
159
|
const baseCommit = yield* Ref.get(checkedOut);
|
|
118
|
-
const
|
|
160
|
+
const salvages = Option.isSome(baseCommit) && (!Exit.isSuccess(exit) || (yield* waitLimitPassed()));
|
|
161
|
+
const salvage = salvages
|
|
119
162
|
? request.permissions === "read"
|
|
120
163
|
? yield* Effect.logInfo("The Attempt's Loop has read permissions, so its checkout is removed without salvage", {
|
|
121
164
|
attemptId: request.attemptId,
|
|
@@ -146,7 +189,7 @@ const registerRelease = Effect.fn("Executor.registerRelease")(function* (options
|
|
|
146
189
|
});
|
|
147
190
|
return;
|
|
148
191
|
}
|
|
149
|
-
const recorded = yield* Effect.result(record.value(salvage.value));
|
|
192
|
+
const recorded = yield* Effect.result(record.value.salvage(salvage.value));
|
|
150
193
|
if (Result.isFailure(recorded)) {
|
|
151
194
|
yield* Deferred.fail(salvaged, recorded.failure);
|
|
152
195
|
yield* Effect.logError("Attempt salvage could not be recorded; checkout retained", {
|
|
@@ -178,7 +221,7 @@ const registerRelease = Effect.fn("Executor.registerRelease")(function* (options
|
|
|
178
221
|
return {
|
|
179
222
|
checkedOut,
|
|
180
223
|
salvaged: Deferred.await(salvaged),
|
|
181
|
-
recordSalvage: (
|
|
224
|
+
recordSalvage: (sink) => Ref.set(recorder, Option.some(sink)),
|
|
182
225
|
keepForReattach: Ref.set(kept, Option.some("reattach")),
|
|
183
226
|
keepUntilStopped: Ref.set(kept, Option.some("unconfirmed-stop")),
|
|
184
227
|
};
|
|
@@ -301,7 +344,7 @@ export const provisionWorktree = Effect.fn("Executor.provisionWorktree")(functio
|
|
|
301
344
|
});
|
|
302
345
|
// Registered first so a failed worktree creation, which can leave a directory and a
|
|
303
346
|
// bare-cache registration, is also cleaned up.
|
|
304
|
-
const release = yield* registerRelease(options);
|
|
347
|
+
const release = yield* registerRelease(options, request.maxBackgroundWaitMinutes);
|
|
305
348
|
const cleanup = cleanupFor(options);
|
|
306
349
|
yield* ops.ensureRoots;
|
|
307
350
|
yield* ops.removePath("prepare", layout.worktree);
|
|
@@ -376,6 +419,7 @@ export const provisionWorktree = Effect.fn("Executor.provisionWorktree")(functio
|
|
|
376
419
|
agent: request.agent,
|
|
377
420
|
parentModel: request.parentModel,
|
|
378
421
|
maxChildren: request.maxChildren,
|
|
422
|
+
maxBackgroundWaitMinutes: request.maxBackgroundWaitMinutes,
|
|
379
423
|
parentEffort: request.parentEffort,
|
|
380
424
|
coordinator: request.coordinator,
|
|
381
425
|
resume: checkout.resume,
|
|
@@ -407,7 +451,8 @@ export const reattachWorktree = Effect.fn("Executor.reattachWorktree")(function*
|
|
|
407
451
|
host: options.host,
|
|
408
452
|
repository: request.repository,
|
|
409
453
|
});
|
|
410
|
-
|
|
454
|
+
// The spec carries the limit that the Attempt ran with; the request has the current setting.
|
|
455
|
+
const release = yield* registerRelease(options, spec.maxBackgroundWaitMinutes, options.confirmStop);
|
|
411
456
|
yield* Ref.set(release.checkedOut, Option.some(spec.baseCommit));
|
|
412
457
|
yield* options.ops.checkout.git("prepare", [
|
|
413
458
|
"-C",
|