From 07128340b12c8a93152522d46fccbf9f0eb44c2a Mon Sep 17 00:00:00 2001 From: brennanb2025 Date: Wed, 8 Jul 2026 12:43:24 -0700 Subject: [PATCH] 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 --- .../agent-completion-no-evidence-cadence.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/agent-completion-no-evidence-cadence.test.ts b/src/renderer/src/components/terminal-pane/agent-completion-no-evidence-cadence.test.ts index b9276ac9174..c3ac75d487e 100644 --- a/src/renderer/src/components/terminal-pane/agent-completion-no-evidence-cadence.test.ts +++ b/src/renderer/src/components/terminal-pane/agent-completion-no-evidence-cadence.test.ts @@ -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)