SDK bug (which is also currently in OpenHands): if...
# proj-sdk
w
SDK bug (which is also currently in OpenHands): if I send a message while the agent is talking to the LLM, and the LLM replies with
finish
, the agent never sees my message
c
We have an issue tracking this -- @strong-ice-84145 will take a look once he had time to finish the integration tests! https://github.com/All-Hands-AI/agent-sdk/issues/270
👍 2
s
I am getting non-deterministic behavior when sending a user message on the final step of a conversation run. https://github.com/All-Hands-AI/agent-sdk/pull/403/files#diff-669d9617662d03eb86f61ed61134e4fc6b9f886d0951961963cb5ea7e61ddfb6 This test runs a conversation that should have only one step: call sleep for 6 seconds then call finish action. This is done by mocking the llm completion API. During that single step, a user message is sent concurrently to the agent. There are two behaviors to the test 1. The conversation ends, the agent receives the user message, it doesn't answer. 2. The agent receives the user message and answers. In both cases, the finish action is called in step 1. Screenshots of the test execution attached
w
thonk if you're mocking the completions, I can't imagine where the non-determinism comes from
c
i wonder if there's some bug in how we handle locks here.. I see you are using two threads in the tests, maybe the threading is making things non-deterministic?
w
ah yeah if there's threading all bets are off 😅
s
The concurrent user message problem is solved. The conversation state is now a FIFOLock and
send_message
can add a message to the queue and change the status from
FINISHED
to
IDLE
while
conversation.run()
is still running, allowing an extra conversation loop to handle concurrent messages. If a user message is sent while the conversation runs a step, it will be able to be processed during the next step even if the finish tool had been called. (which might be a bit misleading? Finish tool does not imply finish conversation when there are concurrent user messages) https://github.com/All-Hands-AI/agent-sdk/pull/443
🙌 2