Skip to content

Python: Handle missing reasoning text in DevUI - #9543

Open
ZedingZhang (ZedingZhang) wants to merge 1 commit into
microsoft:mainfrom
ZedingZhang:codex/fix-devui-empty-reasoning-9533
Open

ZedingZhang (ZedingZhang) wants to merge 1 commit into
microsoft:mainfrom
ZedingZhang:codex/fix-devui-empty-reasoning-9533

Conversation

@ZedingZhang

@ZedingZhang ZedingZhang (ZedingZhang) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & Context

DevUI turns a valid reasoning chunk with text=None into a ResponseReasoningTextDeltaEvent validation error and can discard the answer following it in the same update.

Description & Review Guide

  • What are the major changes? Map missing reasoning text to an empty string at the existing DevUI event boundary. Add a parametrized regression using real framework content for None, empty text, and ordinary reasoning text.
  • What is the impact of these changes? Reasoning events remain valid and the following answer is delivered without a conversion warning. The production fix is one line.
  • What do you want reviewers to focus on? The optional-text/string-event boundary and continuation of the same update. Ablation retained only the inline fallback: both explicit normalization and the one-line form pass; removing the fallback reproduces the reported validation error while the two string controls pass.

Related Issue

Fixes #9533.

Trivial-change exception: this is an obvious correction of a valid optional value being passed to a string-only field, using the one-line fallback already proposed in the issue. The existing event contract is preserved.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution.

AI assistance details: OpenAI Codex prepared the implementation, regression tests, ablation experiments, and this description, and ran the local checks. Two independent Codex review contexts checked Standards and Spec. I have reviewed all submitted content and take resonsibility for it.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible — affected DevUI package: 217 passed, 4 skipped; package checks and test typing passed.
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:44
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The localized fix preserves the event contract, and regression coverage addresses the reported failure with no identified issues.

No open issues 🎉

What changed in this PR

Fixes #9533 by allowing DevUI to handle reasoning chunks with missing text without dropping the following answer.

Changes:

  • Converts missing reasoning text to an empty string at the event boundary.
  • Adds regression coverage for missing, empty, and ordinary reasoning text, including answer continuation.
File Description
python/​packages/​devui/​tests/​devui/​test_mapper.py Tests reasoning deltas, answer delivery, and absence of conversion warnings.
python/​packages/​devui/​agent_framework_devui/​_mapper.py Adds the empty-string fallback for reasoning text.

Review effort: Balanced

This branch was successfully deployed

1 active deployment
github-app-auth — f8fffa1c Deployed Oct 20, 2026 by ZedingZhang via add_label #25781
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants