harness-dispatch 0.8.0 → 0.10.0
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 +1074 -2
- package/README.md +92 -36
- package/config.default.yaml +19 -3
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +24 -0
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +24 -0
- package/dist/billing.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +299 -48
- package/dist/bin.js.map +1 -1
- package/dist/circuit-breaker.d.ts +9 -1
- package/dist/circuit-breaker.d.ts.map +1 -1
- package/dist/circuit-breaker.js +15 -1
- package/dist/circuit-breaker.js.map +1 -1
- package/dist/client-register.d.ts +11 -1
- package/dist/client-register.d.ts.map +1 -1
- package/dist/client-register.js +15 -6
- package/dist/client-register.js.map +1 -1
- package/dist/config/coercions.d.ts +5 -0
- package/dist/config/coercions.d.ts.map +1 -1
- package/dist/config/coercions.js +8 -0
- package/dist/config/coercions.js.map +1 -1
- package/dist/config/protocol.js.map +1 -1
- package/dist/config/validation.d.ts +12 -0
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +133 -7
- package/dist/config/validation.js.map +1 -1
- package/dist/config.d.ts +15 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +199 -152
- package/dist/config.js.map +1 -1
- package/dist/configure-yaml.d.ts +2 -0
- package/dist/configure-yaml.d.ts.map +1 -1
- package/dist/configure-yaml.js +114 -4
- package/dist/configure-yaml.js.map +1 -1
- package/dist/dispatch-log.d.ts.map +1 -1
- package/dist/dispatch-log.js +3 -1
- package/dist/dispatch-log.js.map +1 -1
- package/dist/dispatchers/generic-cli.d.ts.map +1 -1
- package/dist/dispatchers/generic-cli.js +281 -112
- package/dist/dispatchers/generic-cli.js.map +1 -1
- package/dist/dispatchers/openai-compatible.d.ts +0 -5
- package/dist/dispatchers/openai-compatible.d.ts.map +1 -1
- package/dist/dispatchers/openai-compatible.js +150 -83
- package/dist/dispatchers/openai-compatible.js.map +1 -1
- package/dist/dispatchers/shared/harness-login.d.ts +25 -0
- package/dist/dispatchers/shared/harness-login.d.ts.map +1 -0
- package/dist/dispatchers/shared/harness-login.js +73 -0
- package/dist/dispatchers/shared/harness-login.js.map +1 -0
- package/dist/dispatchers/shared/stream-subprocess.d.ts.map +1 -1
- package/dist/dispatchers/shared/stream-subprocess.js +71 -58
- package/dist/dispatchers/shared/stream-subprocess.js.map +1 -1
- package/dist/file-lock.d.ts +29 -1
- package/dist/file-lock.d.ts.map +1 -1
- package/dist/file-lock.js +53 -20
- package/dist/file-lock.js.map +1 -1
- package/dist/harness-presets.d.ts +51 -0
- package/dist/harness-presets.d.ts.map +1 -0
- package/dist/harness-presets.js +154 -0
- package/dist/harness-presets.js.map +1 -0
- package/dist/http/parse.d.ts +8 -1
- package/dist/http/parse.d.ts.map +1 -1
- package/dist/http/parse.js +10 -3
- package/dist/http/parse.js.map +1 -1
- package/dist/http/server.d.ts +2 -0
- package/dist/http/server.d.ts.map +1 -1
- package/dist/http/server.js +188 -16
- package/dist/http/server.js.map +1 -1
- package/dist/job-runner.js +6 -0
- package/dist/job-runner.js.map +1 -1
- package/dist/jobs/context.d.ts +0 -7
- package/dist/jobs/context.d.ts.map +1 -1
- package/dist/jobs/context.js +95 -7
- package/dist/jobs/context.js.map +1 -1
- package/dist/jobs/lifecycle.d.ts +100 -0
- package/dist/jobs/lifecycle.d.ts.map +1 -0
- package/dist/jobs/lifecycle.js +263 -0
- package/dist/jobs/lifecycle.js.map +1 -0
- package/dist/jobs/read.d.ts +17 -0
- package/dist/jobs/read.d.ts.map +1 -0
- package/dist/jobs/read.js +103 -0
- package/dist/jobs/read.js.map +1 -0
- package/dist/jobs/run.d.ts +45 -0
- package/dist/jobs/run.d.ts.map +1 -0
- package/dist/jobs/run.js +351 -0
- package/dist/jobs/run.js.map +1 -0
- package/dist/jobs/start.d.ts +9 -0
- package/dist/jobs/start.d.ts.map +1 -0
- package/dist/jobs/start.js +126 -0
- package/dist/jobs/start.js.map +1 -0
- package/dist/jobs/store.d.ts.map +1 -1
- package/dist/jobs/store.js +13 -3
- package/dist/jobs/store.js.map +1 -1
- package/dist/jobs/supervisor.d.ts +151 -0
- package/dist/jobs/supervisor.d.ts.map +1 -0
- package/dist/jobs/supervisor.js +679 -0
- package/dist/jobs/supervisor.js.map +1 -0
- package/dist/jobs/types.d.ts +8 -1
- package/dist/jobs/types.d.ts.map +1 -1
- package/dist/jobs.d.ts +15 -218
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +14 -1317
- package/dist/jobs.js.map +1 -1
- package/dist/leaderboard.d.ts.map +1 -1
- package/dist/leaderboard.js +44 -28
- package/dist/leaderboard.js.map +1 -1
- package/dist/mcp/config-hot-reload.d.ts +14 -3
- package/dist/mcp/config-hot-reload.d.ts.map +1 -1
- package/dist/mcp/config-hot-reload.js +27 -6
- package/dist/mcp/config-hot-reload.js.map +1 -1
- package/dist/mcp/dispatcher-factory.d.ts.map +1 -1
- package/dist/mcp/dispatcher-factory.js +15 -4
- package/dist/mcp/dispatcher-factory.js.map +1 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +3 -2
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/tool-schemas.d.ts +1 -1
- package/dist/mcp/tool-schemas.d.ts.map +1 -1
- package/dist/mcp/tool-schemas.js +6 -3
- package/dist/mcp/tool-schemas.js.map +1 -1
- package/dist/mcp/tools.d.ts +20 -6
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +92 -14
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-clients.d.ts +9 -0
- package/dist/mcp-clients.d.ts.map +1 -1
- package/dist/mcp-clients.js +4 -0
- package/dist/mcp-clients.js.map +1 -1
- package/dist/observability/spans.d.ts.map +1 -1
- package/dist/observability/spans.js +10 -2
- package/dist/observability/spans.js.map +1 -1
- package/dist/quota.d.ts.map +1 -1
- package/dist/quota.js +16 -2
- package/dist/quota.js.map +1 -1
- package/dist/redaction.d.ts +90 -0
- package/dist/redaction.d.ts.map +1 -0
- package/dist/redaction.js +221 -0
- package/dist/redaction.js.map +1 -0
- package/dist/route-policy.d.ts +2 -1
- package/dist/route-policy.d.ts.map +1 -1
- package/dist/route-policy.js +54 -0
- package/dist/route-policy.js.map +1 -1
- package/dist/router.d.ts +12 -23
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +86 -223
- package/dist/router.js.map +1 -1
- package/dist/safety.d.ts.map +1 -1
- package/dist/safety.js +7 -1
- package/dist/safety.js.map +1 -1
- package/dist/state-dir.d.ts +10 -0
- package/dist/state-dir.d.ts.map +1 -1
- package/dist/state-dir.js +27 -1
- package/dist/state-dir.js.map +1 -1
- package/dist/status.d.ts +14 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +36 -3
- package/dist/status.js.map +1 -1
- package/dist/types.d.ts +24 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/workspace-lock.d.ts +20 -0
- package/dist/workspace-lock.d.ts.map +1 -1
- package/dist/workspace-lock.js +63 -0
- package/dist/workspace-lock.js.map +1 -1
- package/dist/workspace-resolve.d.ts +0 -9
- package/dist/workspace-resolve.d.ts.map +1 -1
- package/dist/workspace-resolve.js +115 -183
- package/dist/workspace-resolve.js.map +1 -1
- package/dist/workspaces.d.ts +15 -0
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +330 -90
- package/dist/workspaces.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a job back: one with its partial output, or the recent list.
|
|
3
|
+
*
|
|
4
|
+
* Separate from start.ts because the supervisor reads jobs while deciding
|
|
5
|
+
* what to run, and start.ts needs the supervisor — keeping the reads beside
|
|
6
|
+
* the start verbs closed that loop.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { assertValidJobId, jobsRoot, pollInstructions, readJson, SUGGESTED_POLL_SECONDS, withOrphanCheck, } from "./store.js";
|
|
12
|
+
const MAX_PARTIAL_OUTPUT_CHARS = 4000;
|
|
13
|
+
export async function getAsyncJob(jobId) {
|
|
14
|
+
assertValidJobId(jobId);
|
|
15
|
+
const jobDir = path.join(jobsRoot(), jobId);
|
|
16
|
+
// A well-formed id for a job that is gone is the ORDINARY case, not an
|
|
17
|
+
// internal error: retention prunes finished jobs, so any caller holding an
|
|
18
|
+
// id long enough will hit this. It used to surface as a raw Node ENOENT
|
|
19
|
+
// quoting an absolute path inside the jobs directory, which tells the caller
|
|
20
|
+
// nothing actionable and leaks the layout.
|
|
21
|
+
const noSuchJob = () => new Error(`No such job: ${jobId}. It may have been pruned by the retention window, ` +
|
|
22
|
+
`or it was never started on this machine.`);
|
|
23
|
+
if (!existsSync(path.join(jobDir, "manifest.json")))
|
|
24
|
+
throw noSuchJob();
|
|
25
|
+
let manifest;
|
|
26
|
+
let status;
|
|
27
|
+
let result;
|
|
28
|
+
try {
|
|
29
|
+
manifest = await readJson(path.join(jobDir, "manifest.json"));
|
|
30
|
+
status = withOrphanCheck(await readJson(path.join(jobDir, "status.json")));
|
|
31
|
+
const resultPath = path.join(jobDir, "output", "result.json");
|
|
32
|
+
result = existsSync(resultPath) ? await readJson(resultPath) : undefined;
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
// existsSync-then-read is a TOCTOU window: retention pruning can delete
|
|
36
|
+
// the directory between the two calls, resurfacing the exact raw-ENOENT-
|
|
37
|
+
// with-an-absolute-path error this function's message exists to replace.
|
|
38
|
+
if (err?.code === "ENOENT")
|
|
39
|
+
throw noSuchJob();
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
if (result !== undefined) {
|
|
43
|
+
return { manifest, status, result };
|
|
44
|
+
}
|
|
45
|
+
// Terminal: no poll guidance — polling will never resolve an orphaned job.
|
|
46
|
+
// But it still gets its partial output, which is the whole point of the
|
|
47
|
+
// record surviving the runner.
|
|
48
|
+
//
|
|
49
|
+
// This branch used to `return` here, ABOVE the partial-output read below, so
|
|
50
|
+
// an orphaned job handed back nothing at all while its progress sat in
|
|
51
|
+
// output/stdout.partial.log. PRODUCT.md's success criterion is explicit that
|
|
52
|
+
// a dispatch must never die returning nothing — "at worst it fails and hands
|
|
53
|
+
// back its latest progress… a wasted attempt with no trail is the defining
|
|
54
|
+
// failure" — and orphaning is exactly the case that criterion was written
|
|
55
|
+
// for: the supervisor died, so there is no result.json and the partial log
|
|
56
|
+
// is all that survived. An acceptance pass measured eight chunks of progress
|
|
57
|
+
// on disk and an empty response.
|
|
58
|
+
const terminalOrphan = status.status === "orphaned";
|
|
59
|
+
const out = {
|
|
60
|
+
manifest,
|
|
61
|
+
status: terminalOrphan
|
|
62
|
+
? status
|
|
63
|
+
: {
|
|
64
|
+
...status,
|
|
65
|
+
nextPollSeconds: SUGGESTED_POLL_SECONDS,
|
|
66
|
+
instructions: pollInstructions(jobId),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const partialPath = path.join(jobDir, "output", "stdout.partial.log");
|
|
70
|
+
if (existsSync(partialPath)) {
|
|
71
|
+
try {
|
|
72
|
+
const partial = await readFile(partialPath, "utf8");
|
|
73
|
+
out.partialOutput =
|
|
74
|
+
partial.length <= MAX_PARTIAL_OUTPUT_CHARS
|
|
75
|
+
? partial
|
|
76
|
+
: `… [${partial.length - MAX_PARTIAL_OUTPUT_CHARS} chars omitted] …` +
|
|
77
|
+
partial.slice(-MAX_PARTIAL_OUTPUT_CHARS);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Best-effort; absence of partial output isn't an error.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
export async function listAsyncJobs() {
|
|
86
|
+
const root = jobsRoot();
|
|
87
|
+
if (!existsSync(root))
|
|
88
|
+
return [];
|
|
89
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
90
|
+
const statuses = [];
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
if (!entry.isDirectory())
|
|
93
|
+
continue;
|
|
94
|
+
try {
|
|
95
|
+
statuses.push(withOrphanCheck(await readJson(path.join(root, entry.name, "status.json"))));
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// Ignore incomplete or manually edited job directories.
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return statuses.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/jobs/read.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,sBAAsB,EACtB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAa;IAO7C,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5C,uEAAuE;IACvE,2EAA2E;IAC3E,wEAAwE;IACxE,6EAA6E;IAC7E,2CAA2C;IAC3C,MAAM,SAAS,GAAG,GAAG,EAAE,CACrB,IAAI,KAAK,CACP,gBAAgB,KAAK,qDAAqD;QACxE,0CAA0C,CAC7C,CAAC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AC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CACvF,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,wDAAwD;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Running one job: the work a runner process actually does.
|
|
3
|
+
*
|
|
4
|
+
* Split out of jobs.ts, which had grown to hold five concerns at 1,600 lines
|
|
5
|
+
* — this one, admission and the supervisor pool, the start/read verbs, and
|
|
6
|
+
* the lifecycle verbs. Nothing here was rewritten; the code moved.
|
|
7
|
+
*/
|
|
8
|
+
import type { JobDeps, JobManifest, StartJobInput } from "./types.js";
|
|
9
|
+
export declare function runJob(deps: JobDeps, jobDir: string, manifest: JobManifest, input: StartJobInput): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Fallback dispatch timeout for jobs. Dispatchers hard-code a short default
|
|
12
|
+
* (10 min for CLI harnesses, 2 min for openai_compatible) meant to catch a
|
|
13
|
+
* genuinely hung process — waiting on stdin that'll never come, a stalled
|
|
14
|
+
* network call — not to cap a slow-but-healthy run. That default made sense
|
|
15
|
+
* as-is for `code`, which blocks an MCP call anyway, but `job` runs in the
|
|
16
|
+
* background and is polled, so nothing about it requires killing a process
|
|
17
|
+
* that's still making progress after 10 minutes. Below both an explicit
|
|
18
|
+
* `hints.timeoutMs` and the route's own configured `timeoutMs` in
|
|
19
|
+
* precedence, so this only fills the gap when nobody set either.
|
|
20
|
+
*
|
|
21
|
+
* Router.stream() treats this specific value as a budget for the WHOLE call
|
|
22
|
+
* (including router fallback retries), not a per-attempt allowance — without
|
|
23
|
+
* that, a job that falls back twice (the router's default maxFallbacks: 2)
|
|
24
|
+
* could burn up to 3x this value before failing conclusively.
|
|
25
|
+
*/
|
|
26
|
+
export declare const JOB_DEFAULT_TIMEOUT_MS: number;
|
|
27
|
+
/**
|
|
28
|
+
* Rebuild a job's input from its on-disk bundle and execute it. This is the
|
|
29
|
+
* detached runner's whole job; the manifest deliberately carries everything
|
|
30
|
+
* a run needs (prompt path, resolved workingDir, hints, service) precisely
|
|
31
|
+
* so execution can happen in a process that wasn't there when the job was
|
|
32
|
+
* created.
|
|
33
|
+
*/
|
|
34
|
+
export declare function executeJobDir(deps: JobDeps, jobDir: string): Promise<void>;
|
|
35
|
+
/** dist/job-runner.js next to this module (compiled), or via the package's dist/ when running from src. */
|
|
36
|
+
export declare function resolveRunnerPath(): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Watch a detached job's directory until it reaches a terminal state
|
|
39
|
+
* (result.json present, or a failed/orphaned status — the orphan check
|
|
40
|
+
* doubles as the exit path if the runner dies). Timer is unref'd: an
|
|
41
|
+
* exiting server abandons the watch, which is exactly the point of
|
|
42
|
+
* detached execution.
|
|
43
|
+
*/
|
|
44
|
+
export declare function watchUntilTerminal(jobDir: string): Promise<void>;
|
|
45
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/jobs/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAA+B,aAAa,EAAE,MAAM,YAAY,CAAC;AACnG,wBAAsB,MAAM,CAC1B,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC,CA4Of;AAMD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,QAAiB,CAAC;AAGrD;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAchF;AAED,2GAA2G;AAC3G,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAmBtD;AAID;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCtE"}
|
package/dist/jobs/run.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Running one job: the work a runner process actually does.
|
|
3
|
+
*
|
|
4
|
+
* Split out of jobs.ts, which had grown to hold five concerns at 1,600 lines
|
|
5
|
+
* — this one, admission and the supervisor pool, the start/read verbs, and
|
|
6
|
+
* the lifecycle verbs. Nothing here was rewritten; the code moved.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { redact } from "../redaction.js";
|
|
10
|
+
import { appendFile, readFile, writeFile } from "node:fs/promises";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { boundedError, cancelReason, cancelRequested, readJson, timestamp, updateStatus, withOrphanCheck, writeJson, } from "./store.js";
|
|
15
|
+
export async function runJob(deps, jobDir, manifest, input) {
|
|
16
|
+
const started = Date.now();
|
|
17
|
+
const runningStatus = () => ({
|
|
18
|
+
jobId: manifest.jobId,
|
|
19
|
+
status: "running",
|
|
20
|
+
createdAt: manifest.createdAt,
|
|
21
|
+
updatedAt: timestamp(),
|
|
22
|
+
jobDir,
|
|
23
|
+
...(input.service !== undefined ? { service: input.service } : {}),
|
|
24
|
+
...(manifest.warning !== undefined ? { warning: manifest.warning } : {}),
|
|
25
|
+
});
|
|
26
|
+
await updateStatus(jobDir, runningStatus());
|
|
27
|
+
// Heartbeat: bump updatedAt while the run is alive so a reader can tell
|
|
28
|
+
// "running" apart from "the server that owned this run died and left a
|
|
29
|
+
// stale status file" (getAsyncJob reports the latter as "orphaned").
|
|
30
|
+
// unref'd so an exiting process never lingers on it — which is exactly
|
|
31
|
+
// the scenario the heartbeat exists to expose. The `finished` flag stops
|
|
32
|
+
// a beat that FIRES after the terminal write; `pendingBeat` covers the
|
|
33
|
+
// beat that fired BEFORE it and is still mid-write — updateStatus's rename
|
|
34
|
+
// can back off ~900ms on Windows EPERM, long enough to land after the
|
|
35
|
+
// terminal status and re-mark a completed job "running" (then "orphaned"
|
|
36
|
+
// forever in the list view). The terminal paths await it before writing.
|
|
37
|
+
let finished = false;
|
|
38
|
+
let pendingBeat = Promise.resolve();
|
|
39
|
+
const heartbeat = setInterval(() => {
|
|
40
|
+
if (finished)
|
|
41
|
+
return;
|
|
42
|
+
pendingBeat = updateStatus(jobDir, runningStatus()).catch(() => undefined);
|
|
43
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
44
|
+
heartbeat.unref?.();
|
|
45
|
+
try {
|
|
46
|
+
const state = deps.holder.state;
|
|
47
|
+
const files = input.files ?? [];
|
|
48
|
+
// Reuse the value already resolved (and recorded) at job creation, not a
|
|
49
|
+
// fresh process.cwd() snapshot — the two must stay in sync with the
|
|
50
|
+
// warning captured in manifest.warning.
|
|
51
|
+
const workingDir = manifest.workingDir;
|
|
52
|
+
const hints = { ...(input.hints ?? {}) };
|
|
53
|
+
if (input.workspacePolicy !== undefined)
|
|
54
|
+
hints.workspacePolicy = input.workspacePolicy;
|
|
55
|
+
// Stream the dispatch so agents polling action=get can watch progress in
|
|
56
|
+
// stdout.partial.log instead of waiting blind for the final result.
|
|
57
|
+
const partialPath = path.join(jobDir, "output", "stdout.partial.log");
|
|
58
|
+
// Cancellation travels DOWN to the child process, not up through the
|
|
59
|
+
// iterator. Returning from an async generator that is suspended at an
|
|
60
|
+
// `await` does not take effect until that await settles — which for an
|
|
61
|
+
// agent CLI gone quiet is never — so the only thing that reliably stops a
|
|
62
|
+
// silent run is aborting the subprocess (or fetch) directly.
|
|
63
|
+
const cancelController = new AbortController();
|
|
64
|
+
const events = input.service
|
|
65
|
+
? state.router.streamTo(input.service, input.prompt, files, workingDir, {
|
|
66
|
+
...(hints.safetyProfile !== undefined
|
|
67
|
+
? { safetyProfile: hints.safetyProfile }
|
|
68
|
+
: {}),
|
|
69
|
+
...(hints.workspacePolicy !== undefined
|
|
70
|
+
? { workspacePolicy: hints.workspacePolicy }
|
|
71
|
+
: {}),
|
|
72
|
+
...(hints.routePolicy !== undefined
|
|
73
|
+
? { routePolicy: hints.routePolicy }
|
|
74
|
+
: {}),
|
|
75
|
+
...(hints.model !== undefined ? { model: hints.model } : {}),
|
|
76
|
+
...(hints.taskType !== undefined ? { taskType: hints.taskType } : {}),
|
|
77
|
+
...(hints.timeoutMs !== undefined ? { timeoutMs: hints.timeoutMs } : {}),
|
|
78
|
+
defaultTimeoutMs: JOB_DEFAULT_TIMEOUT_MS,
|
|
79
|
+
signal: cancelController.signal,
|
|
80
|
+
})
|
|
81
|
+
: state.router.stream(input.prompt, files, workingDir, {
|
|
82
|
+
hints,
|
|
83
|
+
maxFallbacks: 2,
|
|
84
|
+
defaultTimeoutMs: JOB_DEFAULT_TIMEOUT_MS,
|
|
85
|
+
signal: cancelController.signal,
|
|
86
|
+
});
|
|
87
|
+
let finalResult = null;
|
|
88
|
+
let finalDecision = null;
|
|
89
|
+
let cancelled = false;
|
|
90
|
+
// Driven through an explicit iterator rather than `for await`, so a
|
|
91
|
+
// cancellation can interrupt a stream that is producing NOTHING. A
|
|
92
|
+
// for-await body only runs when an event arrives, and the case that most
|
|
93
|
+
// needs cancelling is the agent that has gone quiet for twenty minutes.
|
|
94
|
+
// Racing next() against a poll lets us stop either way, and calling
|
|
95
|
+
// return() on the iterator is what tears the child process down —
|
|
96
|
+
// stream-subprocess's return() runs killTree, which on POSIX now signals
|
|
97
|
+
// the whole process group.
|
|
98
|
+
const iterator = events[Symbol.asyncIterator]();
|
|
99
|
+
const CANCEL_POLL_MS = 1_000;
|
|
100
|
+
// The in-flight next() is held ACROSS polls rather than re-issued.
|
|
101
|
+
// Racing a fresh iterator.next() each time round drops events: when the
|
|
102
|
+
// poll wins, the previous next() is still pending, and calling next()
|
|
103
|
+
// again queues a second pull whose result is the one we read — the first
|
|
104
|
+
// event resolves into nothing. Losing a `completion` that way leaves a
|
|
105
|
+
// finished run with no result.json, so the job never reaches a terminal
|
|
106
|
+
// state and the caller polls a corpse. Caught by the slot-queue test,
|
|
107
|
+
// which waits for a queued job to actually complete.
|
|
108
|
+
let pending;
|
|
109
|
+
for (;;) {
|
|
110
|
+
pending ??= iterator.next();
|
|
111
|
+
const winner = await Promise.race([
|
|
112
|
+
pending.then((r) => ({ kind: "event", r })),
|
|
113
|
+
delay(CANCEL_POLL_MS, { kind: "poll" }, { ref: false }),
|
|
114
|
+
]);
|
|
115
|
+
if (winner.kind === "poll") {
|
|
116
|
+
if (!cancelRequested(jobDir))
|
|
117
|
+
continue; // `pending` deliberately kept
|
|
118
|
+
cancelled = true;
|
|
119
|
+
cancelController.abort();
|
|
120
|
+
// Not awaited: the generator is parked on an await that only settles
|
|
121
|
+
// once the abort above kills the child, so awaiting return() here
|
|
122
|
+
// would deadlock on the very thing it is trying to stop.
|
|
123
|
+
void iterator.return?.().catch(() => undefined);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
pending = undefined;
|
|
127
|
+
const next = winner.r;
|
|
128
|
+
if (next.done)
|
|
129
|
+
break;
|
|
130
|
+
if (cancelRequested(jobDir)) {
|
|
131
|
+
cancelled = true;
|
|
132
|
+
cancelController.abort();
|
|
133
|
+
void iterator.return?.().catch(() => undefined);
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
const { event, decision } = next.value;
|
|
137
|
+
if (decision)
|
|
138
|
+
finalDecision = decision;
|
|
139
|
+
if (input.onEvent) {
|
|
140
|
+
try {
|
|
141
|
+
input.onEvent(event);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Progress forwarding is best-effort; the job itself must not fail.
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (event.type === "stdout" || event.type === "stderr") {
|
|
148
|
+
try {
|
|
149
|
+
await appendFile(partialPath, redact(event.chunk), { encoding: "utf8", mode: 0o600 });
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// Progress mirroring is best-effort; the final result still lands.
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (event.type === "completion") {
|
|
156
|
+
// Fallback chains yield one completion per attempt; last one wins.
|
|
157
|
+
finalResult = event.result;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (cancelled) {
|
|
161
|
+
// Terminal, and deliberately NOT routed through the result/failure path:
|
|
162
|
+
// no result.json is written and the router never sees a failure, so a
|
|
163
|
+
// cancellation cannot charge the route's breaker or failure count for
|
|
164
|
+
// the caller changing their mind.
|
|
165
|
+
finished = true;
|
|
166
|
+
await pendingBeat;
|
|
167
|
+
const reason = await cancelReason(jobDir);
|
|
168
|
+
await updateStatus(jobDir, {
|
|
169
|
+
jobId: manifest.jobId,
|
|
170
|
+
status: "cancelled",
|
|
171
|
+
createdAt: manifest.createdAt,
|
|
172
|
+
updatedAt: timestamp(),
|
|
173
|
+
jobDir,
|
|
174
|
+
...(input.service !== undefined ? { service: input.service } : {}),
|
|
175
|
+
success: false,
|
|
176
|
+
error: reason !== undefined ? `Cancelled: ${reason}` : "Cancelled before it finished.",
|
|
177
|
+
...(manifest.warning !== undefined ? { warning: manifest.warning } : {}),
|
|
178
|
+
durationMs: Date.now() - started,
|
|
179
|
+
});
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const result = finalResult ?? {
|
|
183
|
+
output: "",
|
|
184
|
+
service: input.service ?? "none",
|
|
185
|
+
success: false,
|
|
186
|
+
error: "Router stream ended without a completion event",
|
|
187
|
+
};
|
|
188
|
+
finished = true;
|
|
189
|
+
await pendingBeat;
|
|
190
|
+
const payload = {
|
|
191
|
+
jobId: manifest.jobId,
|
|
192
|
+
result: { ...result, ...(result.error !== undefined ? { error: boundedError(result.error) } : {}) },
|
|
193
|
+
decision: finalDecision,
|
|
194
|
+
};
|
|
195
|
+
await writeFile(path.join(jobDir, "output", "stdout.log"), redact(result.output), { encoding: "utf8", mode: 0o600 });
|
|
196
|
+
await writeFile(path.join(jobDir, "output", "stderr.log"), redact(result.error ?? ""), { encoding: "utf8", mode: 0o600 });
|
|
197
|
+
await writeJson(path.join(jobDir, "output", "result.json"), payload);
|
|
198
|
+
await writeFile(path.join(jobDir, "output", "result.md"), redact(result.output || result.error || ""), { encoding: "utf8", mode: 0o600 });
|
|
199
|
+
await updateStatus(jobDir, {
|
|
200
|
+
jobId: manifest.jobId,
|
|
201
|
+
status: result.success ? "completed" : "failed",
|
|
202
|
+
createdAt: manifest.createdAt,
|
|
203
|
+
updatedAt: timestamp(),
|
|
204
|
+
jobDir,
|
|
205
|
+
...(input.service !== undefined ? { service: input.service } : {}),
|
|
206
|
+
route: result.service,
|
|
207
|
+
success: result.success,
|
|
208
|
+
...(result.error !== undefined ? { error: boundedError(result.error) } : {}),
|
|
209
|
+
...(manifest.warning !== undefined ? { warning: manifest.warning } : {}),
|
|
210
|
+
durationMs: Date.now() - started,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
finished = true;
|
|
215
|
+
await pendingBeat;
|
|
216
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
217
|
+
try {
|
|
218
|
+
// The sibling of the success path 25 lines up, which redacts. Missing
|
|
219
|
+
// this one is the same one-branch-of-a-pair miss the chokepoint exists
|
|
220
|
+
// to make impossible, found in the very file the chokepoint edited.
|
|
221
|
+
await writeFile(path.join(jobDir, "output", "stderr.log"), redact(message), {
|
|
222
|
+
encoding: "utf8",
|
|
223
|
+
mode: 0o600,
|
|
224
|
+
});
|
|
225
|
+
await updateStatus(jobDir, {
|
|
226
|
+
jobId: manifest.jobId,
|
|
227
|
+
status: "failed",
|
|
228
|
+
createdAt: manifest.createdAt,
|
|
229
|
+
updatedAt: timestamp(),
|
|
230
|
+
jobDir,
|
|
231
|
+
...(input.service !== undefined ? { service: input.service } : {}),
|
|
232
|
+
success: false,
|
|
233
|
+
error: boundedError(message),
|
|
234
|
+
...(manifest.warning !== undefined ? { warning: manifest.warning } : {}),
|
|
235
|
+
durationMs: Date.now() - started,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// The job directory can be GONE by the time a failure is recorded —
|
|
240
|
+
// retention pruning, or a caller that tore down its state mid-run.
|
|
241
|
+
// There is nowhere to write and no reader left to care; throwing here
|
|
242
|
+
// would reject `completion`, which is documented to never reject (and
|
|
243
|
+
// surfaced in CI as an unhandled rejection out of a finished test).
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
finally {
|
|
247
|
+
clearInterval(heartbeat);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/** How often a live background run bumps its status file's updatedAt. */
|
|
251
|
+
const HEARTBEAT_INTERVAL_MS = 15_000;
|
|
252
|
+
/**
|
|
253
|
+
* Fallback dispatch timeout for jobs. Dispatchers hard-code a short default
|
|
254
|
+
* (10 min for CLI harnesses, 2 min for openai_compatible) meant to catch a
|
|
255
|
+
* genuinely hung process — waiting on stdin that'll never come, a stalled
|
|
256
|
+
* network call — not to cap a slow-but-healthy run. That default made sense
|
|
257
|
+
* as-is for `code`, which blocks an MCP call anyway, but `job` runs in the
|
|
258
|
+
* background and is polled, so nothing about it requires killing a process
|
|
259
|
+
* that's still making progress after 10 minutes. Below both an explicit
|
|
260
|
+
* `hints.timeoutMs` and the route's own configured `timeoutMs` in
|
|
261
|
+
* precedence, so this only fills the gap when nobody set either.
|
|
262
|
+
*
|
|
263
|
+
* Router.stream() treats this specific value as a budget for the WHOLE call
|
|
264
|
+
* (including router fallback retries), not a per-attempt allowance — without
|
|
265
|
+
* that, a job that falls back twice (the router's default maxFallbacks: 2)
|
|
266
|
+
* could burn up to 3x this value before failing conclusively.
|
|
267
|
+
*/
|
|
268
|
+
export const JOB_DEFAULT_TIMEOUT_MS = 60 * 60 * 1000;
|
|
269
|
+
/**
|
|
270
|
+
* Rebuild a job's input from its on-disk bundle and execute it. This is the
|
|
271
|
+
* detached runner's whole job; the manifest deliberately carries everything
|
|
272
|
+
* a run needs (prompt path, resolved workingDir, hints, service) precisely
|
|
273
|
+
* so execution can happen in a process that wasn't there when the job was
|
|
274
|
+
* created.
|
|
275
|
+
*/
|
|
276
|
+
export async function executeJobDir(deps, jobDir) {
|
|
277
|
+
const manifest = await readJson(path.join(jobDir, "manifest.json"));
|
|
278
|
+
const prompt = await readFile(manifest.promptPath, "utf8");
|
|
279
|
+
const input = {
|
|
280
|
+
prompt,
|
|
281
|
+
files: manifest.files.map((f) => f.originalPath),
|
|
282
|
+
workingDir: manifest.workingDir,
|
|
283
|
+
...(manifest.hints !== undefined ? { hints: manifest.hints } : {}),
|
|
284
|
+
...(manifest.workspacePolicy !== undefined
|
|
285
|
+
? { workspacePolicy: manifest.workspacePolicy }
|
|
286
|
+
: {}),
|
|
287
|
+
...(manifest.service !== undefined ? { service: manifest.service } : {}),
|
|
288
|
+
};
|
|
289
|
+
await runJob(deps, jobDir, manifest, input);
|
|
290
|
+
}
|
|
291
|
+
/** dist/job-runner.js next to this module (compiled), or via the package's dist/ when running from src. */
|
|
292
|
+
export function resolveRunnerPath() {
|
|
293
|
+
// Resolved against THIS module's own location, which is a trap worth
|
|
294
|
+
// stating: the candidates below have to be updated whenever this function
|
|
295
|
+
// moves between directories. Splitting jobs.ts moved it from `dist/` down
|
|
296
|
+
// into `dist/jobs/`, both candidates missed, and the function returned
|
|
297
|
+
// undefined — which is not an error anywhere, it is the signal to run the
|
|
298
|
+
// job IN-PROCESS. So every dispatch quietly stopped being detached and the
|
|
299
|
+
// concurrency gate stopped firing, with nothing failing until the job
|
|
300
|
+
// concurrency tests ran.
|
|
301
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
302
|
+
const candidates = [
|
|
303
|
+
// dist/jobs/run.js -> dist/job-runner.js (the built layout today)
|
|
304
|
+
path.join(here, "..", "job-runner.js"),
|
|
305
|
+
// Beside this file, if the build ever flattens or co-locates it.
|
|
306
|
+
path.join(here, "job-runner.js"),
|
|
307
|
+
// src/jobs/run.ts with a dist/ build present (unbuilt checkout, tests).
|
|
308
|
+
path.join(here, "..", "..", "dist", "job-runner.js"),
|
|
309
|
+
];
|
|
310
|
+
return candidates.find((candidate) => existsSync(candidate));
|
|
311
|
+
}
|
|
312
|
+
const TERMINAL_WATCH_INTERVAL_MS = 300;
|
|
313
|
+
/**
|
|
314
|
+
* Watch a detached job's directory until it reaches a terminal state
|
|
315
|
+
* (result.json present, or a failed/orphaned status — the orphan check
|
|
316
|
+
* doubles as the exit path if the runner dies). Timer is unref'd: an
|
|
317
|
+
* exiting server abandons the watch, which is exactly the point of
|
|
318
|
+
* detached execution.
|
|
319
|
+
*/
|
|
320
|
+
export async function watchUntilTerminal(jobDir) {
|
|
321
|
+
const deadline = Date.now() + JOB_DEFAULT_TIMEOUT_MS + 10 * 60 * 1000;
|
|
322
|
+
while (Date.now() < deadline) {
|
|
323
|
+
// Waits for a terminal STATUS, deliberately not for result.json.
|
|
324
|
+
//
|
|
325
|
+
// runJob writes result.json and then updates the status, so returning on
|
|
326
|
+
// result.json alone let this resolve in the window between the two: a
|
|
327
|
+
// caller could `await` a job and then read `status: "running"` from the
|
|
328
|
+
// job it had just been told was finished. Observed on Windows CI as
|
|
329
|
+
// "expected 'running' to be 'completed'".
|
|
330
|
+
//
|
|
331
|
+
// Because the status write comes last, a terminal status implies the
|
|
332
|
+
// result is already on disk — the ordering does the synchronising, so no
|
|
333
|
+
// extra check is needed here. A runner that dies between the two writes
|
|
334
|
+
// is covered by withOrphanCheck below, which is the same exit path as any
|
|
335
|
+
// other dead runner.
|
|
336
|
+
try {
|
|
337
|
+
const status = withOrphanCheck(await readJson(path.join(jobDir, "status.json")));
|
|
338
|
+
if (status.status === "completed" ||
|
|
339
|
+
status.status === "failed" ||
|
|
340
|
+
status.status === "orphaned" ||
|
|
341
|
+
status.status === "cancelled") {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
// Transient read during an atomic rename — retry next tick.
|
|
347
|
+
}
|
|
348
|
+
await delay(TERMINAL_WATCH_INTERVAL_MS, undefined, { ref: false });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/jobs/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAa,EACb,MAAc,EACd,QAAqB,EACrB,KAAoB;IAEpB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,GAAc,EAAE,CAAC,CAAC;QACtC,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,SAAS,EAAE,SAAS,EAAE;QACtB,MAAM;QACN,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS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ing was rewritten.
|
|
5
|
+
*/
|
|
6
|
+
import type { JobDeps, JobStatus, StartedJob, StartJobInput } from "./types.js";
|
|
7
|
+
export declare function startAsyncJob(deps: JobDeps, input: StartJobInput): Promise<JobStatus>;
|
|
8
|
+
export declare function startAsyncJobTracked(deps: JobDeps, input: StartJobInput): Promise<StartedJob>;
|
|
9
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/jobs/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmBH,OAAO,KAAK,EAAE,OAAO,EAAe,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAM7F,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAE3F;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAmHnG"}
|