Skip to content

fix(agent): tolerate explicit null for list fields in streamed events - #573

Merged
hogan-yuan merged 1 commit into
mainfrom
fix/agent-null-sequence-fields
Aug 14, 2026
Merged

fix(agent): tolerate explicit null for list fields in streamed events#573
hogan-yuan merged 1 commit into
mainfrom
fix/agent-null-sequence-fields

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

Follow-up to the null outputs fix (#572), same class of bug.

Several list-typed fields on the streamed AI Agent conversation event payloads were #[serde(default)], which only fills a missing key — it does not accept an explicit null. An event carrying e.g. "tip_chips": null failed to deserialize and aborted the whole event stream:

invalid type: null, expected a sequence

Fixed by deserializing these through serde_utils::null_as_default so null maps to an empty list:

  • tip_chips — on the node / subagent / agent-tool *_started payloads
  • WorkflowFinishedPayload.process_data
  • SubagentStartedPayload.tools

Added a unit test covering null for each.

Following the same class of bug as the `null` `outputs` fix: several
list-typed fields on the streamed conversation event payloads were
`#[serde(default)]`, which only covers a missing key — not an explicit
`null`. An event carrying e.g. `"tip_chips": null` failed to deserialize
and aborted the whole event stream:

    invalid type: null, expected a sequence

Deserialize `tip_chips` (node/subagent/agent-tool `*_started` payloads),
`WorkflowFinishedPayload.process_data`, and `SubagentStartedPayload.tools`
through `null_as_default` so `null` maps to an empty list.
@hogan-yuan
hogan-yuan merged commit 8bb2f2f into main Aug 14, 2026
6 checks passed
@hogan-yuan
hogan-yuan deleted the fix/agent-null-sequence-fields branch August 14, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant