{{ message }}
Repository navigation
Python: fix(ag ui): allow text events when response_format is a json schema dictionary - #8604
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoSep 22, 2026
Conversation
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
September 21, 2026 17:39 — with
GitHub Actions
Inactive
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
September 21, 2026 17:39 — with
GitHub Actions
Inactive
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
September 21, 2026 17:39 — with
GitHub Actions
Inactive
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
September 21, 2026 17:39 — with
GitHub Actions
Inactive
…ictionary When response_format is configured as a json schema dict rather than a Pydantic BaseModel, skip_text was previously set to True, which suppressed text content events. This change ensures skip_text is only enabled for Pydantic models whose fields map directly to state or message fields. Non-model formats keep emitting text content events as expected. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Manohar Paturi (ManoharPaturi)
force-pushed
the
fix/ag-ui-json-schema-text
branch
from
September 22, 2026 07:18
a3a829d to
6d2ae7e
Compare
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
September 22, 2026 07:18 — with
GitHub Actions
Active
Member
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
September 22, 2026 12:52 — with
GitHub Actions
Active
Contributor
Author
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Sep 22, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation & Context
When
response_formatis configured as a raw JSON Schema dictionary rather than a Pydantic model class,skip_textwas previously set toTrueunder the assumption that all structured formats are handled as Pydantic models.However, non-Pydantic formats do not map into model fields or state snapshots. As a result, the assistant's JSON response text was being dropped silently from the AG-UI event stream, breaking clients expecting text content. This change ensures
skip_textis only enabled whenresponse_formatis a PydanticBaseModeltype. Whenresponse_formatis a JSON schema mapping or other non-model structure, text content events continue to emit normally.Description & Review Guide
What are the major changes?
In
python/packages/ag-ui/agent_framework_ag_ui/_agent_run.py, checkisinstance(response_format, type) and issubclass(response_format, BaseModel)before settingskip_text = True.Demoted the warning log to debug when
response_formatis not a Pydantic model, since JSON schema dictionaries are valid input configurations.Added unit test
test_structured_output_with_json_schema_mapping_emits_textinpython/packages/ag-ui/tests/ag_ui/test_structured_output.pyverifying that text events are emitted whenresponse_formatis a schema dictionary.What is the impact of these changes?
Fixes silent dropping of assistant response text when using dictionary-based JSON schemas in AG-UI runs, allowing AG-UI consumers to receive the structured JSON output text.
What do you want reviewers to focus on?
The
is_pydantic_response_formatdetermination and the new test case covering JSON schema dictionary formats.Related Issue
Closes #8361
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.