Skip to content

Human-in-the-loop form gives a generic "Validation Error" when no option is chosen #75532

Closed

Description

@shivaam

Under which category would you file this issue?

Airflow Core (UI)

Apache Airflow version

main (57a4751c967)

What happened and how to reproduce it?

  • On a Human-in-the-loop request with several options and multiple=True, the Respond button is
    enabled with nothing selected.
  • Submitting sends an empty chosen_options, which the API rejects with 422 (min_length=1).
  • The form shows only "Response failed / Validation Error". The request correctly stays pending, and
    a later valid answer completes it.

Reproduce:

  1. Run HITLOperator(subject="Pick colours", options=["red", "green", "blue"], multiple=True).
  2. Open Required Actions, select nothing, and click Respond.

What you think should happen instead?

  • Main ask: the form doesn't let an empty answer through. Respond stays disabled until at least
    one option is chosen, with a short inline hint such as "Select at least one option". No error is
    ever shown for this case, and the fix stays inside
    airflow-core/src/airflow/ui/src/pages/HITLTaskInstances/HITLResponseForm.tsx.

Anything else?

  • Why the message is generic:
    • createErrorToaster (ui/src/utils/errorHandling.ts) shows error.message.
    • For the generated API client, that is the OpenAPI description of the 422 response, which
      FastAPI always calls "Validation Error".
    • The actual reason, in the response body, is never shown. Here it is "List should have at
      least 1 item after validation, not 0".
  • Broader follow-up: surface the response body's reason in error toasts, so other 422s on this
    form say what was wrong. This can be separate from the fix above.
  • The main ask is small and self-contained, which makes it a reasonable first issue for someone new
    to the UI code.

Drafted-by: Claude Code (Opus 5.5) (no human review before posting)

Activity

  1. BaconMan1168 commented on Oct 24, 2026

    @BaconMan1168

    I'd like to work on this. My plan is to keep the Respond button disabled until at least one option is chosen, show a short hint under the options, and add a test in HITLResponseForm.test.tsx. I'll leave the error toast follow-up for a separate change.

  2. estella00911 commented on Oct 24, 2026

    @estella00911

    Hi, I'd like to clarify the expected UX for the inline hint.

    I reproduced the issue locally and noticed the following:

    • The existing helper text is always shown, whether an option is selected or not.
    • Clearing the selection makes the section title turn red with an error icon.
    • The helper text is displayed by the shared FieldRow component.

    For the "Select at least one option" hint, what would you expect? I've listed two ideas below:

    1. Show a field validation error below the options field, replacing the existing helper text?
    2. Show a separate inline hint near the disabled Respond button, keeping the existing helper text?

    I'm asking because the first approach might require changes to FieldRow, while the issue suggests keeping the fix in HITLResponseForm.tsx.

    Thanks!

    Image

    Screenshot after clearing the selection (Respond disabled by my local change).

    AI-assisted wording, reviewed by me.

  3. added
    priority:highHigh priority bug that should be patched quickly but does not require immediate new release
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected_version:3.4.0rcCan be used for bugs identified during 3.4.0 testingneeds-triagelabel for new issues that we didn't triage yetpriority:highHigh priority bug that should be patched quickly but does not require immediate new release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions