the AgentServer /run endpoint seems to block until...
# proj-sdk
w
the AgentServer /run endpoint seems to block until
run()
finishes--is that what we want? I'd expect it to just start the agent and return https://github.com/OpenHands/software-agent-sdk/blob/main/openhands-agent-server/openhands/agent_server/conversation_router.py#L171
in general the behavior I'm seeing is that run hangs for a while, then finally returns, and all the events come through the websocket
CC @straight-sundown-84319 and @freezing-spoon-14104. I struggled to get a good user experience here, because nothing happened (e.g. no websocket events) until the /run endpoint finished. I could be doing something wrong though If we're seeing a long delay after starting a convo this could be why
s
This is something Xingyao and I went back and forth on quite a but - The run endpoint currently matches the agent sdk. (This made it easier for him to implement the remote runtime). It blocks until the run finishes. My solution for this was to... • Add a
run
flag to the send message operation - the send message operation will not block. • Make sure that messages sent over the websocket act like send message with the run flag set to true - so they do not block
w
that does make sense. I wonder if
/run?async=true
would be helpful
s
It is debatable whether we want the run in the agent server to behave exactly like the agent sdk - a single threaded app.
w
I like keeping the server simple, but single-threaded seems like too strong a constraint