Skip to content

Extra fields from custom AgentState not available during streaming #12

@Iamsdt

Description

@Iamsdt

When defining a custom AgentState, the additional fields are not accessible during streaming updates.
Minimal reproducible example:

class MyAgentState(AgentState):
    cv_text: str = ""
    cid: str = ""
    jd_text: str = ""
    jd_id: str = ""

During agent execution, when using streaming responses, only the default fields are included.
The custom fields (cv_text, cid, jd_text, jd_id) do not appear in the streamed state updates.

Expected Behavior

  • All fields declared in the custom AgentState should be included in the streaming payload.
  • The streaming state should fully reflect the extended model.

Actual Behavior

  • While running the agent with streaming enabled:

    • Custom fields are missing.
    • Only the base AgentState fields are streamed.

Why This Matters

These custom fields are required for:

  • Reference data through the agent lifecycle
  • Debugging and introspection
  • Downstream consumers relying on full state in streaming mode

Steps to Reproduce

  1. Create a custom AgentState with extra fields.
  2. Run an agent with streaming enabled.
  3. Inspect streamed events → the extra fields are not included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions