Skip to content

Fix pulling AgentOperator output for list, marker and function types - #74729

Merged
kaxil merged 5 commits into
apache:mainfrom
FrankYang0529:common-ai-agent-unregistered-model-as-dict
Oct 23, 2026
Merged

kaxil merged 5 commits into
apache:mainfrom
FrankYang0529:common-ai-agent-unregistered-model-as-dict

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Follow-up for #74537 (review).

  • Move the condition that Fix agent HITL review for list, marker and function output types #74537 added to the HITL review path into a new method, _convert_output_for_xcom. Both returns of _complete_run now call this method. Without review, AgentOperator now also pushes a model as a dict when the worker would not register the model's class, for example with output_type=[Summary, int].
  • Rename test_execute_with_hitl_rehydrates_base_model to test_execute_with_hitl_returns_the_model_instance and remove its outdated comment about the JSON string.

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

@FrankYang0529
FrankYang0529 force-pushed the common-ai-agent-unregistered-model-as-dict branch from 4635497 to f1806a4 Compare October 16, 2026 03:30
@FrankYang0529
FrankYang0529 force-pushed the common-ai-agent-unregistered-model-as-dict branch 2 times, most recently from f5d341a to edf86d0 Compare October 20, 2026 10:35
@FrankYang0529
FrankYang0529 force-pushed the common-ai-agent-unregistered-model-as-dict branch from edf86d0 to ecdae8f Compare October 22, 2026 02:54

@kaxil kaxil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, approving. A few nits you can fold in here or leave for later:

The first sentence of the changelog note reads like every model in every output becomes a dict. A plain output_type=Summary that the worker registers still pushes the instance, so I'd lead with the five output types like structured_output.rst does.

timedelta is missing from the HITL lists in structured_output.rst and the changelog note. Plain model_dump() kept it as a timedelta; JSON mode gives you "PT1M30S".

In test_execute_with_hitl_returns_the_model_instance the review text is the same model the agent returned, so the test can't tell which one came back. Having run_hitl_review return '{"text": "Edited"}' instead would catch that.

@kaxil

kaxil commented Oct 22, 2026

Copy link
Copy Markdown
Member

@FrankYang0529 Could you fix those so we can merge the PR, plz

@FrankYang0529
FrankYang0529 force-pushed the common-ai-agent-unregistered-model-as-dict branch from ecdae8f to 8be607e Compare October 23, 2026 05:51
@FrankYang0529

Copy link
Copy Markdown
Member Author

Thanks! I fixed all three nits:

  • The changelog note now leads with the five output types and the worker, like structured_output.rst.
  • Added timedelta to the HITL lists in structured_output.rst and the changelog note.
  • test_execute_with_hitl_returns_the_model_instance now has run_hitl_review return '{"text": "Edited"}'.

@kaxil
kaxil merged commit a706606 into apache:main Oct 23, 2026
74 checks passed
@FrankYang0529
FrankYang0529 deleted the common-ai-agent-unregistered-model-as-dict branch October 24, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants