Skip to content

Python: [Bug]: DevUI ResponseReasoningTextDeltaEvent fails when Gemini reasoning chunk has no text #9533

Description

Observed Behavior

Running an agent with GeminiChatClient (gemini-3.5-flash-lite) through DevUI, the server logs this on the first prompt:

Error converting agent update: 1 validation error for ResponseReasoningTextDeltaEvent
delta
Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]

The agent still runs, but that update is dropped.

It comes from _map_reasoning_content in agent_framework_devui/_mapper.py, which does:

return ResponseReasoningTextDeltaEvent(
    type="response.reasoning_text.delta",
    delta=content.text,
    ...
)

When Gemini sends a reasoning chunk with no text, content.text is None and validation fails.

Image

Expected Behavior

Reasoning deltas with no text should not cause a validation error. The update should either use an empty string or be skipped cleanly so the rest of the stream continues without log noise.

Steps to Reproduce

  1. Install agent-framework, agent-framework-devui, and agent-framework-gemini.
  2. Run the minimal script below (set your Gemini API key in the environment).
  3. Open the DevUI page that appears.
  4. Send any prompt that causes the model to produce reasoning (e.g. a short planning or multi-step question).
  5. Check the server console for the validation error on ResponseReasoningTextDeltaEvent.

Minimal Reproduction

from agent_framework import Agent
from agent_framework.devui import serve
from agent_framework.gemini import GeminiChatClient

client = GeminiChatClient(model="gemini-3.5-flash-lite")

worker = Agent(
    client=client,
    name="worker",
    instructions="You are a helpful assistant."
)

serve(
    entities=[worker],
    port=8000,
    auto_open=True,
    auth_enabled=False
)

Error Messages and Stack Traces

1 validation error for ResponseReasoningTextDeltaEvent
delta
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.14/v/string_type

Package Versions

agent-framework==1.19.0
agent-framework-devui==1.0.0b261008
agent-framework-gemini==1.0.0b260910

Python Version

Python 3.14

Operating System

Windows

Regression

Unknown

Additional Context

Proposed fix

In agent_framework_devui/_mapper.py, around line 1426, in MessageMapper._map_reasoning_content, I changed:

delta=content.text,

to:

delta=content.text or "",

This change provides an empty-string fallback when content.text is None or empty, preventing potential issues with missing reasoning content.

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I personally verified this behavior and the reproduction details are authentic.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 19, 2026
  2. added
    reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow
    on Oct 19, 2026
  3. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    🤖 Automated triage reproduction notes (agent-authored — trust but verify)

    Agent analysis

    The bug occurs in python/packages/devui/agent_framework_devui/_mapper.py::MessageMapper._map_reasoning_content when valid Content.from_text_reasoning(text=None) content reaches the string-only ResponseReasoningTextDeltaEvent.delta field. Minimal repro: pass that content through MessageMapper.convert_event in an AgentResponseUpdate and observe the validation warning and emitted error event.

    • Failing test: python/packages/devui/tests/devui/test_mapper.py::test_reasoning_content_without_text_does_not_emit_error
    • Files examined: python/packages/devui/agent_framework_devui/_mapper.py, python/packages/devui/tests/devui/test_mapper.py, python/packages/core/agent_framework/_types.py, python/packages/devui/pyproject.toml, python/packages/devui/AGENTS.md, python/AGENTS.md
    • Tests run: python/packages/devui/tests/devui/test_mapper.py::test_reasoning_content_without_text_does_not_emit_error
    • Reported version: agent-framework-devui>=1.0b261008
    • Current version: 1.0.0b261015
  4. added
    devuiUsage: [Issues, PRs], Target: DevUI
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 19, 2026
  5. added a commit that references this issue on Oct 22, 2026
    4c191ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

devuiUsage: [Issues, PRs], Target: DevUIpythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions