Skip to content

(bug) Sending a message while an agent turn runs kills the turn and locks the session for 30 minutes #6417

Description

@mmabrouk

When I send a message to an agent session while its current turn is still running, I expect the platform to queue the message, or to refuse it with a clear signal. Instead both turns die and the session refuses every message for 30 minutes.

What happens:

  1. The new message aborts at once. The chat shows "Agent run failed: This operation was aborted".
  2. The running turn stops producing output at the same moment and never completes.
  3. Every later message aborts the same way, until the 30-minute idle limit reaps the dead turn. Only then does the session accept messages again.

Steps to reproduce

  1. Start an agent session and send a prompt that produces a long turn (several minutes of tool calls).
  2. While the turn streams, send a second message in the same session.
  3. Watch the second message fail at once, the first turn go silent, and the session stay stuck. Send more messages: each one fails with the same abort.

Reproduced on the local OSS dev stack on 2026-08-31, session 4ad72652-d294-4e9c-b224-c90e4b11e43c. The first turn streamed normally from 19:22 to 19:30:16. The second message arrived at 19:30:18.

Runner log

19:30:16 [sessions/persist] ingest OK session=4ad72652... idx=67 type=tool_result   <- healthy turn b3e552b3 still streaming
19:30:18 [sessions] stream sessionOwned=true sessionId=4ad72652... turnId=7a0e728a... cred=present
19:30:18 [sessions/alive] interrupted session=4ad72652... turn=7a0e728a... -> aborting   <- new turn refused by the turn locks
19:30:19 [keepalive] evict (supersede-busy) key=...:4ad72652...; cold                    <- but the busy sandbox is torn down anyway
19:30:19 [keepalive] evict key=...:4ad72652... reason=supersede-busy

After the eviction, the first turn (b3e552b3) produced nothing more, but kept heartbeating running=true every 30 seconds until:

20:00:19 [sessions/persist] ingest OK session=4ad72652... idx=69 type=error   ("idle timeout after 1800000ms with no progress")

SDK log for the aborted new turn

agenta.sdk.agents.errors.AgentRunFailed: Agent run failed: This operation was aborted

The hang half of this (a turn that never fails when its sandbox dies under it) is #6418. The codex no-output case is #6420.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions