@nodii/dev 0.6.49 → 0.6.50
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 +9 -1
- package/dist/cli.js +7 -0
- package/dist/core.js +2 -2
- package/dist/devops-openapi.json +1 -1
- package/dist/lane-supervisor.js +2 -2
- package/dist/lanes.js +13 -2
- package/package.json +1 -1
package/dist/lane-supervisor.js
CHANGED
|
@@ -92,7 +92,7 @@ export const doneCheckRecorded = (lane) =>
|
|
|
92
92
|
|| (lane?.steps ?? []).some((step) => step.stepKey === "dev_check" && step.state === "done")
|
|
93
93
|
|| FINISHED_LANE.has(lane?.status);
|
|
94
94
|
|
|
95
|
-
/** A lane is BLOCKED by a blocked step (`lane step --block`) or a latest heartbeat note that
|
|
95
|
+
/** A lane is BLOCKED by a blocked step (`lane step --block`) or a latest heartbeat note that starts "blocked" or "WAITING:" (AGENT-HARNESS-46). */
|
|
96
96
|
export const laneBlocked = (lane) => Boolean(laneBlockedReason(lane));
|
|
97
97
|
|
|
98
98
|
/** Why a lane is BLOCKED, or null (the same rule Dev applies to a run's exit). */
|
|
@@ -101,7 +101,7 @@ export function laneBlockedReason(lane) {
|
|
|
101
101
|
if (step) return `Lane step ${step.side}/${step.stepKey} is blocked.`;
|
|
102
102
|
const heartbeat = (lane?.events ?? []).filter((event) => event.type === "heartbeat").at(-1);
|
|
103
103
|
const note = String(heartbeat?.metadata?.note ?? "");
|
|
104
|
-
return /^\s*blocked\b/i.test(note) ? `Lane heartbeat: ${note.slice(0, 500)}` : null;
|
|
104
|
+
return /^\s*blocked\b/i.test(note) || /^\s*WAITING\s*:/.test(note) ? `Lane heartbeat: ${note.slice(0, 500)}` : null;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/** The step a lane that stopped early goes back to (hub-58, NODII-DEV-CLI-8/9). */
|
package/dist/lanes.js
CHANGED
|
@@ -657,10 +657,20 @@ export async function laneCommand(action, args, flags, { request = devRequest, c
|
|
|
657
657
|
return { payload, human: `${ref}: subagent quota set to ${quota}.` };
|
|
658
658
|
}
|
|
659
659
|
if (action === "resume") {
|
|
660
|
+
// AGENT-HARNESS-46: --override resumes a lane the two-deaths rule stopped;
|
|
661
|
+
// Dev allows it only after a `lane amend`, and keeps the reason on the run.
|
|
662
|
+
if (flags.override && flags.reason === undefined)
|
|
663
|
+
throw new CliError("USAGE", "lane resume --override needs --reason TEXT.", 2);
|
|
664
|
+
if (!flags.override && flags.reason !== undefined)
|
|
665
|
+
throw new CliError("USAGE", "--reason goes with --override.", 2);
|
|
666
|
+
if (Array.isArray(flags.reason)) throw new CliError("USAGE", "Give --reason once.", 2);
|
|
667
|
+
const overrideReason = typeof flags.reason === "string" ? flags.reason.trim() : "";
|
|
668
|
+
if (flags.override && !overrideReason) throw new CliError("USAGE", "--reason needs TEXT: why resuming the amended lane is safe.", 2);
|
|
669
|
+
if (overrideReason.length > 2_000) throw new CliError("USAGE", `--reason is ${overrideReason.length} characters; Dev keeps at most 2,000.`, 2);
|
|
660
670
|
const payload = await request(
|
|
661
671
|
"POST",
|
|
662
672
|
`/api/v1/lanes/${encode(id)}/resume`,
|
|
663
|
-
via,
|
|
673
|
+
flags.override ? { override: true, reason: overrideReason, ...via } : via,
|
|
664
674
|
);
|
|
665
675
|
let launched;
|
|
666
676
|
try {
|
|
@@ -686,7 +696,8 @@ export async function laneCommand(action, args, flags, { request = devRequest, c
|
|
|
686
696
|
const continuation = next
|
|
687
697
|
? `${next.side}/${next.step}`
|
|
688
698
|
: "the lane's next unfinished step";
|
|
689
|
-
|
|
699
|
+
const override = response.data.run.resumeOverrideReason;
|
|
700
|
+
return `${ref}: resumed fresh run ${runId} as PID ${launched.pid}; continuing ${continuation} from ${checkpoint}.${override ? ` Override past the two-deaths stop recorded ("${override}"); the death count restarts.` : ""}`;
|
|
690
701
|
},
|
|
691
702
|
};
|
|
692
703
|
}
|