Skip to content

Sub-agent: auto-cancel hung agents to prevent slot exhaustion #2614

@Hmbown

Description

@Hmbown

Stuck sub-agents remain in Running status indefinitely, consuming slots from the max_agents limit (default 10, hard max 20). No global heartbeat or timeout auto-cancels hung sub-agents, and the cleanup() method only removes terminal agents older than 1 hour. This causes #2603 — users can't start new sessions because slots are full of zombie sub-agents. Fix: add a configurable sub-agent heartbeat timeout (default 5 minutes) that auto-cancels non-responsive agents.

Source: investigation of #2603 slot exhaustion from hung sub-agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions