Skip to content

[Bug]: REST listTasks rejects valid status strings with 500 #577

@hae02y

Description

@hae02y

What happened?

Is your feature request related to a problem? Please describe.

  • GET /tasks?status=working (or input-required, etc.) causes an IllegalArgumentException because the REST handler uses TaskState.valueOf(status). That method only accepts enum names like WORKING, so valid wire strings
    fail and end up as a 500 InternalError.

Describe the solution you'd like

  • Parse the status using TaskState.fromString(status) and, on invalid values, return InvalidParamsError (HTTP 422).

Describe alternatives you've considered

  • None.

Additional context

  • The REST API expects wire strings (working, input-required, etc.) but the handler currently expects enum names. This is why valid requests fail.
  • RestHandler.mapErrorToHttpStatus already maps InvalidParamsError to 422, so returning 500 here looks unintended.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions