|
1 | 1 | """Cross-channel conformance fixtures derived from real pydantic-ai event sequences. |
2 | 2 |
|
3 | 3 | Each fixture is built by running a pydantic_ai event stream through PydanticAITurn |
4 | | -(default coalesce_tool_requests=False) and collecting the canonical StreamTaskMessage* |
5 | | -output. These canonical event lists are then registered with the conformance runner and |
6 | | -exercised by the cross-channel test (yield_events vs auto_send). |
| 4 | +and collecting the canonical StreamTaskMessage* output. These canonical event lists are |
| 5 | +then registered with the conformance runner and exercised by the cross-channel test |
| 6 | +(yield_events vs auto_send). |
7 | 7 |
|
8 | | -AGX1-377 NOTE |
9 | | -------------- |
| 8 | +Streamed tool requests |
| 9 | +---------------------- |
10 | 10 | The pydantic-ai stream emits a tool REQUEST as Start + ToolRequestDelta + Done (not a |
11 | | -Full event). The runner's current normalization does NOT produce a logical delivery for |
12 | | -Start+Delta+Done(tool_request): _yield_logical_deliveries only produces a delivery for |
13 | | -Full(tool_request) or Full(tool_response), and Start+Done for text/reasoning content. |
14 | | -auto_send likewise drops the Start+Delta+Done(tool_request) shape. Both channels handle |
15 | | -it consistently (both ignore it), so the cross-channel test PASSES, but it does NOT yet |
16 | | -assert that the streamed tool-request is actually delivered. Full delivery-equivalence |
17 | | -coverage for streamed tool requests will land once AGX1-377 fixes the normalization. |
18 | | -The fixtures below retain the ToolRequestDelta events so they become valid test inputs |
19 | | -automatically once AGX1-377 lands. |
| 11 | +Full event). AGX1-377 has landed: both the conformance runner and auto_send now deliver |
| 12 | +the Start+Delta+Done(tool_request) shape, so the cross-channel test asserts full |
| 13 | +delivery-equivalence for streamed tool requests. The fixtures below retain the |
| 14 | +ToolRequestDelta events as the streamed tool-request inputs. |
20 | 15 | """ |
21 | 16 |
|
22 | 17 | from __future__ import annotations |
@@ -61,8 +56,7 @@ async def _aiter(events: list[Any]) -> AsyncIterator[Any]: |
61 | 56 | async def _canonical(pydantic_events: list[Any]) -> list[Any]: |
62 | 57 | """Run pydantic_ai events through PydanticAITurn and collect the output. |
63 | 58 |
|
64 | | - Default coalesce_tool_requests=False means the output equals the bare |
65 | | - convert_pydantic_ai_to_agentex_events output. |
| 59 | + The output equals the bare convert_pydantic_ai_to_agentex_events output. |
66 | 60 | """ |
67 | 61 | turn = PydanticAITurn(_aiter(pydantic_events), model=None) |
68 | 62 | return [e async for e in turn.events] |
|
0 commit comments