{{ message }}
feat: Add circuit breaker for file sync failures - #364
Merged
Conversation
Implements a circuit breaker pattern to prevent infinite retry loops when files consistently fail to sync. After 3 consecutive failures, files are skipped until they're modified. Changes: - Add circuit breaker in sync_service.py with MAX_CONSECUTIVE_FAILURES = 3 - Track file failures with checksums to detect when files change - Add SkippedFile dataclass to report skipped files with failure details - Update SyncReportResponse schema to include skipped_files field - Display skipped files in CLI status command (summary + verbose modes) - Add comprehensive tests for all circuit breaker scenarios The circuit breaker: - Tracks failures per file with SHA-256 checksums - Resets automatically when file content changes - Clears failure tracking on successful sync - Prevents blocking sync operations on problematic files - Logs warnings for skipped files Fixes #189 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
Contributor
This was referenced Oct 16, 2025
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.

Summary
Implements a circuit breaker pattern to prevent infinite retry loops when files consistently fail to sync. After 3 consecutive failures, files are automatically skipped until they're modified.
Changes
Core Implementation
MAX_CONSECUTIVE_FAILURES = 3thresholdFileFailureInfodataclass tracks failure count, timestamp, error, and checksumSchema Updates
path: File path relative to project rootreason: Error message from last failurefailure_count: Number of consecutive failuresfirst_failed: Timestamp of first failureskipped_filesfieldCLI Enhancement
Testing
test_circuit_breaker_skips_after_three_failurestest_circuit_breaker_resets_on_file_changetest_circuit_breaker_clears_on_successtest_circuit_breaker_tracks_multiple_filestest_circuit_breaker_handles_checksum_computation_failuretextwrap.dedent()for readable test contentDesign Decisions
SyncReport.skipped_filesinstead of creating new status mechanismsTesting
Example Output
Non-verbose mode:
Verbose mode:
Closes #189
🤖 Generated with Claude Code