fix(sdk): state backend hardening — retry, circuit-breaker, startup verification - #907
Closed
diberry wants to merge 1 commit into
Closed
fix(sdk): state backend hardening — retry, circuit-breaker, startup verification#907diberry wants to merge 1 commit into
diberry wants to merge 1 commit into
Conversation
Contributor
🟡 Impact Analysis — PR #907Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-sdk (2 files)
tests (1 file)
|
Contributor
🏗️ Architectural Review
Automated architectural review — informational only. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the SDK’s git-based state backends by adding retry/backoff and a circuit-breaker, surfacing previously swallowed config/initialization errors, and introducing a read-only startup verification helper.
Changes:
- Add retry helpers (exponential backoff) and a
CircuitBreakerapplied to git-backed backend operations. - Make
resolveStateBackend()warn on config read failures and fail-fast for explicit backend selections that can’t initialize. - Export new APIs (
CircuitBreaker,verifyStateBackend) and add/extend tests + changeset.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
packages/squad-sdk/src/state-backend.ts |
Implements retry/backoff, circuit breaker, config warning/fail-fast behavior, and verifyStateBackend(); migrates write paths to execFileSync. |
packages/squad-sdk/src/index.ts |
Exports CircuitBreaker and verifyStateBackend from the SDK barrel. |
test/state-backend.test.ts |
Adds tests for warnings, circuit breaker behavior, and backend verification. |
.changeset/state-backend-hardening.md |
Adds a patch changeset documenting the hardening work. |
diberry
force-pushed
the
squad/864-state-backend-hardening
branch
2 times, most recently
from
April 8, 2026 14:22
17243f4 to
ed2f163
Compare
diberry
force-pushed
the
squad/864-state-backend-hardening
branch
from
April 8, 2026 15:54
ed2f163 to
1f3f7e0
Compare
Contributor
Author
🔍 Squad Review — Kaylee (Engineering)
Verdict: ✅ Ready to merge Review by Squad AI team (Kaylee — Engineering) · requested by Dina Berry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add retry with exponential backoff, circuit-breaker pattern, and startup verification to state backends.
Why
State backends silently swallow git errors (resolveStateBackend catches and ignores, external backend falls back silently). This causes silent data loss and makes debugging impossible.
How
verifyStateBackend()validates backend accessibilityCloses #864
Related: #895 (Phase 1, items #4, #5)