Commit 474950f
fix: guard agent field serializer against None when profile-only request is dumped
`StartConversationRequest` with `agent_profile_id` set holds `agent=None`
(the server resolves it). Pydantic's `model_dump` calls the `AgentBase`
model_serializer with `self=None`, crashing. The `@field_serializer("agent",
mode="wrap")` short-circuits before the model_serializer fires and returns
`None` directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c2b35a0 commit 474950f
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
287 | 294 | | |
288 | 295 | | |
289 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
290 | 303 | | |
291 | 304 | | |
292 | 305 | | |
| |||
0 commit comments