Status: done
text_event and provider_tool_call stream kinds.finish_reason.event kind.82 passed, one existing Starlette deprecation warning).Preserve native provider tool calls as a distinct stream item so direct ChatAgent tools can retain provider-generated IDs and arguments without changing the existing hidden text-event protocol.
id, name, parsed arguments, and raw arguments from the provider.[DONE] but omits the expected tool-call finish reason.src/agent_lab/domain/messages.pysrc/agent_lab/infrastructure/openai_compatible.pytests/test_openai_stream_parser.pytests/test_debug_runtime.pydocs/plans/todos.mdkind="event".StreamItem.text_event(...) and StreamItem.provider_tool_call(...) constructors while keeping the event payload as ToolCallEvent.text_event and the provider tool-call accumulator to emit provider_tool_call.text_event in the current dual-agent path; direct routing remains out of scope.Follow TDD in this order:
test_parser_distinguishes_text_events_from_provider_tool_calls asserting:
message_delta;<agent_events>mock_search</agent_events> produces kind="text_event";delta.tool_calls produces kind="provider_tool_call" with intact arguments.test_parser_flushes_provider_tool_calls_without_finish_reason using fragmented name/argument chunks followed by flush() and asserting one call is emitted.test_parser_does_not_emit_provider_tool_call_twice_after_finish_and_flush to protect normal providers.uv run pytest tests/test_openai_stream_parser.py -q and confirm the new tests fail for the missing typed kinds/flush behavior.uv run pytest tests/test_debug_runtime.py tests/test_event_agent.py tests/test_openai_stream_parser.py -q to verify the existing dual-agent path still passes.Confirm from test output and inspection that:
done after focused and regression tests pass.43.1 row directly below todo 43 instead of modifying any completed historical todo row.uv run pytest tests/test_openai_stream_parser.py -quv run pytest tests/test_debug_runtime.py tests/test_event_agent.py tests/test_openai_stream_parser.py -qgit diff --check