fix(cleanup): preserve original error context when recovering stale executions (#286) - #324
Merged
Merged
Conversation
…xecutions (#286) The cleanup service now queries the agent's log buffer for original error context before marking executions as failed. This preserves diagnostic info like expired tokens, OOM errors, and crash details instead of replacing them with generic "Stale execution" messages. Changes: - Add /api/executions/{id}/last-error endpoint to agent server - Add ProcessRegistry.get_last_error() to scan log buffer for errors - Update _recover_execution() to fetch and combine error context - Sanitize error messages to prevent credential leakage - Truncate combined messages to 2000 chars to prevent DB bloat Closes #286 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
vybe
added a commit
that referenced
this pull request
Apr 14, 2026
PR #324 landed — cleanup service now preserves original error context by fetching from agent log buffer before marking executions failed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
/api/executions/{id}/last-errorendpoint to agent server that extracts error context from log bufferChanges
docker/base-image/agent_server/routers/chat.py- New endpointdocker/base-image/agent_server/services/process_registry.py-get_last_error()methodsrc/backend/services/cleanup_service.py-_get_execution_error()and updated_recover_execution()tests/test_watchdog_unit.py- 9 new unit testsdocs/memory/feature-flows/cleanup-service.md- Updated documentationTest Plan
pytest tests/test_watchdog_unit.py -v(27 tests)Closes #286
🤖 Generated with Claude Code