handle.stop() returns without raising but sometimes _stop_requested is never set to true.
In examples/agents/79_agent_message_bus.py the DoWhile condition is not flipped (1 of 3 runs), the agent stays blocked on PULL_WORKFLOW_MESSAGES, and the caller dies on join(timeout=30) → TimeoutError.
Repro
cd examples/agents
for i in 1 2 3; do uv run python 79_agent_message_bus.py; echo "exit=$?"; done
On a failing run, take the id from Writer started: <id>:
curl -s "http://localhost:8080/api/workflow/<id>" | jq '.status, .variables._stop_requested'
# RUNNING, false <- stop() did not set the flag
curl -s -X POST "http://localhost:8080/api/agent/<id>/stop" -w '%{http_code}\n' # 200
curl -s "http://localhost:8080/api/workflow/<id>" | jq '.variables._stop_requested'
# true <- endpoint works when called by hand
Environment: conductor-oss server (agent runtime + WMQ enabled), python-sdk main.
Ruled out
- Endpoint itself — works by hand on the same stuck execution.
- Loop clobbering the flag — per-iteration
SET_VARIABLE writes only _last_tool_results and _agent_state.
stop() raising — it returned normally.
- The WMQ unblock message — sent after the flag write, so it can't produce a
false flag.
Unexplained: why the POST didn't apply despite a 2xx. Server logs for a failing run would settle it.
🤖 Generated with Claude Code
handle.stop()returns without raising but sometimes_stop_requestedis never set totrue.In
examples/agents/79_agent_message_bus.pythe DoWhile condition is not flipped (1 of 3 runs), the agent stays blocked onPULL_WORKFLOW_MESSAGES, and the caller dies onjoin(timeout=30)→TimeoutError.Repro
On a failing run, take the id from
Writer started: <id>:Environment: conductor-oss server (agent runtime + WMQ enabled), python-sdk
main.Ruled out
SET_VARIABLEwrites only_last_tool_resultsand_agent_state.stop()raising — it returned normally.falseflag.Unexplained: why the POST didn't apply despite a 2xx. Server logs for a failing run would settle it.
🤖 Generated with Claude Code