From 65dee9e1af3bae64c371ae209ef8d995ad734af1 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 26 Jun 2026 15:45:13 +0000 Subject: [PATCH] fix(web-probe): keep nonblocking canaries nonblocking --- scripts/src/hwlab-node-web-sentinel-cicd.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/src/hwlab-node-web-sentinel-cicd.ts b/scripts/src/hwlab-node-web-sentinel-cicd.ts index b10a83a4..3bc5fd92 100644 --- a/scripts/src/hwlab-node-web-sentinel-cicd.ts +++ b/scripts/src/hwlab-node-web-sentinel-cicd.ts @@ -1870,6 +1870,7 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou } let promptIndex = 0; const sessionInvarianceChecks = sessionInvarianceChecksByRound(scenario); + const nonBlockingCanaryWarnings: string[] = []; for (const item of commandSequence) { const type = stringAt(item, "type"); const repeat = Math.max(1, typeof item.repeat === "number" && Number.isFinite(item.repeat) ? Math.trunc(item.repeat) : 1); @@ -1938,6 +1939,7 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou })); } const invariantResult = runQuickVerifySessionInvarianceChecks(state, observerId, sessionInvarianceChecks.get(promptIndex) ?? [], deadline, promptIndex, steps); + nonBlockingCanaryWarnings.push(...mergeWarnings(record(invariantResult).warnings)); if (invariantResult.ok !== true) { return recordQuickVerify(state, finalizeQuickVerifyFailure(state, { runId, @@ -1949,7 +1951,7 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou failure: text(invariantResult.failure ?? "observe-session-invariance-check-failed"), promptSource: prompts.summary, elapsedMs: elapsedMs(), - warnings: elapsedWarnings(), + warnings: mergeWarnings(nonBlockingCanaryWarnings, elapsedWarnings()), })); } } @@ -1994,7 +1996,7 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou findings, screenshot: record(artifactSummary).screenshot, publicOrigin: stringAt(state.publicExposure, "publicBaseUrl"), - warnings: mergeWarnings(analysisWarnings, elapsedWarnings()), + warnings: mergeWarnings(analysisWarnings, nonBlockingCanaryWarnings, elapsedWarnings()), valuesRedacted: true, }); } @@ -2020,8 +2022,10 @@ function runQuickVerifySessionInvarianceChecks( promptIndex: number, steps: Record[], ): Record { + const warnings: string[] = []; for (const check of checks) { const checkId = nonEmptyString(check.id) ?? `after-round-${promptIndex}`; + const blocking = check.blocking === true; const commands: { readonly type: string; readonly enabled: boolean }[] = [ { type: "refreshCurrentSession", enabled: check.refreshCurrent === true }, { type: "switchAwayAndBack", enabled: check.switchAwayAndBack === true }, @@ -2051,11 +2055,15 @@ function runQuickVerifySessionInvarianceChecks( const result = runChildCli(args, remainingSeconds(deadline, 60)); steps.push({ phase: `observe-session-invariance-${command.type}`, ok: result.ok, promptIndex, checkId, result: result.result }); if (!result.ok) { + if (!blocking) { + warnings.push(`non-blocking session invariance canary ${checkId}/${command.type} failed after round ${promptIndex}; continuing Code Agent multi-round quick verify because scenario marks this check blocking=false.`); + continue; + } return { ok: false, failure: `observe-session-invariance-${command.type}-failed`, checkId, promptIndex, valuesRedacted: true }; } } } - return { ok: true, promptIndex, checkCount: checks.length, valuesRedacted: true }; + return { ok: true, promptIndex, checkCount: checks.length, warnings, valuesRedacted: true }; } function finalizeQuickVerifyFailure(state: SentinelCicdState, input: {