fix(review-swarm): give the lens retry budget a delay that can span a 60s backoff
The retries were never the problem. The delay was.
workflows/review-swarm.yaml sets no errorHandling, which looks like "no retry policy configured". It is not. applyReliabilityDefaults() in the runner injects one whenever the key is absent:
applyReliabilityDefaults(config) {
const existing = config.errorHandling;
if (existing?.strategy === 'fail-fast' || existing?.strategy === 'continue') {
return config; // early return — no defaults
}
...
return { ...config, errorHandling: {
...existing,
strategy: 'retry',
maxRetries, // DEFAULT_WORKFLOW_MAX_RETRIES = 2
retryDelayMs: existing?.retryDelayMs ?? DEFAULT_WORKFLOW_RETRY_DELAY_MS, // = 1000
}};
}
So every lens has always had three attempts, one second apart — and the retry loop applies it literally (await this.delay(retryDelay)).
Why that fails against this platform
flows#256's swarm died with:
[lens-maintainability] mcp-args --register failed (exit 1):
Error: register failed: registration for 'maintainability' was rate-limited;
retry after 60s: Workspace write capacity is busy; retry with backoff
(code: workspace_busy; attempts: 1)
The server asked for 60 seconds. The step spent its entire budget in two, then reported failed after 2 retries — which reads like patience, and was not. flows#245 hit the sibling shape (database_overloaded, "Retry after the interval in the Retry-After header") with the same 1-second budget.
The change
errorHandling:
strategy: retry
retryDelayMs: 60000
Only the delay. maxRetries is deliberately left to the injected default of 2, so this changes how long the swarm waits, never how many times it tries.
Two things worth flagging for the reviewer:
strategy: retryis load-bearing.applyReliabilityDefaultsearly-returns onfail-fastandcontinue, which would strip the injected defaults and drop every lens to zero retries. Writing the seemingly-conservative value here would make the gate strictly worse.- Budget: worst case adds 2 × 60s per lens, against a 30m lens timeout and a 60m swarm timeout. The
swarm 60m < GHA poll 65m < GHA job 75mordering invariant is untouched, and I assertedswarm.timeoutMsis unchanged.
What this does not fix
Honestly: this addresses at most 2 of the 9 failure modes currently blocking this repo (#255 has the full table). workspace_busy and database_overloaded are retryable with a real backoff. The launch-queue deadline (#238) and sandbox-provisioning (#244) failures happen before or outside the step retry loop and are untouched by this. The recurring mount cursor_expired fault is filed separately as AgentWorkforce/relayfile#492.
I am not claiming this unblocks the gate. It removes one specific way the gate lies about having tried.
Incidental
applyReliabilityDefaults contains (existing ? DEFAULT_WORKFLOW_MAX_RETRIES : DEFAULT_WORKFLOW_MAX_RETRIES) — both branches identical. Harmless, but it reads like an intended distinction that got lost. Cloud-side, not changed here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
[!NOTE]
Low Risk
Workflow reliability tuning only; no auth, data, or application logic changes.
Overview
Configures explicit retry backoff for the review swarm so lens steps can honor platform rate limits that ask for ~60s waits.
Adds an errorHandling block to workflows/review-swarm.yaml with strategy: retry and retryDelayMs: 60000, overriding the runner’s implicit 1s inter-attempt delay while leaving maxRetries on the runner default. Inline comments document why omitting errorHandling still meant three quick retries, why strategy: retry is required (other strategies disable injected retries), and that worst-case extra wait (~120s per lens) stays within existing swarm/GHA timeouts.
Reviewed by Cursor Bugbot for commit 39dd21345abadfa21d55f57fdc8a6fe85e06b824. Bugbot is set up for automated code reviews on this repo. Configure here.