Repository navigation
fix: Startup recovery for regular task executions (#128) - #165
Merged
vybe merged 4 commits intoMar 25, 2026
Merged
Conversation
On backend restart, schedule_executions stuck in 'running' status are now checked against agent containers and process registries. Orphaned executions are immediately marked failed with capacity slots released, instead of waiting 2 hours for the cleanup service timeout. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Use existing AgentClient instead of raw httpx (reuse) - Extract duplicated try/except into _recover_execution helper (DRY) - Log warning on agent unreachable instead of silent swallow - Replace defaultdict with plain dict.setdefault - Simplify test mocks to match AgentClient usage Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
vybe
approved these changes
Mar 25, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
Clean bug fix, well-tested, follows existing recovery patterns.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
schedule_executionsstuck inrunningare checked against agent containers and process registriesfailedwith capacity slots releasedChanges
src/backend/db/schedules.py— Addedget_running_executions()querysrc/backend/database.py— Exposed new method onDatabaseManagersrc/backend/services/cleanup_service.py— Addedrecover_orphaned_executions()using existingAgentClientfor HTTP checkssrc/backend/main.py— Call recovery in lifespan handler after cleanup service starttests/unit/test_orphaned_execution_recovery.py— 6 unit tests covering all scenariosdocs/memory/changelog.md— UpdatedTest Plan
pytest tests/unit/test_orphaned_execution_recovery.py -v(6/6)Closes #128
Generated with Claude Code