The GitHub Actions job "Tests (AMD)" on 
airflow.git/fix-hitl-review-output-type-loss has failed.
Run started by GitHub user ColtenOuO (triggered by ColtenOuO).

Head commit for run:
a632d04087adc871a7d1687bb99f58ec12d9bfcc / ColtenOuO <[email protected]>
Fix output type loss in AgentOperator's human-in-the-loop review

Add dump_output_to_json() to utils/output_type.py, alongside
rehydrate_pydantic_output(), so both directions of the review round-trip
live in one module. Route all three serialization sites through it:
HITLReviewMixin._to_string, AgentOperator.regenerate_with_feedback and
LLMApprovalMixin.defer_for_approval.

Serialize non-str, non-BaseModel output with TypeAdapter(...).dump_json()
rather than str(output), which produced a Python repr instead of JSON, and
fall back to str(output) when the value's type has no pydantic schema.

Split schema build from validation in rehydrate_pydantic_output(). An
output_type that TypeAdapter cannot build a schema for now falls back to
json.loads() instead of raising PydanticSchemaGenerationError or
AttributeError, neither of which the previous except clause caught.

Use rehydrate_pydantic_output() in AgentOperator.execute()'s HITL branch in
place of the bespoke json.loads()/except fallback. With the default
output_type=str the approved string is no longer parsed as JSON.

Add tests for both schema-build guards, for dump_output_to_json(), and for
output_type=str with a JSON-parseable approved string, and fold the four
TestToString cases into a single delegation test.

Report URL: https://github.com/apache/airflow/actions/runs/30743035213

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to