Skip to content

Let the HITL review plugin address one loop pass or mapped slot - #74351

Merged
ashb merged 1 commit into
task-loops-stack-9from
task-loops-stack-10
Oct 10, 2026
Merged

ashb merged 1 commit into
task-loops-stack-9from
task-loops-stack-10

Conversation

@ashb

@ashb ashb commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

The plugin located a task instance by (task_id, map_index) and stored its review
state as XCom under that address. With loop passes sharing a task id and map
index that picks an arbitrary pass, so approving or rejecting could resolve
another pass's session and write the human action to it.

The plugin endpoints now take region_id and region_index and resolve them by
the same live-producer rules as the public API, so an ambiguous selection is
rejected instead of guessed. Reading, writing and checking completion all use
that exact attempt. The review UI forwards the selected task instance's region
coordinates when the host provides them. The plugin also runs on hosts that
predate regions, where an unknown region_id would break the request, so a host
without task instance context keeps the map-only request shape. A modern host
that has not resolved a selection renders no session rather than opening another
task's.

Tests that re-fetch a task instance to run it need the region too, otherwise
they run another pass's row.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@ashb
ashb added this pull request to stack #74339 October 6, 2026 15:06
Comment thread providers/common/ai/src/airflow/providers/common/ai/plugins/hitl_review.py Outdated
Comment thread devel-common/src/tests_common/test_utils/taskinstance.py Outdated
Comment thread providers/common/ai/src/airflow/providers/common/ai/plugins/www/src/main.tsx Outdated
@ashb
ashb force-pushed the task-loops-stack-10 branch from 5cdd01f to 83e0a0a Compare October 7, 2026 13:57
@ashb
ashb removed this pull request from stack #74339 October 7, 2026 15:20
@ashb
ashb force-pushed the task-loops-stack-10 branch from 83e0a0a to 2d7e1f5 Compare October 7, 2026 15:22
@ashb
ashb added this pull request to stack #74410 October 7, 2026 15:22
@ashb
ashb force-pushed the task-loops-stack-10 branch from 2d7e1f5 to 0c53169 Compare October 7, 2026 15:37
@ashb
ashb force-pushed the task-loops-stack-10 branch 2 times, most recently from 73c0b0f to b8944de Compare October 8, 2026 13:56
@ashb
ashb force-pushed the task-loops-stack-10 branch from b8944de to db74ddf Compare October 8, 2026 16:06
Comment thread providers/common/ai/tests/unit/common/ai/plugins/test_hitl_review.py Outdated
Comment thread providers/common/ai/docs/hitl_review.rst Outdated
@ashb
ashb force-pushed the task-loops-stack-10 branch 2 times, most recently from 3f0b2a0 to e42341a Compare October 9, 2026 10:32
@ashb
ashb force-pushed the task-loops-stack-10 branch from e42341a to 7dbd1f3 Compare October 9, 2026 14:03
@ashb
ashb force-pushed the task-loops-stack-10 branch from 7dbd1f3 to 38fbc47 Compare October 9, 2026 16:28
@ashb
ashb force-pushed the task-loops-stack-10 branch from 38fbc47 to 62460d2 Compare October 9, 2026 20:34
@ashb
ashb force-pushed the task-loops-stack-10 branch from 62460d2 to 6ba936b Compare October 9, 2026 20:46
@ashb
ashb force-pushed the task-loops-stack-10 branch from 6ba936b to 0b6d3c2 Compare October 9, 2026 22:18
@ashb
ashb force-pushed the task-loops-stack-10 branch from 0b6d3c2 to 3d8e2a3 Compare October 10, 2026 07:05
@ashb
ashb marked this pull request as ready for review October 10, 2026 13:56
@ashb
ashb force-pushed the task-loops-stack-10 branch from 3d8e2a3 to d3e9ff0 Compare October 10, 2026 14:48
@ashb
ashb force-pushed the task-loops-stack-10 branch from d3e9ff0 to 4a85521 Compare October 10, 2026 16:18
@ashb
ashb force-pushed the task-loops-stack-10 branch from 4a85521 to a31e0da Compare October 10, 2026 17:12
The plugin located a task instance by (task_id, map_index) and stored its review
state as XCom under that address. With loop passes sharing a task id and map
index that picks an arbitrary pass, so approving or rejecting could resolve
another pass's session and write the human action to it.

The plugin endpoints now take region_id and region_index and resolve them by
the same live-producer rules as the public API, so an ambiguous selection is
rejected instead of guessed. Reading, writing and checking completion all use
that exact attempt. The review UI forwards the selected task instance's region
coordinates when the host provides them. The plugin also runs on hosts that
predate regions, where an unknown region_id would break the request, so a host
without task instance context keeps the map-only request shape. A modern host
that has not resolved a selection renders no session rather than opening another
task's.

Tests that re-fetch a task instance to run it need the region too, otherwise
they run another pass's row.
@ashb
ashb force-pushed the task-loops-stack-10 branch from a31e0da to 79b33b2 Compare October 10, 2026 18:24
@ashb
ashb merged commit feafb6c into main Oct 10, 2026
188 of 201 checks passed
@ashb
ashb deleted the task-loops-stack-10 branch October 10, 2026 22:49
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