Status: done
Implemented by subagent and locally verified by the main session.
Commands:
uv run pytest tests/test_websocket_api.py
uv run pytest
Results:
10 passed, 1 warning in 0.22s16 passed, 1 warning in 0.22sPrevent the debug UI and provider serializer from generating invalid Chat Completions tool messages without tool_call_id.
The pre-message editor exposes tool as a role, but the UI does not collect tool_call_id. A manual tool pre-message can therefore reach the provider as {role: "tool", content: "..."}, which strict compatible providers reject.
This todo covers:
tool from the static pre-message role selector for MVP.tool message lacks tool_call_id.This todo does not cover:
src/agent_lab/presentation/static/index.htmlsrc/agent_lab/infrastructure/chat_client.pytests/test_websocket_api.py.docs/plans/todos.md.OpenAICompatibleChatClient rejects a ChatMessage(role="tool", content="...") without tool_call_id.tool.<option value="tool">tool</option> from the pre-message template._serialize_message, raise ValueError("tool messages require tool_call_id") when role is tool and no tool_call_id is present.Run:
uv run pytest tests/test_websocket_api.py
uv run pytest
Expected result: