Repository navigation
Refuse Human-in-the-loop responses once the task stopped waiting - #75645
Merged
vatsrahul1001 merged 3 commits intoOct 26, 2026
Merged
vatsrahul1001 merged 3 commits into
vatsrahul1001 merged 3 commits into
Conversation
Lee-W
force-pushed
the
hitl-reject-response-after-stopped-waiting
branch
2 times, most recently
from
October 26, 2026 10:30
9d56237 to
88b398f
Compare
Lee-W
marked this pull request as ready for review
October 26, 2026 10:36
Lee-W
requested review from
bbovenzi,
bugraoz93,
choo121600,
ephraimbuddy,
guan404ming,
henry3260,
jason810496,
pierrejeambrun,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
October 26, 2026 10:36
Lee-W
force-pushed
the
hitl-reject-response-after-stopped-waiting
branch
from
October 26, 2026 10:38
88b398f to
c58e0c9
Compare
The hitlDetails PATCH recorded a response whenever none existed yet and only resumed the task if it was still awaiting input or deferred. After a response_timeout without defaults, an answer was stored and returned 200 although nothing resumed, so the UI reported success for a decision that never took effect. Return 409 before writing when the task instance is in any other state. The check runs under the existing task instance lock, after the authorization and option validation, and looks at the state only: a request whose timeout has passed but that the scheduler has not yet processed is still accepted.
The error toast showed only the HTTP status text ("Conflict") when a
response was refused. Show the detail the backend returns, such as that
the task is no longer waiting for a response, and fall back to the
previous message when there is none.
Lee-W
force-pushed
the
hitl-reject-response-after-stopped-waiting
branch
from
October 26, 2026 13:45
c58e0c9 to
b53a232
Compare
vatsrahul1001
approved these changes
Oct 26, 2026
Contributor
Backport failed to create: v3-4-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker d1491b8 v3-4-testThis should apply the commit to the v3-4-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 27, 2026
) (#75706) * Refuse Human-in-the-loop responses once the task stopped waiting The hitlDetails PATCH recorded a response whenever none existed yet and only resumed the task if it was still awaiting input or deferred. After a response_timeout without defaults, an answer was stored and returned 200 although nothing resumed, so the UI reported success for a decision that never took effect. Return 409 before writing when the task instance is in any other state. The check runs under the existing task instance lock, after the authorization and option validation, and looks at the state only: a request whose timeout has passed but that the scheduler has not yet processed is still accepted. * Show why the backend refused a Human-in-the-loop response The error toast showed only the HTTP status text ("Conflict") when a response was refused. Show the detail the backend returns, such as that the task is no longer waiting for a response, and fall back to the previous message when there is none. * Cover the refusal toast for validation, mapping, missing and forbidden details (cherry picked from commit d1491b8)
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Once a Human-in-the-loop task stops waiting, for example after its
response_timeoutexpires and it fails because no defaults were set, the
hitlDetailsPATCH used to keepaccepting answers. The answer was stored and the API returned 200, but nothing resumed the task. A user answering from a page that was still open saw a success message for a decision that never took effect.
The UI error toast made the refusal hard to understand as well: it only showed the HTTP
status text ("Conflict"), which says nothing about why the answer was not accepted.
Closes: #75531
What
hitlDetailsPATCH returns 409 and records nothing when the task instance is notwaiting (
awaiting_inputordeferred). The check runs under the existing task instance lock, after authorization and option validation, so it cannot interleave with a concurrent clear.message when there is none.
Behaviour worth calling out for review:
createErrorToasteris not changed. It is used in roughly 20 places across the UI, and changing its behaviour would affect all of them. The detail handling lives inuseUpdateHITLDetail, and 403 is still left to theMutationCachehandler as before.Was generative AI tooling used to co-author this PR?
Generated-by: [Claude] following the guidelines
{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.