fix(cleanup): use per-agent slot TTL instead of fixed 20-min default (#226)#290
Closed
webmixgamer wants to merge 1 commit intomainfrom
Closed
fix(cleanup): use per-agent slot TTL instead of fixed 20-min default (#226)#290webmixgamer wants to merge 1 commit intomainfrom
webmixgamer wants to merge 1 commit intomainfrom
Conversation
…226) The periodic slot cleanup used a fixed DEFAULT_SLOT_TTL_SECONDS (1200s) for all agents, causing premature slot reclamation and false "failed" status for agents with custom execution timeouts (e.g., 30+ minutes). Two fixes: - Query per-agent execution_timeout_seconds from DB and pass to cleanup_stale_slots() so each agent's slot TTL = timeout + 5min buffer - Watchdog now returns confirmed-running execution IDs; slot cleanup skips DB failure marking for those IDs to prevent false failures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
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
execution_timeout_secondsfrom DB instead of using a fixed 20-min TTL, preventing premature slot reclamation for agents with custom timeoutsget_all_execution_timeouts()bulk DB query for efficient per-agent timeout lookupChanges
src/backend/services/slot_service.py—cleanup_stale_slots()acceptsagent_timeoutsmapsrc/backend/services/cleanup_service.py— wires watchdog confirmed-running set to slot cleanupsrc/backend/db/agent_settings/resources.py— bulk timeout querysrc/backend/database.py— delegate new methoddocs/memory/feature-flows/cleanup-service.md— updated flow docsdocs/memory/feature-flows/parallel-capacity.md— updated slot cleanup referenceTest Plan
get_all_execution_timeouts()returns correct data from live DBtest_cleanup_service.pyAPI contract unchangedCloses #226
🤖 Generated with Claude Code