Skip to content

fix: preserve single-turn structured output - #6100

Closed
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/single-turn-output-schema
Closed

he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/single-turn-output-schema

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Fixes #6089.

Summary

  • Keep message_as_output for plain single-turn agent text output.
  • Leave structured output_schema results as event.output instead of marking them as message output.
  • Add direct tests for both plain text and structured single-turn output handling.

To verify

  • $env:PYTHONPATH=(Resolve-Path .\src).Path; python -m pytest tests\unittests\workflow\test_llm_agent_as_node.py -q
  • python -m py_compile src\google\adk\workflow\_llm_agent_wrapper.py tests\unittests\workflow\test_llm_agent_as_node.py
  • python -m ruff check src\google\adk\workflow\_llm_agent_wrapper.py
  • git diff --check

@rohityan rohityan self-assigned this Jun 15, 2026
@wyf7107 wyf7107 self-assigned this Jun 16, 2026
@rohityan rohityan removed their assignment Jun 17, 2026
@rohityan rohityan added request clarification [Status] The maintainer need clarification or more information from the author core [Component] This issue is related to the core interface and implementation labels Jun 17, 2026
@rohityan

Copy link
Copy Markdown
Collaborator

Hi @he-yufeng , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing unit tests before we can proceed with the review.

@he-yufeng
he-yufeng force-pushed the fix/single-turn-output-schema branch 3 times, most recently from 3dca9bd to b519da0 Compare June 18, 2026 10:14
@he-yufeng
he-yufeng force-pushed the fix/single-turn-output-schema branch from b519da0 to 6ec8fca Compare August 19, 2026 00:10
@he-yufeng

Copy link
Copy Markdown
Contributor Author

@rohityan Done, and sorry for the long silence on your June ask. Rebased onto current main (the test file got a union merge with the branch-coverage tests landed since) and the workflow unit suite is green locally: 735 passed, 11 skipped. The one thing I could not replay is the original CI failure, since the June run logs are gone; if a specific test still fails on your side, name it and I'll fix that one directly.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

Still applies on main: process_llm_agent_output sets message_as_output=True unconditionally, overriding what the caller asked for. Could a maintainer re-review when there's a chance?

copybara-service Bot pushed a commit that referenced this pull request Sep 25, 2026
Merge #6100

Fixes #6089

PiperOrigin-RevId: 987982250
@adk-bot

adk-bot commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Thank you @he-yufeng for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 6b96ba1.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Sep 25, 2026
@adk-bot adk-bot closed this Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation merged [Status] This PR is merged request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

message_as_output=True unconditionally set, destroying structured event.output for single_turn agents with output_schema

4 participants