Skip to content

Commit bba6bf6

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(pi): wait on required checks before optional failures
1 parent 11cb574 commit bba6bf6

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

apps/sim/executor/handlers/pi/babysit-backend.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,17 +401,23 @@ describe('runBabysitPiWithOptions', () => {
401401
expect(runCalls.some(({ command }) => command.includes('CURRENT_DIGEST='))).toBe(false)
402402
})
403403

404-
it('waits for pending checks without consuming an agent round', async () => {
404+
it('waits for pending required checks despite optional failures without consuming a round', async () => {
405405
const pendingCheck = {
406406
...failingCheck,
407407
disposition: 'pending' as const,
408408
status: 'IN_PROGRESS',
409409
conclusion: null,
410410
}
411+
const optionalFailure = {
412+
...failingCheck,
413+
key: 'check:optional-lint',
414+
name: 'optional-lint',
415+
required: false,
416+
}
411417
const pendingChecks = {
412418
...failingChecks,
413-
checks: [pendingCheck],
414-
failing: [],
419+
checks: [pendingCheck, optionalFailure],
420+
failing: [optionalFailure],
415421
pending: [pendingCheck],
416422
blockingFailing: [],
417423
blockingPending: [pendingCheck],

apps/sim/executor/handlers/pi/babysit-backend.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ export async function runBabysitPiWithOptions(
650650
return resultFor(totals, 'startup_failure', progress, threadsClean, false)
651651
}
652652

653-
const needsAgent = latestThreads!.actionable.length > 0 || latestChecks!.failing.length > 0
653+
const needsAgent =
654+
latestThreads!.actionable.length > 0 || latestChecks!.blockingFailing.length > 0
654655
if (!needsAgent) {
655656
const remaining = lifetime - (Date.now() - startedAt)
656657
if (remaining <= options.roundWaitMs + MIN_ROUND_BUDGET_MS) {

0 commit comments

Comments
 (0)