[PR 4/7] CLI checkpoint integration#72
Merged
Merged
Conversation
Introduces a unified storage interface with implementations for local filesystem and S3, enabling the same checkpoint logic to work in both local development and AWS production environments. - StorageBackend ABC with read/write/exists/delete/list_keys interface - LocalStorageBackend with atomic writes and path traversal protection - S3StorageBackend with prefix support (optional boto3 dependency) - Comprehensive test suite (28 tests)
The *local* gitignore pattern was preventing local.py from being committed.
a179efb to
aefd666
Compare
Implements two-level checkpointing system: - BatchProgressManager: tracks task status across the batch (pending, in_progress, completed, failed) with worker assignment and stale task recovery - TaskCheckpointManager: tracks within-task progress (attempts per test pair) for resume capability after interruption Key features: - Persists to JSON files via storage abstraction - Schema versioning for future compatibility - Decimal-based cost tracking (not float) - retry_failed_tasks() to reset failed tasks for retry - Comprehensive tests (32 tests) including edge cases Includes demo script (scripts/demo_checkpoint.py) demonstrating checkpointing with simulated task failures and retries.
Bug fixes: - Fix race condition in claim_next_task() with retry loop - Fix cost aggregation on task failure - mark_failed() now accepts cost/token params and accumulates to batch total - Fix S3 exists() to raise StorageReadError on non-404 errors instead of silently returning False - Add run_id validation on load - mismatched run_id starts fresh Code quality: - Replace deprecated datetime.utcnow() with datetime.now(timezone.utc) throughout checkpoint module Tests: - Add test_mark_failed_accumulates_costs - Add test_run_id_mismatch_starts_fresh - Fix test_reset_stale_tasks to use timezone-aware datetime Updates demo script to pass costs to mark_failed().
- Add resilience module with TaskTimeoutError, request_timeout, task_timeout - Add CircuitBreaker with CLOSED/OPEN/HALF_OPEN states and configurable thresholds - Add CircuitBreakerRegistry for managing per-provider circuit breakers - Integrate timeout and circuit breaker into cli/run_all.py - Add --max-task-timeout and --circuit-breaker-threshold CLI flags - Add timeout and circuit breaker config to provider_config.yml - Add 41 tests for resilience module
Timeouts now only apply when --max-task-timeout is explicitly passed. This prevents accidentally failing long-running reasoning model tasks.
- Add BatchProgressManager to track task progress - Add --resume/--no-resume CLI flags (resume enabled by default) - Claim tasks before execution, mark completed/failed after - Skip already-completed tasks on resume - Reset stale in-progress tasks from crashed workers - Add checkpoint progress summary to output
aefd666 to
cbbb68a
Compare
gkamradt
approved these changes
Jan 23, 2026
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
--resume/--no-resumeCLI flags to run_all.pyTest plan
.checkpoints/progress.json--no-resumere-runs all taskspytest- all 389 tests pass