Commit ebbb6bb
committed
Set timestamps on AG-UI events (#3734)
Adds timestamps to all AG-UI events to fix ordering and timing issues for frontends consuming the event stream. - Override handle_event() to set timestamps on all transformed events - Explicitly set timestamps on lifecycle events (RunStarted, RunFinished, RunError) - Add test_timestamps_are_set() to verify all events have valid timestamps - Update all test assertions to expect timestamp fields1 parent 2e96d12 commit ebbb6bb
File tree
2 files changed
+336
-93
lines changed- pydantic_ai_slim/pydantic_ai/ui/ag_ui
- tests
2 files changed
+336
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
92 | 104 | | |
| 105 | + | |
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
| |||
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| 120 | + | |
107 | 121 | | |
108 | 122 | | |
109 | 123 | | |
110 | 124 | | |
111 | | - | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
| |||
0 commit comments