Status: done
Make runtime queues real producer/consumer boundaries and let WebSocket run separate upstream and downstream tasks.
The original queue requirement names producers and consumers explicitly:
The current runtime logs queue put/get calls, but DebugRuntime.run() still produces and consumes output in one method, and WebSocket reads only one initial request.
This todo covers:
RuntimeQueues.DebugRuntime.run() as a compatibility wrapper for tests and scripts.This todo does not cover:
src/agent_lab/application/queues.pysrc/agent_lab/application/runtime.pysrc/agent_lab/presentation/web.pytests/test_debug_runtime.pytests/test_websocket_api.pyAdd DebugRuntime.start(request) -> RuntimeQueues. It should create or reuse RuntimeQueues, seed the initial user message into queues.input, start background runtime work, and return queues immediately.
DebugRuntime.run(request) remains an async iterator by calling start() and then consuming queues.output until done or error.
Runtime work should:
queues.output only;queues.events;queues.events and puts tool replies onto queues.input;assistant(tool_calls) -> tool -> later user.WebSocket handling should:
DebugRunRequest;queues.output and sends JSON;{"type": "user_message", "content": "..."} and puts ChatMessage(role="user", content=...) into queues.input.DebugRuntime.start() returns queues and output can be consumed directly.{"type": "user_message", "content": "follow-up"};DebugRuntime to add start(), output queue consumption, EventAgent worker, and tool-reply wait logic.Run focused tests:
uv run pytest tests/test_debug_runtime.py tests/test_websocket_api.py
Run the full suite:
uv run pytest
Update docs/plans/todos.md and this plan with the result, then commit.
Result:
DebugRuntime.start() did not exist, event-time user input was ordered before the tool reply, and WebSocket still called only run().uv run pytest tests/test_debug_runtime.py tests/test_websocket_api.py passed: 26 tests, 1 existing Starlette deprecation warning.uv run pytest passed: 31 tests, 1 existing Starlette deprecation warning.DebugRuntime.start() now starts a queue-backed session and returns RuntimeQueues for downstream consumers.DebugRuntime.run() remains as a compatibility wrapper over the output queue.user_message receiving.