test: pin that inspection errors do not accelerate the relaxed cadence

The 10s error-backoff ceiling would undercut the 15s no-evidence tier
(erroring scans polling more often than healthy ones); the Math.max cap
prevents that but had no regression guard.

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
brennanb2025
2026-07-08 12:43:24 -07:00
co-authored by Orca
parent 05acf7dee2
commit 07128340b1
@@ -138,6 +138,20 @@ describe('agent completion no-evidence inspection cadence', () => {
expect(inspectProcess).toHaveBeenCalledTimes(8)
})
it('does not accelerate the relaxed cadence when inspections keep erroring', async () => {
const inspectProcess = vi.fn(async () => {
throw new Error('scan failed')
})
const { coordinator } = createCoordinator(inspectProcess)
coordinator.startProcessTracking()
await vi.advanceTimersByTimeAsync(60_000)
// The error backoff ceiling (10s) must not undercut the 15s tier: erroring
// scans would otherwise poll MORE often than healthy ones (15s → 10s).
expect(inspectProcess).toHaveBeenCalledTimes(4)
})
it('keeps a recognized agent on the full active cadence on a costly host', async () => {
const inspectProcess = vi.fn(async () => processResult('codex'))
const { coordinator } = createCoordinator(inspectProcess)