@repo-os/repoos 0.5.84 → 0.5.85
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/.build-info.json +2 -2
- package/dist/.build-stamp.json +1 -1
- package/dist/commands/restart.js +12 -3
- package/dist/commands/ui-smoke.js +1 -0
- package/dist/core/agent-contract.js +1 -0
- package/dist/core/config.js +40 -0
- package/dist/core/supervisor-detect.js +8 -4
- package/dist/core/supervisor-detect.test.js +14 -0
- package/dist/core/types.d.ts +4 -0
- package/dist/server/active-without-engineer-recovery.d.ts +1 -0
- package/dist/server/active-without-engineer-recovery.js +15 -4
- package/dist/server/agents.d.ts +1 -1
- package/dist/server/agents.js +2 -1
- package/dist/server/review.d.ts +14 -0
- package/dist/server/review.js +78 -2
- package/dist/server/task-watchdog.js +6 -3
- package/dist/server/ui-handoff-gate.d.ts +5 -0
- package/dist/server/ui-handoff-gate.js +8 -1
- package/dist/ui/assets/{ActivityIndicator-CeZc0KuR.js → ActivityIndicator-B7rDbESG.js} +1 -1
- package/dist/ui/assets/{AgentModelControl-DliRysdG.js → AgentModelControl-CX4OoBYS.js} +1 -1
- package/dist/ui/assets/{AgentModelModal-1FOLpv64.js → AgentModelModal-Dno7Tuta.js} +1 -1
- package/dist/ui/assets/{AgentsView-BOJMpfXs.js → AgentsView-CRYrlOAO.js} +2 -2
- package/dist/ui/assets/{ChatAgentModelChip-62NWVHvV.js → ChatAgentModelChip-DmrpFSwd.js} +1 -1
- package/dist/ui/assets/{ChecksView-CllOArB3.js → ChecksView-SxA-pk3D.js} +0 -0
- package/dist/ui/assets/{ClientBoardView-TtZKBXM0.js → ClientBoardView-D8iNvaUD.js} +1 -1
- package/dist/ui/assets/{ConfirmDialog-BM-2_LrJ.js → ConfirmDialog-DPnkOFol.js} +1 -1
- package/dist/ui/assets/ContextView-BWVlwOFx.js +4 -0
- package/dist/ui/assets/{DashboardView-AHKhmGDB.js → DashboardView-S9gRjNg6.js} +1 -1
- package/dist/ui/assets/{DeleteConfirmDialog-YUeTLI_Z.js → DeleteConfirmDialog-Da9Bacbx.js} +1 -1
- package/dist/ui/assets/{DeploymentsView-DTNQEAoV.js → DeploymentsView-C5zBEHxi.js} +1 -1
- package/dist/ui/assets/{DevView-DvI14vzc.js → DevView-WxefHWVh.js} +1 -1
- package/dist/ui/assets/{DiffView-UV-4-Lq2.js → DiffView-Dpx5VqLM.js} +2 -2
- package/dist/ui/assets/{FailedTestsList-Cd5L3WOx.js → FailedTestsList-TSKrXUnD.js} +1 -1
- package/dist/ui/assets/InputsView-DQFYYtZx.js +1 -0
- package/dist/ui/assets/{LoginView-Cfkaknai.js → LoginView-BikSujup.js} +1 -1
- package/dist/ui/assets/{PageSkeleton-DPgdyP-2.js → PageSkeleton-0JF8PB5b.js} +1 -1
- package/dist/ui/assets/{ReleasesView-DkKY9dWN.js → ReleasesView-CDaccG1K.js} +2 -2
- package/dist/ui/assets/{SecretsView-BSG_CzDO.js → SecretsView-DB1NyJjH.js} +1 -1
- package/dist/ui/assets/SettingsView-BK6huHqS.js +4 -0
- package/dist/ui/assets/StoriesView-De_gpM_m.js +1 -0
- package/dist/ui/assets/VoiceDictate-DM62pfGf.js +1 -0
- package/dist/ui/assets/WorkView-B40iw572.js +2 -0
- package/dist/ui/assets/{WorkView-LeQIarQj.css → WorkView-CrMpEDgu.css} +1 -1
- package/dist/ui/assets/{abnfDiagram-VCTEODGH-B9IAbUFy.js → abnfDiagram-VCTEODGH-D_vcxiR-.js} +1 -1
- package/dist/ui/assets/{activity-motion-D6DhAJn3.js → activity-motion-BmUJdM2_.js} +1 -1
- package/dist/ui/assets/{architectureDiagram-5GKGNRK7-CSxdDxdv.js → architectureDiagram-5GKGNRK7-BTMmZWaY.js} +1 -1
- package/dist/ui/assets/{blockDiagram-I7D4REHJ-wVYqTZJa.js → blockDiagram-I7D4REHJ-C-6f3IQy.js} +1 -1
- package/dist/ui/assets/{c4Diagram-7LVT6UL2-D0wUj0mJ.js → c4Diagram-7LVT6UL2-CLIVkQqJ.js} +1 -1
- package/dist/ui/assets/channel-BT55ZukM.js +1 -0
- package/dist/ui/assets/{check-setup-Csuocevc.js → check-setup-DmxyguK7.js} +1 -1
- package/dist/ui/assets/{checkbox-DQJ1FrVo.js → checkbox-CppTZSHg.js} +1 -1
- package/dist/ui/assets/{chunk-2E4U76K2-CJLVrsB2.js → chunk-2E4U76K2-DAiVFWo8.js} +1 -1
- package/dist/ui/assets/{chunk-4HAMMTFA-Cimw9LvS.js → chunk-4HAMMTFA-iz6X9_oT.js} +1 -1
- package/dist/ui/assets/{chunk-75Z2AOVW-DzScWF1V.js → chunk-75Z2AOVW-S6pCMni6.js} +1 -1
- package/dist/ui/assets/{chunk-CLGD4ZFX-BzPjIihh.js → chunk-CLGD4ZFX-CudExNfg.js} +1 -1
- package/dist/ui/assets/{chunk-DU6HZSFF-Dd7a_MuG.js → chunk-DU6HZSFF-cI0jScWk.js} +1 -1
- package/dist/ui/assets/{chunk-F27PBJKO-D0JZuJ5m.js → chunk-F27PBJKO-NdPQRAvb.js} +1 -1
- package/dist/ui/assets/{chunk-GMAD6QVW-DLqviB4O.js → chunk-GMAD6QVW-DYbDVqrr.js} +1 -1
- package/dist/ui/assets/{chunk-GVQU2GXP-BfKh1LvB.js → chunk-GVQU2GXP-DcMhQDFV.js} +1 -1
- package/dist/ui/assets/{chunk-IMKFNOWR-BDNhKsVY.js → chunk-IMKFNOWR-BJtkDi3G.js} +1 -1
- package/dist/ui/assets/{chunk-L3NEJ4N5-C94I1TWP.js → chunk-L3NEJ4N5-DUPYmMgu.js} +1 -1
- package/dist/ui/assets/{chunk-OSK3NFVY-BAlPCIkt.js → chunk-OSK3NFVY-CvqmQX_6.js} +1 -1
- package/dist/ui/assets/{chunk-P2QGCYS3-BweSuFw0.js → chunk-P2QGCYS3-CWBcCYA2.js} +1 -1
- package/dist/ui/assets/{chunk-POPQ4Y6H-CtKtTfpb.js → chunk-POPQ4Y6H-CQFQH4Bw.js} +1 -1
- package/dist/ui/assets/{chunk-PWAF6VOD-Cq66_a0L.js → chunk-PWAF6VOD-08tXbqky.js} +1 -1
- package/dist/ui/assets/{chunk-SHT3W25Y-Dsi7n_QT.js → chunk-SHT3W25Y-Ce582OvZ.js} +1 -1
- package/dist/ui/assets/{chunk-SVP7TREG-BUbpdyBs.js → chunk-SVP7TREG-C1ontwHC.js} +1 -1
- package/dist/ui/assets/{chunk-TICWLB2K-CBgDLi9g.js → chunk-TICWLB2K-zbhtp7tS.js} +1 -1
- package/dist/ui/assets/chunk-TLUHSLCS-CQmyYhqh.js +2 -0
- package/dist/ui/assets/classDiagram-ZZMXUADV-Bx7fOfp7.js +1 -0
- package/dist/ui/assets/classDiagram-v2-VYDZK3BY-Bx7fOfp7.js +1 -0
- package/dist/ui/assets/{close-yf0EeB2n.js → close-DGMDnjoO.js} +1 -1
- package/dist/ui/assets/{cynefinDiagram-5FMLGOSQ-Dz-JTIHB.js → cynefinDiagram-5FMLGOSQ-BtUPtBty.js} +1 -1
- package/dist/ui/assets/{dagre-GXQ25YYZ-7msIPcTc.js → dagre-GXQ25YYZ-0oGDuHsX.js} +1 -1
- package/dist/ui/assets/{diagram-S7CK7UJ4-BIhr20kw.js → diagram-S7CK7UJ4-B5J7KZ0-.js} +1 -1
- package/dist/ui/assets/{diagram-UQ7AKVKN-BUlFqnt8.js → diagram-UQ7AKVKN-C721hQcW.js} +1 -1
- package/dist/ui/assets/{diagram-VSXAHHWV-CBLJHLdy.js → diagram-VSXAHHWV-DINlmaMP.js} +1 -1
- package/dist/ui/assets/{diagram-VX7I27RA-Dzp_UvIV.js → diagram-VX7I27RA-C6IdJ1ye.js} +1 -1
- package/dist/ui/assets/{diagram-Z3DM3KII-Fr1SInQr.js → diagram-Z3DM3KII-DQUDwFj8.js} +1 -1
- package/dist/ui/assets/{docs-BSZqW4qy.js → docs-B6G_TAeF.js} +1 -1
- package/dist/ui/assets/{ebnfDiagram-PWID7BFC-BfYf5dOR.js → ebnfDiagram-PWID7BFC-BEK7VsZw.js} +1 -1
- package/dist/ui/assets/{erDiagram-RLTQ6QDP-CJJ4hDgg.js → erDiagram-RLTQ6QDP-DJtYuZbF.js} +1 -1
- package/dist/ui/assets/flowDiagram-HODETNUW-nL1KnyIE.js +1 -0
- package/dist/ui/assets/{ganttDiagram-EL5Y4UJY-C7bJvcmf.js → ganttDiagram-EL5Y4UJY-BQH2lBNs.js} +1 -1
- package/dist/ui/assets/{gitGraphDiagram-WWUBYQGX-BPVAa2bt.js → gitGraphDiagram-WWUBYQGX-Be4pg0bV.js} +1 -1
- package/dist/ui/assets/index-B37f0CKv.css +1 -0
- package/dist/ui/assets/index-DOGC96Oa.js +95 -0
- package/dist/ui/assets/{infoDiagram-27XIBGKW-84eF6C-I.js → infoDiagram-27XIBGKW-B71tSaIP.js} +1 -1
- package/dist/ui/assets/{input-BH2-2GgN.js → input-Bc0aNTNs.js} +1 -1
- package/dist/ui/assets/{ishikawaDiagram-5VMMS53U-COtnKvQO.js → ishikawaDiagram-5VMMS53U-Ci-Jx2Js.js} +1 -1
- package/dist/ui/assets/{journeyDiagram-3NMN7TZE-x8cAZGGU.js → journeyDiagram-3NMN7TZE-BB5CGDvB.js} +1 -1
- package/dist/ui/assets/{kanban-definition-UXKFOSKX-DQRZkfXW.js → kanban-definition-UXKFOSKX-D8jL16xp.js} +1 -1
- package/dist/ui/assets/{layer-B7s9BFq9.js → layer-BvZDv12j.js} +1 -1
- package/dist/ui/assets/{line-BSWseUPR.js → line-ByXvpXQI.js} +1 -1
- package/dist/ui/assets/markdown-rVjWPmDr.js +16 -0
- package/dist/ui/assets/{mermaid-parser.core-CqDXJk6N.js → mermaid-parser.core-CybWBi58.js} +1 -1
- package/dist/ui/assets/mermaid.core-B_AsP_Od.js +11 -0
- package/dist/ui/assets/{mindmap-definition-YA3MSWOX-CtpAeVX5.js → mindmap-definition-YA3MSWOX-CumDN111.js} +1 -1
- package/dist/ui/assets/{pegDiagram-XKGWAZYB-Dzh-UcHK.js → pegDiagram-XKGWAZYB-CRvcQOQM.js} +1 -1
- package/dist/ui/assets/{pieDiagram-E7YTZNPT-CICMdKNw.js → pieDiagram-E7YTZNPT-C0jMuzQh.js} +1 -1
- package/dist/ui/assets/{quadrantDiagram-AXDQQJYC-rhX0HrBW.js → quadrantDiagram-AXDQQJYC-CWlSZ15P.js} +1 -1
- package/dist/ui/assets/{railroadDiagram-O6MQD6OU-BxiYDft0.js → railroadDiagram-O6MQD6OU-ab0STaMg.js} +1 -1
- package/dist/ui/assets/{repo-9Mfo4E0_.js → repo-Db5lO2aA.js} +1 -1
- package/dist/ui/assets/{requirementDiagram-BXWQKSXE-Dy9CHwe7.js → requirementDiagram-BXWQKSXE-BR9-r5kT.js} +1 -1
- package/dist/ui/assets/{sankeyDiagram-P5KCCOFB-4jaLqbSq.js → sankeyDiagram-P5KCCOFB-Bg8P0wm3.js} +1 -1
- package/dist/ui/assets/{sequenceDiagram-WJ2MYXX4-BLskO8iC.js → sequenceDiagram-WJ2MYXX4-BkwXkfce.js} +1 -1
- package/dist/ui/assets/{stateDiagram-D77RDMKH-DzJXyNX6.js → stateDiagram-D77RDMKH-DvRxAM1-.js} +1 -1
- package/dist/ui/assets/stateDiagram-v2-MP3YSRHH-CCswgD6Z.js +1 -0
- package/dist/ui/assets/{swimlanes-42K2YHIH-DJr-R9fd.js → swimlanes-42K2YHIH-BbGDO56J.js} +1 -1
- package/dist/ui/assets/swimlanesDiagram-VR7AAH4N-Dk0CfAzV.js +8 -0
- package/dist/ui/assets/{switch-nW6XUdAS.js → switch-BHLgIQon.js} +1 -1
- package/dist/ui/assets/{timeline-definition-24CTP7MA-DVD3r7_i.js → timeline-definition-24CTP7MA-CYUFWMTj.js} +1 -1
- package/dist/ui/assets/{title-BbYxmtoR.js → title-BSEVo0iT.js} +1 -1
- package/dist/ui/assets/{value--sTHtfns.js → value-CIJASySy.js} +1 -1
- package/dist/ui/assets/vendor-ui-BmzYkqZG.js +3 -0
- package/dist/ui/assets/{vennDiagram-4TSXK5OY-CkeTw_dr.js → vennDiagram-4TSXK5OY-CJzMntTj.js} +1 -1
- package/dist/ui/assets/{viewport-B7a-WO5s.js → viewport-B5Qy7nSx.js} +1 -1
- package/dist/ui/assets/{wardleyDiagram-VM6X3IG4-Bl5m7zq0.js → wardleyDiagram-VM6X3IG4-DwS5yWjv.js} +1 -1
- package/dist/ui/assets/{xychartDiagram-S5SC5T6Z-DYT8EjiI.js → xychartDiagram-S5SC5T6Z-BHRlgUkt.js} +1 -1
- package/dist/ui/index.html +21 -20
- package/dist/ui/sw.js +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/ContextView-C4UjFpfc.js +0 -4
- package/dist/ui/assets/InputsView-BL_xq3pR.js +0 -1
- package/dist/ui/assets/SettingsView-Dsms02fo.js +0 -4
- package/dist/ui/assets/StoriesView-CfusmPsX.js +0 -1
- package/dist/ui/assets/VoiceDictate-nUNiNAs_.js +0 -16
- package/dist/ui/assets/WorkView-CpbHFks9.js +0 -2
- package/dist/ui/assets/channel-DOppM0tf.js +0 -1
- package/dist/ui/assets/chunk-TLUHSLCS-BbXsybL0.js +0 -2
- package/dist/ui/assets/classDiagram-ZZMXUADV-Bgy_im3-.js +0 -1
- package/dist/ui/assets/classDiagram-v2-VYDZK3BY-Bgy_im3-.js +0 -1
- package/dist/ui/assets/flowDiagram-HODETNUW-CYO0U6_J.js +0 -1
- package/dist/ui/assets/index-KO2COO1X.css +0 -1
- package/dist/ui/assets/index-irIeadFD.js +0 -95
- package/dist/ui/assets/mermaid.core-BUhMlEuU.js +0 -11
- package/dist/ui/assets/stateDiagram-v2-MP3YSRHH-1OQBV1y4.js +0 -1
- package/dist/ui/assets/swimlanesDiagram-VR7AAH4N-PUbDd9b6.js +0 -8
- package/dist/ui/assets/vendor-ui-BIC6pWFX.js +0 -3
package/dist/.build-info.json
CHANGED
package/dist/.build-stamp.json
CHANGED
package/dist/commands/restart.js
CHANGED
|
@@ -15,6 +15,7 @@ const PATH_LABEL = {
|
|
|
15
15
|
export async function cmdRestart(argv) {
|
|
16
16
|
let portFilter;
|
|
17
17
|
const whenIdle = argv.includes("--when-idle");
|
|
18
|
+
const force = argv.includes("--force");
|
|
18
19
|
for (let i = 0; i < argv.length; i++) {
|
|
19
20
|
if (argv[i] === "--port" || argv[i] === "-p") {
|
|
20
21
|
const raw = argv[++i];
|
|
@@ -28,14 +29,15 @@ export async function cmdRestart(argv) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
const { root } = boardRoot();
|
|
31
|
-
if (whenIdle) {
|
|
32
|
+
if (whenIdle || !force) {
|
|
32
33
|
const server = await locateRepoServer(root, { portFilter });
|
|
33
34
|
if (!server) {
|
|
34
35
|
console.error(c.red(" ✗ No running RepoOS server found to wait on."));
|
|
35
36
|
process.exitCode = 1;
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
if (whenIdle)
|
|
40
|
+
console.log(c.dim(" Waiting for agents, reviews and checks to finish…"));
|
|
39
41
|
const host = server.host === "0.0.0.0" ? "127.0.0.1" : server.host;
|
|
40
42
|
for (;;) {
|
|
41
43
|
try {
|
|
@@ -46,8 +48,15 @@ export async function cmdRestart(argv) {
|
|
|
46
48
|
if (typeof status.activeWork?.agents !== "number" ||
|
|
47
49
|
typeof status.activeWork?.checks !== "number")
|
|
48
50
|
throw new Error("server returned an invalid update status");
|
|
49
|
-
|
|
51
|
+
const agents = status.activeWork?.agents ?? 0;
|
|
52
|
+
const checks = status.activeWork?.checks ?? 0;
|
|
53
|
+
if (agents === 0 && checks === 0)
|
|
50
54
|
break;
|
|
55
|
+
if (!whenIdle) {
|
|
56
|
+
console.error(c.red(` ✗ Restart refused while ${agents} engineer(s) and ${checks} check(s) are running. Wait for them to finish or pass --force.`));
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
51
60
|
}
|
|
52
61
|
catch (error) {
|
|
53
62
|
console.error(c.red(` ✗ Could not confirm the server is idle: ${error.message}`));
|
|
@@ -187,6 +187,7 @@ async function runUISmokeTest() {
|
|
|
187
187
|
await assertNoHorizontalOverflow("dashboard", server.url);
|
|
188
188
|
await assertNoHorizontalOverflow("docs", `${server.url}/repo`);
|
|
189
189
|
// Navigate to work page and click +New Task
|
|
190
|
+
await page.setViewportSize({ width: 1280, height: 900 });
|
|
190
191
|
await page.evaluate(() => {
|
|
191
192
|
const navItems = document.querySelectorAll(".nav-item");
|
|
192
193
|
for (const item of Array.from(navItems)) {
|
|
@@ -1205,6 +1205,7 @@ export async function runAdapterContract(opts) {
|
|
|
1205
1205
|
try {
|
|
1206
1206
|
const cancelProc = spawn(binary, sanitizeSpawnArgs(runArgs).args, {
|
|
1207
1207
|
cwd: workDir,
|
|
1208
|
+
env: { ...process.env, REPOOS_AGENT_CONTRACT_CANCEL_PROBE: "1" },
|
|
1208
1209
|
stdio: ["ignore", "pipe", "pipe"],
|
|
1209
1210
|
shell: needsShell,
|
|
1210
1211
|
});
|
package/dist/core/config.js
CHANGED
|
@@ -215,6 +215,7 @@ export const DEFAULT_CONFIG = {
|
|
|
215
215
|
mode: "observe",
|
|
216
216
|
},
|
|
217
217
|
watchdog: {
|
|
218
|
+
queuedMessageRecoverMs: 3 * 60 * 1000,
|
|
218
219
|
enabled: true,
|
|
219
220
|
stalenessMs: 5 * 60 * 1000,
|
|
220
221
|
autoTransition: true,
|
|
@@ -290,6 +291,7 @@ export const DEFAULT_CONFIG = {
|
|
|
290
291
|
// one task, the next report summarises the recurring bug classes and the task
|
|
291
292
|
// is flagged for a human.
|
|
292
293
|
review: {
|
|
294
|
+
failedReportRetries: 2,
|
|
293
295
|
humanFlagAfterPasses: 5,
|
|
294
296
|
freezeAfterPasses: 4,
|
|
295
297
|
timeoutMinutes: 15,
|
|
@@ -1933,6 +1935,12 @@ export function loadConfig(rootArg, options = {}) {
|
|
|
1933
1935
|
if (typeof watchdogEnabled === "boolean") {
|
|
1934
1936
|
cfg.watchdog = { ...cfg.watchdog, enabled: watchdogEnabled };
|
|
1935
1937
|
}
|
|
1938
|
+
const queuedMessageRecoverMs = parsed["watchdog.queuedMessageRecoverMs"];
|
|
1939
|
+
if (typeof queuedMessageRecoverMs === "number" &&
|
|
1940
|
+
Number.isFinite(queuedMessageRecoverMs) &&
|
|
1941
|
+
queuedMessageRecoverMs >= 60_000) {
|
|
1942
|
+
cfg.watchdog = { ...cfg.watchdog, queuedMessageRecoverMs: queuedMessageRecoverMs };
|
|
1943
|
+
}
|
|
1936
1944
|
const watchdogStaleness = parsed["watchdog.stalenessMs"];
|
|
1937
1945
|
if (typeof watchdogStaleness === "number" && watchdogStaleness >= 60_000) {
|
|
1938
1946
|
cfg.watchdog = { ...cfg.watchdog, stalenessMs: watchdogStaleness };
|
|
@@ -2485,6 +2493,7 @@ export function loadConfig(rootArg, options = {}) {
|
|
|
2485
2493
|
const reviewHumanFlag = reviewNumber(parsed["review.humanFlagAfterPasses"]);
|
|
2486
2494
|
const reviewFreeze = reviewNumber(parsed["review.freezeAfterPasses"]);
|
|
2487
2495
|
const reviewTimeout = reviewNumber(parsed["review.timeoutMinutes"]);
|
|
2496
|
+
const failedReportRetries = reviewNumber(parsed["review.failedReportRetries"]);
|
|
2488
2497
|
const review = { ...DEFAULT_CONFIG.review, ...cfg.review };
|
|
2489
2498
|
let reviewConfigured = false;
|
|
2490
2499
|
if (reviewHumanFlag !== undefined && Number.isFinite(reviewHumanFlag) && reviewHumanFlag >= 1) {
|
|
@@ -2499,6 +2508,12 @@ export function loadConfig(rootArg, options = {}) {
|
|
|
2499
2508
|
review.timeoutMinutes = Math.min(240, Math.floor(reviewTimeout));
|
|
2500
2509
|
reviewConfigured = true;
|
|
2501
2510
|
}
|
|
2511
|
+
if (failedReportRetries !== undefined &&
|
|
2512
|
+
Number.isFinite(failedReportRetries) &&
|
|
2513
|
+
failedReportRetries >= 0) {
|
|
2514
|
+
review.failedReportRetries = Math.min(5, Math.floor(failedReportRetries));
|
|
2515
|
+
reviewConfigured = true;
|
|
2516
|
+
}
|
|
2502
2517
|
if (reviewConfigured)
|
|
2503
2518
|
cfg.review = review;
|
|
2504
2519
|
}
|
|
@@ -2946,6 +2961,17 @@ export function getConfigSchema() {
|
|
|
2946
2961
|
"minimum 60000 (1 minute). When recovery fails, the task is flagged for a human " +
|
|
2947
2962
|
"and a notice is recorded.",
|
|
2948
2963
|
},
|
|
2964
|
+
{
|
|
2965
|
+
key: "watchdog.queuedMessageRecoverMs",
|
|
2966
|
+
label: "Queued message recovery age",
|
|
2967
|
+
type: "number",
|
|
2968
|
+
tier: "live",
|
|
2969
|
+
restartRequired: false,
|
|
2970
|
+
default: DEFAULT_CONFIG.watchdog.queuedMessageRecoverMs,
|
|
2971
|
+
min: 60000,
|
|
2972
|
+
step: 60000,
|
|
2973
|
+
description: "Minutes a queued engineer message may wait before RepoOS recovers delivery: it ends a live silent turn or restarts a missing engineer in the same worktree. Held, paused and human-assigned tasks are skipped. Default 3 minutes.",
|
|
2974
|
+
},
|
|
2949
2975
|
{
|
|
2950
2976
|
key: "watchdog.engineerCrashFailoverThreshold",
|
|
2951
2977
|
label: "Engineer crashes before failover",
|
|
@@ -3349,6 +3375,18 @@ export function getConfigSchema() {
|
|
|
3349
3375
|
"large diff on a slow model. A pass cut off by this limit is reported as a timeout, retried once " +
|
|
3350
3376
|
"automatically, and only then flagged for a human.",
|
|
3351
3377
|
},
|
|
3378
|
+
{
|
|
3379
|
+
key: "review.failedReportRetries",
|
|
3380
|
+
label: "Retry failed reviews",
|
|
3381
|
+
type: "number",
|
|
3382
|
+
tier: "live",
|
|
3383
|
+
restartRequired: false,
|
|
3384
|
+
default: DEFAULT_CONFIG.review.failedReportRetries,
|
|
3385
|
+
min: 0,
|
|
3386
|
+
max: 5,
|
|
3387
|
+
step: 1,
|
|
3388
|
+
description: "Automatic retries when the reviewer exits without a usable report. After the limit, the task needs human input. Default 2.",
|
|
3389
|
+
},
|
|
3352
3390
|
{
|
|
3353
3391
|
key: "maxConcurrentAgents",
|
|
3354
3392
|
label: "Maximum concurrent agent processes",
|
|
@@ -4345,6 +4383,7 @@ export const SUPPORTED_TOML_KEYS = [
|
|
|
4345
4383
|
"watchdog.autoTransition",
|
|
4346
4384
|
"watchdog.phantomDetectMs",
|
|
4347
4385
|
"watchdog.activeWithoutEngineerRecoverMs",
|
|
4386
|
+
"watchdog.queuedMessageRecoverMs",
|
|
4348
4387
|
"watchdog.engineerCrashFailoverThreshold",
|
|
4349
4388
|
"watchdog.autoPauseOnUsageLimit",
|
|
4350
4389
|
"watchdog.engineerCrashFailoverWindowMs",
|
|
@@ -4564,6 +4603,7 @@ export const SUPPORTED_TOML_KEYS = [
|
|
|
4564
4603
|
"review.humanFlagAfterPasses",
|
|
4565
4604
|
"review.freezeAfterPasses",
|
|
4566
4605
|
"review.timeoutMinutes",
|
|
4606
|
+
"review.failedReportRetries",
|
|
4567
4607
|
// Remote validation
|
|
4568
4608
|
"remoteValidation.enabled",
|
|
4569
4609
|
"remoteValidation.provider",
|
|
@@ -182,6 +182,7 @@ function detectDarwinSupervisor(pid, execFile) {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
let listed = parseLaunchctlListForPid(listOut, pid);
|
|
185
|
+
let domainLookupFailed = false;
|
|
185
186
|
if (!listed) {
|
|
186
187
|
// A non-root `launchctl list` only shows the caller's own domain, so a
|
|
187
188
|
// LaunchDaemon in the `system` domain (the Kamrai case) never appears.
|
|
@@ -202,6 +203,7 @@ function detectDarwinSupervisor(pid, execFile) {
|
|
|
202
203
|
}
|
|
203
204
|
catch {
|
|
204
205
|
/* domain not printable by this user — try the next one */
|
|
206
|
+
domainLookupFailed = true;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
}
|
|
@@ -226,12 +228,14 @@ function detectDarwinSupervisor(pid, execFile) {
|
|
|
226
228
|
// nonexistent one, so a "print succeeded" check proves nothing.
|
|
227
229
|
const ppid = readPpid(pid, execFile);
|
|
228
230
|
if (ppid === 1) {
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
+
// Detached hand-started processes (for example `nohup repoos serve`) are
|
|
232
|
+
// reparented to pid 1 too. If launchctl list and the accessible service
|
|
233
|
+
// domains had no row, pid 1 alone is not evidence of supervision.
|
|
234
|
+
if (!domainLookupFailed)
|
|
235
|
+
return { kind: "none" };
|
|
231
236
|
return {
|
|
232
237
|
kind: "uncertain",
|
|
233
|
-
reason: `pid ${pid} has no row in \`launchctl list
|
|
234
|
-
`it may be an externally supervised server, but its launchd label could not be determined`,
|
|
238
|
+
reason: `pid ${pid} has no row in \`launchctl list\`; launchd domain lookup was incomplete and its parent is pid 1 — ownership is unknown`,
|
|
235
239
|
};
|
|
236
240
|
}
|
|
237
241
|
if (ppid !== null && ppid > 1) {
|
|
@@ -165,6 +165,20 @@ describe("detectSupervisor", () => {
|
|
|
165
165
|
const r = detectSupervisor(48210, execFile);
|
|
166
166
|
expect(r.kind).toBe("uncertain");
|
|
167
167
|
});
|
|
168
|
+
it("treats a pid-1-parented nohup server as hand-run after launchd domains were checked", () => {
|
|
169
|
+
const execFile = vi.fn().mockImplementation((cmd, args) => {
|
|
170
|
+
if (cmd === "launchctl" && args[0] === "list")
|
|
171
|
+
return "PID\tStatus\tLabel\n";
|
|
172
|
+
if (cmd === "launchctl" && args[0] === "print")
|
|
173
|
+
return "services = {}\n";
|
|
174
|
+
if (cmd === "ps" && args.includes("uid="))
|
|
175
|
+
return "501\n";
|
|
176
|
+
if (cmd === "ps" && args.includes("ppid="))
|
|
177
|
+
return "1\n";
|
|
178
|
+
throw new Error("unexpected");
|
|
179
|
+
});
|
|
180
|
+
expect(detectSupervisor(48210, execFile)).toEqual({ kind: "none" });
|
|
181
|
+
});
|
|
168
182
|
it("is uncertain (not hand-run) when the pid's parent cannot be read", () => {
|
|
169
183
|
// If `launchctl list` has no row AND we cannot read the parent, we cannot
|
|
170
184
|
// rule out a supervisor, so refuse rather than classify as hand-run and
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1916,6 +1916,8 @@ export interface ScheduledTasksConfig {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
/** Task watchdog configuration (#0180). */
|
|
1918
1918
|
export interface WatchdogConfig {
|
|
1919
|
+
/** Queued engineer message age before silent-turn recovery. Default 3 minutes. */
|
|
1920
|
+
queuedMessageRecoverMs?: number;
|
|
1919
1921
|
/** Whether the watchdog runs. Default true. */
|
|
1920
1922
|
enabled?: boolean;
|
|
1921
1923
|
/**
|
|
@@ -1996,6 +1998,8 @@ export interface ReviewVerificationConfig {
|
|
|
1996
1998
|
* from the auto-bounce `review-rounds-exhausted` backstop.
|
|
1997
1999
|
*/
|
|
1998
2000
|
export interface ReviewConfig {
|
|
2001
|
+
/** Automatic retries after a reviewer exits without a usable report. Default 2. */
|
|
2002
|
+
failedReportRetries?: number;
|
|
1999
2003
|
/** Completed passes before the repeated-class summary and human flag. Default 5. */
|
|
2000
2004
|
humanFlagAfterPasses?: number;
|
|
2001
2005
|
/**
|
|
@@ -85,10 +85,18 @@ export async function recoverActiveTasksWithoutEngineer(deps, opts = {}) {
|
|
|
85
85
|
const task = parseFresh(config, indexed);
|
|
86
86
|
const signal = readEngineerCleanExitSignal(task.body);
|
|
87
87
|
const idleMs = now - lastActivityAfterActive(task.body);
|
|
88
|
+
const queuedMessageAgeMs = runner.oldestQueuedMessageAgeMs?.(task.id) ?? null;
|
|
89
|
+
const queuedMessageThresholdMs = opts.queuedMessageRecoverMs;
|
|
90
|
+
const overdueQueuedMessage = queuedMessageAgeMs !== null &&
|
|
91
|
+
queuedMessageThresholdMs !== undefined &&
|
|
92
|
+
queuedMessageAgeMs >= queuedMessageThresholdMs;
|
|
93
|
+
const recoveryWindowMs = overdueQueuedMessage
|
|
94
|
+
? Math.min(windowMs, queuedMessageThresholdMs)
|
|
95
|
+
: windowMs;
|
|
88
96
|
const plan = planActiveWithoutEngineerRecovery({
|
|
89
97
|
task,
|
|
90
98
|
now,
|
|
91
|
-
windowMs,
|
|
99
|
+
windowMs: recoveryWindowMs,
|
|
92
100
|
running: runner.isRunning(task.id),
|
|
93
101
|
queued: typeof runner.isQueued === "function" ? runner.isQueued(task.id) : false,
|
|
94
102
|
handoffInFlight: runner.isHandoffInFlight(task.id),
|
|
@@ -98,7 +106,7 @@ export async function recoverActiveTasksWithoutEngineer(deps, opts = {}) {
|
|
|
98
106
|
humanAssigned,
|
|
99
107
|
closingOut: isTaskClosingOut(config.root, config.cacheDir, task.id),
|
|
100
108
|
stoppedByPerson: signal.stoppedByPerson,
|
|
101
|
-
idleMs,
|
|
109
|
+
idleMs: overdueQueuedMessage ? Math.max(idleMs, queuedMessageAgeMs ?? 0) : idleMs,
|
|
102
110
|
});
|
|
103
111
|
if (plan.action === "skip")
|
|
104
112
|
continue;
|
|
@@ -107,7 +115,8 @@ export async function recoverActiveTasksWithoutEngineer(deps, opts = {}) {
|
|
|
107
115
|
if (handoffLoop.lastFailureIsCheck && handoffLoop.branchUnchanged) {
|
|
108
116
|
continue;
|
|
109
117
|
}
|
|
110
|
-
if (task.branch &&
|
|
118
|
+
if (task.branch &&
|
|
119
|
+
(await hasRecentWorktreeActivity(config.root, task.branch, recoveryWindowMs, now))) {
|
|
111
120
|
continue;
|
|
112
121
|
}
|
|
113
122
|
const agent = resolveAgentForTask(config, task);
|
|
@@ -118,7 +127,9 @@ export async function recoverActiveTasksWithoutEngineer(deps, opts = {}) {
|
|
|
118
127
|
task.needsInput = false;
|
|
119
128
|
task.needsInputReason = undefined;
|
|
120
129
|
task.needsInputDetail = undefined;
|
|
121
|
-
writeTask(config, task,
|
|
130
|
+
writeTask(config, task, overdueQueuedMessage
|
|
131
|
+
? `watchdog: restarting engineer because a queued message waited ${Math.max(1, Math.round(queuedMessageAgeMs / 60_000))}m with no live process`
|
|
132
|
+
: `watchdog: restarting engineer after ${Math.round(idleMs / 60_000)}m with no live process`);
|
|
122
133
|
index.applyFileChange(task.absPath, { guarded: true });
|
|
123
134
|
const result = await launch({ config, index, runner, logger }, task, RECOVERY_INSTRUCTION, { fromCrashRecovery: true });
|
|
124
135
|
if (result.ok) {
|
package/dist/server/agents.d.ts
CHANGED
|
@@ -1782,7 +1782,7 @@ export declare class AgentRunner {
|
|
|
1782
1782
|
* Returns true when the turn was ended. All the guards live in
|
|
1783
1783
|
* {@link decideQueuedMessageRecovery}; the caller need not pre-filter.
|
|
1784
1784
|
*/
|
|
1785
|
-
recoverSilentEngineerWithQueuedMessage(taskId: string): Promise<boolean>;
|
|
1785
|
+
recoverSilentEngineerWithQueuedMessage(taskId: string, thresholdMs?: number): Promise<boolean>;
|
|
1786
1786
|
/**
|
|
1787
1787
|
* Flag messages that have sat queued past the timeout (#0821). They are never
|
|
1788
1788
|
* dropped — a queued message is a human's follow-up and silently losing it is
|
package/dist/server/agents.js
CHANGED
|
@@ -6340,7 +6340,7 @@ export class AgentRunner {
|
|
|
6340
6340
|
* Returns true when the turn was ended. All the guards live in
|
|
6341
6341
|
* {@link decideQueuedMessageRecovery}; the caller need not pre-filter.
|
|
6342
6342
|
*/
|
|
6343
|
-
async recoverSilentEngineerWithQueuedMessage(taskId) {
|
|
6343
|
+
async recoverSilentEngineerWithQueuedMessage(taskId, thresholdMs) {
|
|
6344
6344
|
const entry = this.entries.get(taskId);
|
|
6345
6345
|
if (!entry)
|
|
6346
6346
|
return false;
|
|
@@ -6356,6 +6356,7 @@ export class AgentRunner {
|
|
|
6356
6356
|
paused: this.isPaused(taskId),
|
|
6357
6357
|
handoffInFlight: entry.handoffRequested || this.handoffsInFlight.has(taskId),
|
|
6358
6358
|
alreadyRecovering: entry.interruptedForQueuedMessage === true,
|
|
6359
|
+
thresholdMs,
|
|
6359
6360
|
});
|
|
6360
6361
|
if (!decision.recover)
|
|
6361
6362
|
return false;
|
package/dist/server/review.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export type ReviewRunOptions = {
|
|
|
59
59
|
manual?: boolean;
|
|
60
60
|
trigger?: ReviewRunTrigger;
|
|
61
61
|
};
|
|
62
|
+
/** Automatic no-report retries must leave deliberately human-owned tasks alone. */
|
|
63
|
+
export declare function canAutoRecoverFailedReview(task: Task, paused: boolean): boolean;
|
|
62
64
|
/** Review failed only because handoff evidence is stale (#0766). */
|
|
63
65
|
export declare function isStaleEvidenceOnlyReview(report: string, verdict: string | null): boolean;
|
|
64
66
|
/** Automatic evidence recovery requires an explicit stale-only reviewer marker (#0839: on by default). */
|
|
@@ -88,6 +90,10 @@ export declare function classifyReviewRunFailure(timedOut: boolean, hasOutput: b
|
|
|
88
90
|
export declare function reviewTimeoutRetryAttempts(task: Pick<Task, "extra">): number;
|
|
89
91
|
/** At most one automatic retry per timeout episode (#1019). */
|
|
90
92
|
export declare function reviewTimeoutRetryAllowed(task: Pick<Task, "extra">): boolean;
|
|
93
|
+
/** Failed-report retries already spent on this task, independent of timeouts. */
|
|
94
|
+
export declare function reviewFailedReportRetryAttempts(task: Pick<Task, "extra">): number;
|
|
95
|
+
/** Whether another no-usable-report retry fits the configured bound. */
|
|
96
|
+
export declare function reviewFailedReportRetryAllowed(task: Pick<Task, "extra">, maxRetries?: number): boolean;
|
|
91
97
|
/**
|
|
92
98
|
* Prefix on the SSE event id used for a task's reviewer conversation. The
|
|
93
99
|
* engineer session streams under the plain task id; reviewer output streams
|
|
@@ -208,6 +214,8 @@ export declare class ReviewManager {
|
|
|
208
214
|
* has observed the write, so one timeout can never become a retry loop.
|
|
209
215
|
*/
|
|
210
216
|
private readonly timeoutRetries;
|
|
217
|
+
/** No-usable-report retries have their own persisted budget (#1108 review). */
|
|
218
|
+
private readonly failedReportRetries;
|
|
211
219
|
/** Tasks the status guard just put back in `review`, by timestamp. */
|
|
212
220
|
private readonly reverted;
|
|
213
221
|
/** AgentRunner to send auto-bounce messages to the engineer session. */
|
|
@@ -480,6 +488,9 @@ export declare class ReviewManager {
|
|
|
480
488
|
private write;
|
|
481
489
|
/** Retries spent on this task, preferring the in-process guard (#1019). */
|
|
482
490
|
private timeoutRetryAttempts;
|
|
491
|
+
private failedReportRetryAttempts;
|
|
492
|
+
/** Automatic reviewer recovery is inert for tasks deliberately owned by a human. */
|
|
493
|
+
private isAutoRecoveryExcluded;
|
|
483
494
|
private canRetryTimedOutReview;
|
|
484
495
|
/**
|
|
485
496
|
* One automatic retry after a hard review timeout (#1019). The counter is
|
|
@@ -490,6 +501,9 @@ export declare class ReviewManager {
|
|
|
490
501
|
private scheduleTimeoutRetry;
|
|
491
502
|
/** Clear the timeout-retry counter once a pass actually produced a report. */
|
|
492
503
|
private resetReviewTimeoutRetries;
|
|
504
|
+
private resetFailedReportRetries;
|
|
505
|
+
/** Best-effort durable no-usable-report retry counter, distinct from timeout retries. */
|
|
506
|
+
private persistFailedReportRetries;
|
|
493
507
|
/** Best-effort durable timeout-retry counter (task frontmatter). */
|
|
494
508
|
private persistReviewTimeoutRetries;
|
|
495
509
|
/** Auto-retry once when the reviewer exits without a verdict (#0680). */
|
package/dist/server/review.js
CHANGED
|
@@ -60,7 +60,16 @@ import { loadEngineeringReports } from "./engineering-reports.js";
|
|
|
60
60
|
import { isOwnReportPath } from "../core/report-paths.js";
|
|
61
61
|
import { gatherReviewVerification, gatherReviewVerificationWithoutWorktree, } from "./review-verification-gather.js";
|
|
62
62
|
import { decideReviewAutomation, reviewTriggerNote, REVIEW_RUN_TRIGGERS, } from "./review-automation.js";
|
|
63
|
+
import { isHoldActive } from "../core/task-selection.js";
|
|
63
64
|
import { hasOpenReviewFindings, reviewTreeIdentityForTask, } from "./review-tree-identity.js";
|
|
65
|
+
/** Automatic no-report retries must leave deliberately human-owned tasks alone. */
|
|
66
|
+
export function canAutoRecoverFailedReview(task, paused) {
|
|
67
|
+
return (!task.isArchived &&
|
|
68
|
+
task.assignee !== "human" &&
|
|
69
|
+
task.assignedTo.trim().toLowerCase() !== "human" &&
|
|
70
|
+
!isHoldActive(task) &&
|
|
71
|
+
!paused);
|
|
72
|
+
}
|
|
64
73
|
/** Review failed only because handoff evidence is stale (#0766). */
|
|
65
74
|
export function isStaleEvidenceOnlyReview(report, verdict) {
|
|
66
75
|
const section = reviewVerdictSection(report);
|
|
@@ -116,6 +125,16 @@ export function reviewTimeoutRetryAttempts(task) {
|
|
|
116
125
|
export function reviewTimeoutRetryAllowed(task) {
|
|
117
126
|
return reviewTimeoutRetryAttempts(task) < 1;
|
|
118
127
|
}
|
|
128
|
+
/** Failed-report retries already spent on this task, independent of timeouts. */
|
|
129
|
+
export function reviewFailedReportRetryAttempts(task) {
|
|
130
|
+
const raw = task.extra?.review_failed_report_retries;
|
|
131
|
+
return typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0;
|
|
132
|
+
}
|
|
133
|
+
/** Whether another no-usable-report retry fits the configured bound. */
|
|
134
|
+
export function reviewFailedReportRetryAllowed(task, maxRetries = 2) {
|
|
135
|
+
const limit = Number.isFinite(maxRetries) ? Math.max(0, Math.min(5, Math.floor(maxRetries))) : 2;
|
|
136
|
+
return reviewFailedReportRetryAttempts(task) < limit;
|
|
137
|
+
}
|
|
119
138
|
/** Cap on the task spec quoted into the mission (keeps the prompt bounded). */
|
|
120
139
|
const SPEC_CHARS = 6000;
|
|
121
140
|
/** Cap on the stored report (a runaway agent must not fill the cache dir). */
|
|
@@ -710,6 +729,8 @@ export class ReviewManager {
|
|
|
710
729
|
* has observed the write, so one timeout can never become a retry loop.
|
|
711
730
|
*/
|
|
712
731
|
timeoutRetries = new Map();
|
|
732
|
+
/** No-usable-report retries have their own persisted budget (#1108 review). */
|
|
733
|
+
failedReportRetries = new Map();
|
|
713
734
|
/** Tasks the status guard just put back in `review`, by timestamp. */
|
|
714
735
|
reverted = new Map();
|
|
715
736
|
/** AgentRunner to send auto-bounce messages to the engineer session. */
|
|
@@ -1387,6 +1408,10 @@ export class ReviewManager {
|
|
|
1387
1408
|
const ok = failure === "ok";
|
|
1388
1409
|
const timeoutText = formatReviewTimeout(timeoutMinutes);
|
|
1389
1410
|
const timeoutRetryScheduled = failure === "timeout" && this.canRetryTimedOutReview(task);
|
|
1411
|
+
const failedReportRetryScheduled = failure === "no-output" &&
|
|
1412
|
+
!this.isAutoRecoveryExcluded(task) &&
|
|
1413
|
+
this.failedReportRetryAttempts(task) <
|
|
1414
|
+
Math.max(0, Math.min(5, Math.floor(this.config.review?.failedReportRetries ?? 2)));
|
|
1390
1415
|
const error = failure === "timeout"
|
|
1391
1416
|
? `the ${agent.cli} agent timed out after ${timeoutText}`
|
|
1392
1417
|
: failure === "no-output"
|
|
@@ -1430,7 +1455,7 @@ export class ReviewManager {
|
|
|
1430
1455
|
const body = !hasReport
|
|
1431
1456
|
? failure === "timeout"
|
|
1432
1457
|
? `Review timed out after ${timeoutText} before it produced a report.${timeoutRetryNote}`
|
|
1433
|
-
: `The review agent produced no report: ${error ?? "no report"}`
|
|
1458
|
+
: `The review agent produced no report: ${error ?? "no report"}${failedReportRetryScheduled ? " An automatic retry will start shortly." : " Automatic retries are exhausted; human input is needed."}`
|
|
1434
1459
|
: reportText;
|
|
1435
1460
|
const treeIdentity = await reviewTreeIdentityForTask(this.config, task);
|
|
1436
1461
|
const report = {
|
|
@@ -1458,6 +1483,7 @@ export class ReviewManager {
|
|
|
1458
1483
|
this.appendMarker(task.id, marker);
|
|
1459
1484
|
if (state === "ok" || state === "incomplete") {
|
|
1460
1485
|
this.resetReviewTimeoutRetries(task);
|
|
1486
|
+
this.resetFailedReportRetries(task);
|
|
1461
1487
|
}
|
|
1462
1488
|
if (state === "ok") {
|
|
1463
1489
|
this.logger.task(task.id, "info", "review completed");
|
|
@@ -1472,6 +1498,22 @@ export class ReviewManager {
|
|
|
1472
1498
|
});
|
|
1473
1499
|
this.scheduleTimeoutRetry(task, timeoutMinutes);
|
|
1474
1500
|
}
|
|
1501
|
+
else if (failure === "no-output" && failedReportRetryScheduled) {
|
|
1502
|
+
const attempts = this.failedReportRetryAttempts(task) + 1;
|
|
1503
|
+
this.failedReportRetries.set(task.id, attempts);
|
|
1504
|
+
this.persistFailedReportRetries(task, attempts);
|
|
1505
|
+
this.appendMarker(task.id, `↻ automatically retrying review — previous pass produced no usable report (attempt ${attempts} of ${this.config.review?.failedReportRetries ?? 2})`);
|
|
1506
|
+
const timer = setTimeout(() => {
|
|
1507
|
+
const current = this.index?.getTask(task.id) ?? task;
|
|
1508
|
+
if (!current ||
|
|
1509
|
+
current.status !== "review" ||
|
|
1510
|
+
this.isAutoRecoveryExcluded(current) ||
|
|
1511
|
+
current.needsInput)
|
|
1512
|
+
return;
|
|
1513
|
+
void this.run(current, { trigger: REVIEW_RUN_TRIGGERS.WATCHDOG_STUCK_REVIEW });
|
|
1514
|
+
}, 4_000);
|
|
1515
|
+
timer.unref?.();
|
|
1516
|
+
}
|
|
1475
1517
|
else if (failure === "timeout") {
|
|
1476
1518
|
this.logger.task(task.id, "error", "review timed out after its automatic retry", {
|
|
1477
1519
|
timeoutMinutes,
|
|
@@ -1494,7 +1536,11 @@ export class ReviewManager {
|
|
|
1494
1536
|
// auto-bounce on and nothing for the engineer to act on, so bouncing would
|
|
1495
1537
|
// just burn a round on silence. Escalate straight to a human, same as the
|
|
1496
1538
|
// relevance-flag escalation below.
|
|
1497
|
-
if (state === "failed" &&
|
|
1539
|
+
if (state === "failed" &&
|
|
1540
|
+
!timeoutRetryScheduled &&
|
|
1541
|
+
!failedReportRetryScheduled &&
|
|
1542
|
+
!this.isAutoRecoveryExcluded(task) &&
|
|
1543
|
+
!task.needsInput) {
|
|
1498
1544
|
try {
|
|
1499
1545
|
patchTaskFile(this.config, task.absPath, {
|
|
1500
1546
|
needsInput: true,
|
|
@@ -2421,6 +2467,14 @@ export class ReviewManager {
|
|
|
2421
2467
|
const inMemory = this.timeoutRetries.get(task.id);
|
|
2422
2468
|
return inMemory !== undefined ? inMemory : reviewTimeoutRetryAttempts(task);
|
|
2423
2469
|
}
|
|
2470
|
+
failedReportRetryAttempts(task) {
|
|
2471
|
+
const inMemory = this.failedReportRetries.get(task.id);
|
|
2472
|
+
return inMemory !== undefined ? inMemory : reviewFailedReportRetryAttempts(task);
|
|
2473
|
+
}
|
|
2474
|
+
/** Automatic reviewer recovery is inert for tasks deliberately owned by a human. */
|
|
2475
|
+
isAutoRecoveryExcluded(task) {
|
|
2476
|
+
return !canAutoRecoverFailedReview(task, this.runner?.isPaused(task.id) === true);
|
|
2477
|
+
}
|
|
2424
2478
|
canRetryTimedOutReview(task) {
|
|
2425
2479
|
return this.timeoutRetryAttempts(task) < 1;
|
|
2426
2480
|
}
|
|
@@ -2451,6 +2505,28 @@ export class ReviewManager {
|
|
|
2451
2505
|
if (attempts > 0)
|
|
2452
2506
|
this.persistReviewTimeoutRetries(task, 0);
|
|
2453
2507
|
}
|
|
2508
|
+
resetFailedReportRetries(task) {
|
|
2509
|
+
const attempts = this.failedReportRetryAttempts(task);
|
|
2510
|
+
this.failedReportRetries.set(task.id, 0);
|
|
2511
|
+
if (attempts > 0)
|
|
2512
|
+
this.persistFailedReportRetries(task, 0);
|
|
2513
|
+
}
|
|
2514
|
+
/** Best-effort durable no-usable-report retry counter, distinct from timeout retries. */
|
|
2515
|
+
persistFailedReportRetries(task, retries) {
|
|
2516
|
+
try {
|
|
2517
|
+
const raw = readFileSync(task.absPath, "utf8");
|
|
2518
|
+
const doc = parseDocument(raw);
|
|
2519
|
+
doc.data.review_failed_report_retries = retries;
|
|
2520
|
+
doc.data.updated_at = utcTimestamp();
|
|
2521
|
+
const keys = Object.keys(doc.data).filter((k) => k !== "review_failed_report_retries" && k !== "updated_at");
|
|
2522
|
+
keys.unshift("updated_at", "review_failed_report_retries");
|
|
2523
|
+
writeFileSync(task.absPath, serializeDocument(doc.data, `\n${doc.body}\n`, keys));
|
|
2524
|
+
commitTaskFile(this.config.root, task.absPath, `docs(${task.id}): ${retries ? "failed review retry" : "reset failed review retry"}`);
|
|
2525
|
+
}
|
|
2526
|
+
catch {
|
|
2527
|
+
/* best-effort — the in-memory guard still bounds the retries */
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2454
2530
|
/** Best-effort durable timeout-retry counter (task frontmatter). */
|
|
2455
2531
|
persistReviewTimeoutRetries(task, retries) {
|
|
2456
2532
|
try {
|
|
@@ -443,7 +443,10 @@ export class TaskWatchdog {
|
|
|
443
443
|
runner: this.runner,
|
|
444
444
|
logger: (this.logger ?? { task: () => { } }),
|
|
445
445
|
launch: this.launch,
|
|
446
|
-
}, {
|
|
446
|
+
}, {
|
|
447
|
+
now: stalenessNow,
|
|
448
|
+
queuedMessageRecoverMs: this.config.watchdog?.queuedMessageRecoverMs,
|
|
449
|
+
});
|
|
447
450
|
// The `active` status is scanned for the dead/stalled ENGINEER shape
|
|
448
451
|
// (#0180). The `review` status is scanned too (#0286): a task whose
|
|
449
452
|
// REVIEWER session died silently sits in `review` forever with no report
|
|
@@ -485,14 +488,14 @@ export class TaskWatchdog {
|
|
|
485
488
|
for (const task of this.index.getTasks("active")) {
|
|
486
489
|
if (task.isArchived || task.needsInput || isHoldActive(task))
|
|
487
490
|
continue;
|
|
488
|
-
if (task.assignee === "human")
|
|
491
|
+
if (task.assignee === "human" || task.assignedTo.trim().toLowerCase() === "human")
|
|
489
492
|
continue;
|
|
490
493
|
if (typeof this.runner.hasQueuedMessages === "function" &&
|
|
491
494
|
!this.runner.hasQueuedMessages(task.id)) {
|
|
492
495
|
continue;
|
|
493
496
|
}
|
|
494
497
|
try {
|
|
495
|
-
await this.runner.recoverSilentEngineerWithQueuedMessage(task.id);
|
|
498
|
+
await this.runner.recoverSilentEngineerWithQueuedMessage(task.id, this.config.watchdog?.queuedMessageRecoverMs);
|
|
496
499
|
}
|
|
497
500
|
catch (error) {
|
|
498
501
|
console.error(`[repoos] watchdog: queued-message recovery failed for #${task.id}: ${error.message}`);
|
|
@@ -8,6 +8,11 @@ import { type CommandCaptureEvidence, type ShotCaptureResult } from "./shot-capt
|
|
|
8
8
|
import type { PreviewManager } from "./preview.js";
|
|
9
9
|
import { type BrowserEvidenceArtifacts, type BrowserEvidenceTransport } from "./browser-capture-policy.js";
|
|
10
10
|
import { type CanonicalCapturePlan } from "../core/remote-capture.js";
|
|
11
|
+
/** Capture at a shot's requested viewport; configured widths remain overflow checks. */
|
|
12
|
+
export declare function uiHandoffCaptureViewport(entry: Pick<CaptureEntry, "viewportWidth" | "viewportHeight">, verificationWidths: number[]): {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
11
16
|
/** Per-capture evidence (#0734): exact URL, assertions, and the stored PNG. */
|
|
12
17
|
export interface UiHandoffGateCapture {
|
|
13
18
|
target: string;
|
|
@@ -34,6 +34,13 @@ import { canonicalCaptureContext } from "../core/remote-capture.js";
|
|
|
34
34
|
const INSTALL_ADVICE = "Install: bun add -d @playwright/test && bunx playwright install webkit";
|
|
35
35
|
const AUTO_SETTLE_MS = 900;
|
|
36
36
|
const PREVIEW_DISCONNECT_RE = /could not connect|ECONNREFUSED|net::ERR_CONNECTION|Connection refused/i;
|
|
37
|
+
/** Capture at a shot's requested viewport; configured widths remain overflow checks. */
|
|
38
|
+
export function uiHandoffCaptureViewport(entry, verificationWidths) {
|
|
39
|
+
return {
|
|
40
|
+
width: entry.viewportWidth ?? verificationWidths[0] ?? 1024,
|
|
41
|
+
height: entry.viewportHeight ?? 800,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
37
44
|
function isPreviewDisconnectError(err) {
|
|
38
45
|
return PREVIEW_DISCONNECT_RE.test(err.message ?? "");
|
|
39
46
|
}
|
|
@@ -322,7 +329,7 @@ async function captureEntryWithGate(context, pageUrl, entry, viewports) {
|
|
|
322
329
|
collector.attach(page);
|
|
323
330
|
const issues = [];
|
|
324
331
|
try {
|
|
325
|
-
await page.setViewportSize(
|
|
332
|
+
await page.setViewportSize(uiHandoffCaptureViewport(entry, viewports));
|
|
326
333
|
const png = await captureShotPage(page, pageUrl, entry, { waitMs: AUTO_SETTLE_MS, fullPage: false }, {
|
|
327
334
|
onHighlightMiss: (selector, route) => {
|
|
328
335
|
warnings.push(`highlight ${selector} matched nothing on ${route}`);
|