Skip to content

Support require_approval in LLMBranchOperator - #70651

Merged
guan404ming merged 4 commits into
apache:mainfrom
guan404ming:llm-branch-require-approval
Aug 4, 2026
Merged

Support require_approval in LLMBranchOperator#70651
guan404ming merged 4 commits into
apache:mainfrom
guan404ming:llm-branch-require-approval

Conversation

@guan404ming

@guan404ming guan404ming commented Jul 28, 2026

Copy link
Copy Markdown
Member

Why

  • require_approval=True was rejected on LLMBranchOperator; this implements it.
  • Branching skips tasks irreversibly, so worth a human gate.

How

  • Pause for HITL review; run do_branch only after approval.
  • Validate reviewer-modified branches against downstream task IDs.
  • Reject non-string prompts with require_approval before agent runs.

E2E verified in breeze: pause, modified approval, correct skip.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

Comment thread providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py Outdated
Comment thread providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py Outdated
Comment thread providers/common/ai/docs/operators/llm_branch.rst Outdated
@kaxil

kaxil commented Jul 30, 2026

Copy link
Copy Markdown
Member

Screenshot/video of how it works e2e would be ideal

Reviewers previously had to recall downstream task IDs from memory when
modifying a choice, and an empty reviewed list silently skipped every
downstream task. The review form now lists valid branches and renders a
dropdown for single-branch mode, empty selections are rejected, and the
duplicated require_approval prompt check lives on the approval mixin.
@guan404ming
guan404ming force-pushed the llm-branch-require-approval branch from c70e92b to 533dda9 Compare August 3, 2026 02:08
@guan404ming

Copy link
Copy Markdown
Member Author

Attached an e2e demo: trigger, review with branch dropdown, approve modified choice, downstream branches run/skip.

llm_branch_approval_demo.webm

Comment thread providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py Outdated
Comment thread providers/common/ai/docs/operators/llm_branch.rst
@guan404ming

guan404ming commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review, I'll merge this first and will follow up to refine this.

@guan404ming
guan404ming merged commit bbb3c06 into apache:main Aug 4, 2026
83 checks passed
@guan404ming
guan404ming deleted the llm-branch-require-approval branch August 4, 2026 08:37
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