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]: A message to a running conversation waits for the current tool call to finish #6729
I have searched existing issues and this is not a duplicate.
Related: #6553 (the same lock, from the angle of executor saturation). That issue is about the server wedging. This one is about latency the person sees even when nothing wedges.
Bug Description
POST /api/conversations/{id}/events to a conversation whose agent is running a long tool call does not save the message until that tool call ends. LocalConversation.send_message() takes the conversation's state lock (with self._state:), and a live run holds that lock for the whole step, tool execution included. So the person's message, and anything the UI does after it, waits behind the command.
In an end-to-end Projects run (#6602 at 67c1038, Canvas #19495), "Wait, actually: …" was sent to a worker while its terminal ran a 7-minute pytest. Canvas showed "Sending…" for about 6.5 minutes. The message reached the agent only when the command ended. With the terminal tool's long timeouts (agents here run suites with timeout 3000), a correction can wait up to 50 minutes.
This is not specific to Projects. Projects just makes it common, because the person drops into a busy worker to redirect it.
Expected Behavior
The message is saved and acknowledged at once. The agent sees it at its next step, or the person can choose to interrupt the running tool.
Actual Behavior
The request does not return until the running tool call ends, and the message is not in the event log until then.
Steps to Reproduce
Start a conversation whose agent runs a terminal command that takes a few minutes (for example sleep 300).
While it runs, POST /api/conversations/{id}/events with run: true.
The request returns only when the command ends.
Possible directions
Append user messages through a path that does not need the step's state lock, for example a queue that the run drains at the start of its next step.
Or accept the message at once and expose "message queued behind a running tool", so UIs can offer "interrupt and send".
The new issue reports message-intake latency: send_message() takes the conversation state lock, and a live run holds it for the whole step (tool execution included), so POST /events is not saved/acknowledged until the tool call ends. This is the same root cause and code path as open issue #6553, which enumerates send_message among the state-lock waiters and holds the lock across the step, but #6553's symptom is a permanent wedge via executor saturation and it explicitly keeps the lock hold as a non-goal, so its fix would not resolve this latency. The 'message while running' semantics the issue proposes (queue at next step / expose 'interrupt and send') are the subject of open design issue #4829 (interrupt/steer/queue control plane), which also cites the lock split as its prerequisite. Not an exact duplicate of either, but discussion and fix planning would benefit from being coordinated with #6553 (same lock) and #4829 (intake-while-running semantics); the newly closed #6708/PR #6709 already fixed the same lock-hold symptom for the session-socket transport, leaving the REST path open. Should not be auto-closed.
Found 2 possible duplicate issues:
#6553 — [Bug]: State-lock waiters fill the default executor and deadlock tool execution in agent-server
#4829 — Introduce an explicit interrupt / steer / queue control plane for user messages (ACP parity)
These may not be exact duplicates, but the scope appears to overlap enough that keeping discussion in one place may be more useful.
This comment was created by an AI assistant (OpenHands) on behalf of the repository maintainer.
My agents filed this issue, after a few hours of running live testing… I know it has come up occasionally in the past, but TBH personally I don’t think it matters a lot, nor is it clear to me how it would help my agents since the user didn’t interrupt. The user can interrupt with the Stop button. 🤔
Activity
all-hands-bot commentedon Nov 10, 2026
The new issue reports message-intake latency: send_message() takes the conversation state lock, and a live run holds it for the whole step (tool execution included), so POST /events is not saved/acknowledged until the tool call ends. This is the same root cause and code path as open issue #6553, which enumerates send_message among the state-lock waiters and holds the lock across the step, but #6553's symptom is a permanent wedge via executor saturation and it explicitly keeps the lock hold as a non-goal, so its fix would not resolve this latency. The 'message while running' semantics the issue proposes (queue at next step / expose 'interrupt and send') are the subject of open design issue #4829 (interrupt/steer/queue control plane), which also cites the lock split as its prerequisite. Not an exact duplicate of either, but discussion and fix planning would benefit from being coordinated with #6553 (same lock) and #4829 (intake-while-running semantics); the newly closed #6708/PR #6709 already fixed the same lock-hold symptom for the session-socket transport, leaving the REST path open. Should not be auto-closed.
Found 2 possible duplicate issues:
These may not be exact duplicates, but the scope appears to overlap enough that keeping discussion in one place may be more useful.
This comment was created by an AI assistant (OpenHands) on behalf of the repository maintainer.
enyst commentedon Nov 10, 2026
My agents filed this issue, after a few hours of running live testing… I know it has come up occasionally in the past, but TBH personally I don’t think it matters a lot, nor is it clear to me how it would help my agents since the user didn’t interrupt. The user can interrupt with the Stop button. 🤔
docs(verify-agent-server): F01-F11 and F20-F24 replayed on 9bf835c