You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] StrandsA2AExecutor served via serve_a2a never hits AgentCore idle session timeout (causes runaway execution environments) #583
After the client request finishes (or the client disconnects), the underlying ASGI server should cleanly resolve the request. The AgentCore Runtime should then recognize the environment as "Idle", start the idleRuntimeSessionTimeout countdown, and cleanly shut down the microVM once the timeout is reached.
Actual Behavior
The AgentCore Runtime considers the environment continuously "Active".
The idleRuntimeSessionTimeout is never reached.
Despite there being no further requests for the session, the execution environment remains alive, indefinitely racking up continuous GB-hour billing, until it hits the platform's absolute hard maximum lifetime limit (e.g., 8 hours) and is forcefully killed.
Additional Context
I don't have the same issue for regular (non-A2A) strands agents.
I originally opened a bug report to the Strands developers strands-agents/harness-sdk#3120 and they said they internally diverted it to the agentcore team. I am making this ticket so there is a publicly accessible way to track the progress.
The root cause is likely that serve_a2a's execution loop never yields control back to AgentCore's session manager — the A2A server runs in a blocking accept() loop that handles agent-to-agent protocol messages, and while it processes each A2A request/response pair, it never signals "I'm idle" to the parent session context.
Why this matters in production:
Each StrandsA2AExecutor that serves A2A stays alive indefinitely once spawned
If you're spawning executors per-request (or per-session), they pile up
No cleanup = memory/process leaks, runaway resource consumption
Tactical fix:
Check if serve_a2a has a session_context or timeout parameter that you're not passing. If StrandsA2AExecutor supports idle_timeout_seconds in its constructor, thread that through to the A2A server. Alternatively, wrap serve_a2a in a parent process that enforces a TTL and kills the executor if it hasn't received traffic in N seconds.
Strategic fix (for the SDK maintainers):
The A2A server loop should integrate with AgentCore's session lifecycle — either by checking a shared "last activity" timestamp and self-terminating, or by registering a periodic heartbeat with the session manager so it can be reaped when idle.
If you're hitting this in production right now: add process-level monitoring (e.g., a supervisor that kills stale executors based on connection idle time) as a stopgap until the SDK fix lands.
Context from an AI coding agent built with SwarmAI. Discussion: T-MEM
What version of the agentcore sdk are you using?
There was an A2A idle bug with similar symptoms that has been fixed in v1.15.1 (#542 ). If you are using an earlier version please try updating the sdk to latest version.
Thank you for looking into it. We were using v1.14.1 at the time we encountered the issue. We will try a newer version in due course and post the result.
Activity
xg-gh-25 commentedon Jul 20, 2026
The root cause is likely that serve_a2a's execution loop never yields control back to AgentCore's session manager — the A2A server runs in a blocking accept() loop that handles agent-to-agent protocol messages, and while it processes each A2A request/response pair, it never signals "I'm idle" to the parent session context.
Why this matters in production:
Tactical fix:
Check if serve_a2a has a session_context or timeout parameter that you're not passing. If StrandsA2AExecutor supports idle_timeout_seconds in its constructor, thread that through to the A2A server. Alternatively, wrap serve_a2a in a parent process that enforces a TTL and kills the executor if it hasn't received traffic in N seconds.
Strategic fix (for the SDK maintainers):
The A2A server loop should integrate with AgentCore's session lifecycle — either by checking a shared "last activity" timestamp and self-terminating, or by registering a periodic heartbeat with the session manager so it can be reaped when idle.
If you're hitting this in production right now: add process-level monitoring (e.g., a supervisor that kills stale executors based on connection idle time) as a stopgap until the SDK fix lands.
Context from an AI coding agent built with SwarmAI. Discussion: T-MEM
Tighten high-severity criteria: require broad blast radius
Add LLM issue auto-triage: type and high-severity labelers (#584)
padmak30 commentedon Jul 27, 2026
What version of the agentcore sdk are you using?
There was an A2A idle bug with similar symptoms that has been fixed in v1.15.1 (#542 ). If you are using an earlier version please try updating the sdk to latest version.
matseymour28590 commentedon Aug 18, 2026
Thank you for looking into it. We were using v1.14.1 at the time we encountered the issue. We will try a newer version in due course and post the result.