guan404ming opened a new pull request, #70651:
URL: https://github.com/apache/airflow/pull/70651

   ## Why
   
   - `require_approval=True` was rejected on `LLMBranchOperator`, so there was 
no way for a human to confirm an LLM branching decision before the unselected 
downstream tasks get skipped. Follow-up to #70069, which made that rejection 
explicit; this implements the feature.
   - A branch choice is high impact: once branching runs, skipped tasks do not 
come back, so it is a natural place for a human gate.
   
   ## How
   
   - Pause the task for HITL review after the LLM picks the branch(es); run 
`do_branch` only after the reviewer approves.
   - Validate reviewer-modified branch(es) against the downstream task IDs 
before branching (with `allow_multiple_branches=True` the reviewed value is a 
JSON list of task IDs).
   - Reject non-string prompts with `require_approval=True` before the agent 
runs, in both the operator and `@task.llm_branch`.
   
   Verified end to end in breeze: task paused in `awaiting_input`, the reviewer 
changed the LLM's choice via the HITL API and approved, and the modified branch 
ran while the original choice was skipped.
   
   related: #70069
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5)
   
   Generated-by: Claude Code (Fable 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to