tines 0.0.97 → 0.0.99
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/dist/index.js +21 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3624,7 +3624,9 @@ var DESCRIBERS = {
|
|
|
3624
3624
|
"runner.errored": (_ev, p) => [
|
|
3625
3625
|
text("saw runner"),
|
|
3626
3626
|
name(p.runner_name),
|
|
3627
|
-
|
|
3627
|
+
// Not "fail to launch": the same counter now also carries runs a
|
|
3628
|
+
// runner dropped after launch. The cause is in the error text.
|
|
3629
|
+
text(`fail (${str(p.consecutive_failures)} consecutive): ${str(p.error)}`)
|
|
3628
3630
|
],
|
|
3629
3631
|
"routing_rule.created": (ev, p) => [
|
|
3630
3632
|
text(`${action(ev.type)} the ${str(p.scope_label)} routing rule`)
|
|
@@ -6053,8 +6055,14 @@ var RunTable = class {
|
|
|
6053
6055
|
* already settled (a poll-cancel racing a clone failure or spawn error)
|
|
6054
6056
|
* this still cleans up — the slot, workspace, and state entry must never
|
|
6055
6057
|
* outlive the run — but reports nothing.
|
|
6058
|
+
*
|
|
6059
|
+
* Pass `judgment: 'interrupted'` when the daemon itself ended the run
|
|
6060
|
+
* (shutdown, restart) rather than the work failing: the supervisor then
|
|
6061
|
+
* spares the issue a strike. Everything a run can do wrong to itself —
|
|
6062
|
+
* a non-zero harness exit, a workspace that would not set up — must not
|
|
6063
|
+
* set it.
|
|
6056
6064
|
*/
|
|
6057
|
-
async finishAndCleanup(run, status, error) {
|
|
6065
|
+
async finishAndCleanup(run, status, error, judgment) {
|
|
6058
6066
|
if (run.settled) return this.cleanup(run);
|
|
6059
6067
|
run.settled = true;
|
|
6060
6068
|
run.endNote ??= error;
|
|
@@ -6062,7 +6070,7 @@ var RunTable = class {
|
|
|
6062
6070
|
if (this.keep(status)) this.effects.noteKept?.(run);
|
|
6063
6071
|
await run.flush?.();
|
|
6064
6072
|
try {
|
|
6065
|
-
await this.effects.finish(run, status, error);
|
|
6073
|
+
await this.effects.finish(run, status, error, judgment);
|
|
6066
6074
|
this.effects.log(`run ${run.runId} finished: ${status}${error ? ` (${error})` : ""}`);
|
|
6067
6075
|
} catch (err) {
|
|
6068
6076
|
this.effects.log(
|
|
@@ -6533,8 +6541,12 @@ async function runDaemon(opts) {
|
|
|
6533
6541
|
log(`agent CLI: ${cliLabel(await ensureCli())}`);
|
|
6534
6542
|
const table2 = new RunTable(
|
|
6535
6543
|
{
|
|
6536
|
-
finish: async (run, status, error) => {
|
|
6537
|
-
await client2.finishRun(run.runId, {
|
|
6544
|
+
finish: async (run, status, error, judgment) => {
|
|
6545
|
+
await client2.finishRun(run.runId, {
|
|
6546
|
+
status,
|
|
6547
|
+
...error ? { error } : {},
|
|
6548
|
+
...judgment ? { judgment } : {}
|
|
6549
|
+
});
|
|
6538
6550
|
},
|
|
6539
6551
|
release: (run, { keep, outcome }) => {
|
|
6540
6552
|
if (run.timeout) clearTimeout(run.timeout);
|
|
@@ -6581,7 +6593,8 @@ async function runDaemon(opts) {
|
|
|
6581
6593
|
try {
|
|
6582
6594
|
await client2.finishRun(orphan.run_id, {
|
|
6583
6595
|
status: "failed",
|
|
6584
|
-
error: "daemon restarted; orphaned harness killed"
|
|
6596
|
+
error: "daemon restarted; orphaned harness killed",
|
|
6597
|
+
judgment: "interrupted"
|
|
6585
6598
|
});
|
|
6586
6599
|
} catch {
|
|
6587
6600
|
}
|
|
@@ -6766,7 +6779,7 @@ async function runDaemon(opts) {
|
|
|
6766
6779
|
await Promise.all(
|
|
6767
6780
|
table2.values().map(async (run) => {
|
|
6768
6781
|
if (run.child?.pid) killTree(run.child.pid, "SIGTERM");
|
|
6769
|
-
await table2.finishAndCleanup(run, "failed", "daemon shut down");
|
|
6782
|
+
await table2.finishAndCleanup(run, "failed", "daemon shut down", "interrupted");
|
|
6770
6783
|
})
|
|
6771
6784
|
);
|
|
6772
6785
|
process.exit(0);
|
|
@@ -6887,7 +6900,7 @@ function register7(program3) {
|
|
|
6887
6900
|
if (runner.last_seen_at) console.log(`last seen: ${timestamp(runner.last_seen_at)}`);
|
|
6888
6901
|
if (runner.launch_failures > 0) {
|
|
6889
6902
|
console.log(
|
|
6890
|
-
`
|
|
6903
|
+
`consecutive failures: ${runner.launch_failures}${runner.backoff_until ? ` (backing off until ${timestamp(runner.backoff_until)})` : ""}`
|
|
6891
6904
|
);
|
|
6892
6905
|
}
|
|
6893
6906
|
const harness = runner.config.harness;
|