Skip to content

Regenerate types from OpenAPI spec#211

Merged
rgambee merged 2 commits intomainfrom
regenerate-types-from-openapi-spec
Feb 24, 2026
Merged

Regenerate types from OpenAPI spec#211
rgambee merged 2 commits intomainfrom
regenerate-types-from-openapi-spec

Conversation

@rgambee
Copy link
Contributor

@rgambee rgambee commented Feb 24, 2026

I think it's been a while since anyone did this. There are a lot of changes to bring in.

Comment on lines +34 to 44

return response_200

if response.status_code == 404:
response_404 = ErrorResponse.from_dict(response.json())

return response_404

if response.status_code == 409:
response_409 = ErrorResponse.from_dict(response.json())

return response_409

if response.status_code == 422:
response_422 = HTTPValidationError.from_dict(response.json())

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The cancel_task endpoint no longer handles the 409 status code for already-completed tasks. This causes an unhandled UnexpectedStatus exception, contradicting the docstring and crashing calling code.
Severity: CRITICAL

Suggested Fix

Reinstate the handling for the 409 status code in the _parse_response function for the cancel_task endpoint. This will ensure that when a 409 is returned, it is parsed into a proper response object instead of raising an UnexpectedStatus exception, aligning the behavior with the documentation.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
src/everyrow/generated/api/tasks/cancel_task_tasks_task_id_cancel_post.py#L28-L44

Potential issue: The removal of the `409` status code handling in the `_parse_response`
function for the `cancel_task` endpoint will cause an unhandled exception. When a user
attempts to cancel a task that has already completed, the API returns a `409` status.
Because this status is no longer handled, the code falls through to
`client.raise_on_unexpected_status`, which raises an `errors.UnexpectedStatus`
exception. The calling function, `cancel_task()` in `task.py`, does not catch this
exception, causing it to propagate and crash the user's application. This contradicts
the function's docstring, which explicitly states that a `409` is a valid return status.

Did we get this right? 👍 / 👎 to inform future reviews.

@rgambee rgambee merged commit de3dcef into main Feb 24, 2026
10 checks passed
@rgambee rgambee deleted the regenerate-types-from-openapi-spec branch February 24, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant