[Bug] Agent reply in one thread can remain stalled after another thread event is processed
Description
When the same managed agent receives requests in two separate threads around the same time, the reply to the first thread can remain stalled without any visible error.
In the observed test, the agent successfully replied in Thread B, but did not reply in Thread A until it was mentioned again in Thread A.
Steps to reproduce
- Add the same managed agent to a channel.
- In Thread A, mention the agent and ask it to calculate the sum of the integers from 1 to 100, then reply only in Thread A using the identifier
THREAD-A. - Before the agent replies in Thread A, mention the same agent in Thread B and ask it to calculate the sum of the integers from 1 to 50, then reply only in Thread B using the identifier
THREAD-B. - Observe the replies in both threads.
- If Thread A remains unanswered, mention the agent again in Thread A.
Actual behavior
- The agent replied successfully in Thread B.
- Thread A remained unanswered for several minutes.
- No failure, cancellation, or retry state was displayed.
- After another mention in Thread A, the agent returned the expected answer to the original request.
Observed timeline:
- 01:57 — Request posted in Thread A
- 01:57 — Request processed and answered in Thread B
- 02:00 — Thread A was still unanswered, and the agent was mentioned again
- 02:01 — The agent answered the original Thread A request
Expected behavior
Both requests should eventually receive responses.
If a request is interrupted, cancelled, or fails, Buzz should display an explicit error or retry state rather than silently leaving the thread unanswered.
Additional information
After being mentioned again, the agent claimed that it had moved to another event before completing the pending reply. This statement was generated by the agent and should not be treated as evidence of the internal cause.
The confirmed observations are only:
- Thread B received a reply.
- Thread A did not receive a reply.
- Thread A received the original answer only after another mention.
The problem may relate to event scheduling, cancellation, queueing, or turn-resumption behavior, but the internal cause has not been verified.
Closing as a duplicate of #2865. The two issues describe the same observed behavior: an Agent reply in one thread remained unanswered until another mention after a second thread event was processed.