Skip to content

common.ai: Park approval reviews in awaiting_input on Airflow 3.3+#68489

Merged
kaxil merged 1 commit into
apache:mainfrom
astronomer:commonai-approval-awaiting-input
Jun 16, 2026
Merged

common.ai: Park approval reviews in awaiting_input on Airflow 3.3+#68489
kaxil merged 1 commit into
apache:mainfrom
astronomer:commonai-approval-awaiting-input

Conversation

@kaxil

@kaxil kaxil commented Jun 12, 2026

Copy link
Copy Markdown
Member

LLMApprovalMixin (require_approval=True on LLMOperator / AgentOperator) now raises TaskAwaitingInput on Airflow 3.3+, parking the review in the first-class awaiting_input state (#68028) with no trigger or triggerer involved, matching the standard provider's HITLOperator. On older cores it falls back to deferring to HITLTrigger unchanged, gated on AIRFLOW_V_3_3_PLUS.

Why:

  • The triggerer no longer needs to run for approval pipelines to make progress. Resumption is driven by the Core API response handler or the scheduler's timeout sweep, which also enforces approval_timeout on 3.3+ with the same timeout-event semantics as HITLTrigger.
  • Together with airflow dags test resolving awaiting_input tasks interactively, review pipelines become runnable end to end locally. Verified in breeze with pydantic-ai's TestModel: the task parks in awaiting_input, an approval with reviewer-modified output resumes it, and the modified output flows downstream as the task result.

One behavior fix rides along: on the legacy path HITLTrigger schema-validated params_input before resuming, but nothing does on the awaiting_input path (the Core API route validates chosen options and cardinality only). execute_complete now enforces the string contract for reviewer-modified output and raises HITLTriggerEventError with error_type="validation" for non-string values. Previously on this path an API client could make the operator return a dict where the declared output contract is str.

The dependency floor moves to apache-airflow-providers-common-compat>=1.15.0, the first release with the AIRFLOW_V_3_3_PLUS flag.

@gopidesupavan gopidesupavan 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.

cool :) thats a really nice change.. need to catchup more on the actual pr

@gopidesupavan

Copy link
Copy Markdown
Member

seems tests not triggered ?

@eladkal

eladkal commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

seems there are conflicts

@kaxil kaxil force-pushed the commonai-approval-awaiting-input branch 2 times, most recently from be41401 to cfaf01f Compare June 15, 2026 22:39
LLMApprovalMixin (require_approval=True on LLMOperator/AgentOperator) now
raises TaskAwaitingInput on Airflow 3.3+ so the task parks in the
first-class awaiting_input state -- no trigger or triggerer involved --
matching the standard provider's HITLOperator. On older cores it falls
back to deferring to HITLTrigger as before. The response deadline is
enforced by the scheduler's awaiting_input timeout sweep on 3.3+.

Because nothing upstream schema-validates params_input on the
awaiting_input path (HITLTrigger did on the legacy path),
execute_complete now enforces the string contract for reviewer-modified
output and raises HITLTriggerEventError for non-string values.

The AIRFLOW_V_3_3_PLUS flag this uses was added in
apache-airflow-providers-common-compat 1.15.0; the dependency line is
marked "# use next version" so the release manager bumps the floor at
release time.
@kaxil kaxil force-pushed the commonai-approval-awaiting-input branch from cfaf01f to c7509c5 Compare June 16, 2026 10:43
@kaxil kaxil merged commit c03460e into apache:main Jun 16, 2026
92 checks passed
@kaxil kaxil deleted the commonai-approval-awaiting-input branch June 16, 2026 12:01
RulerChen pushed a commit to RulerChen/airflow that referenced this pull request Jun 16, 2026
…pache#68489)

LLMApprovalMixin (require_approval=True on LLMOperator/AgentOperator) now
raises TaskAwaitingInput on Airflow 3.3+ so the task parks in the
first-class awaiting_input state -- no trigger or triggerer involved --
matching the standard provider's HITLOperator. On older cores it falls
back to deferring to HITLTrigger as before. The response deadline is
enforced by the scheduler's awaiting_input timeout sweep on 3.3+.

Because nothing upstream schema-validates params_input on the
awaiting_input path (HITLTrigger did on the legacy path),
execute_complete now enforces the string contract for reviewer-modified
output and raises HITLTriggerEventError for non-string values.

The AIRFLOW_V_3_3_PLUS flag this uses was added in
apache-airflow-providers-common-compat 1.15.0; the dependency line is
marked "# use next version" so the release manager bumps the floor at
release time.
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.

3 participants