fix(acp): back off before retrying adapter startup - #9012
Conversation
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of The change is small and well-scoped; I've read the retry loop in Design-Verdict: PASS A real spawn race, mitigated in the retry loop that already owns recovery — proportionate, reversible, and contract-preserving (still one retry). Suggestions
[DESIGN-REVIEWED] 76bf952 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/acp/client.py:5532 -- |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. The sole candidate is the widened [OPUS-REVIEWED] 76bf952 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All evidence is gathered. The change is a small, well-grounded fix; my findings are about breadth of the catch and one unfixed sibling. First-Principles-Verdict: CONCERNS The backoff earns its place, but the catch is wider than the "spawn-level What this change shipsIntent: recover adapter startup when a self-update briefly removes or locks the adapter executable — a FIX.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 76bf952 |
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: adapter startup raised OSError (FileNotFoundError) when a self-updating ACP binary was replaced mid-spawn; the single permitted retry now catches OSError and sleeps _ACP_RESPAWN_BACKOFF_S before respawning, plus one covering test. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
Problem / Motivation
An ACP adapter self-update can briefly leave its executable missing or locked while it is replaced in place. The immediate startup retry repeats that race.
Why it matters
A recoverable adapter replacement can be reported as an unusable ACP backend even though waiting briefly permits the next spawn.
What changed
Retry one spawn-level
OSErrorafter a two-second delay. Existing timeout and ACP-error retry timing remains unchanged.Tests
python -m pytest test/test_acp_client.py -n0 -q— 604 passed.What changed (motivation → approach → change)
N/A — covered by the existing
## What changedsection.Manual verification
N/A — focused automated coverage is sufficient.
Related Issues
N/A.
Checklist
Contribution License Agreement
N/A — template placeholder; no CLA wording is supplied.
Pattern harvest
Not generalizable: this is a bounded adapter-startup retry at a specific process-creation boundary.