fix(evals): use cancel endpoint for evaluation runs - #3812
Draft
arvindg-openai wants to merge 1 commit into
Draft
Conversation
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.
Changes being requested
Append
/cancelto the request path in bothRuns.cancelandAsyncRuns.cancel. They currently send POST requests to/evals/{eval_id}/runs/{run_id}.Add mocked HTTP transport regressions that assert the POST method and full cancellation URL for synchronous and asynchronous clients, including parsed, raw, and streaming response modes. All six cases fail before the endpoint correction and pass afterward.
Additional context & links
The curl example in the public Cancel an eval run reference uses
/evals/{eval_id}/runs/{run_id}/cancel. The endpoint heading on that page currently omits/cancel; this change follows the HTTP example.The resource file is generated. Please incorporate the endpoint correction into the generation source so subsequent regeneration retains it. This PR preserves the method signatures, options, and response types.
Validation
.venv/bin/python -m pytest tests/test_eval_run_cancel.py -q -n 0: 6 passed; the same tests fail against the original code..venv/bin/ruff check .: passed..venv/bin/ruff format --check src/openai/resources/evals/runs/runs.py tests/test_eval_run_cancel.py: passed.git diff --check: passed.The unchanged checkout reports a stale lockfile under
uv sync --locked --all-extras. Tests used the exact committed dependencies installed withuv sync --frozen --all-extras; no dependency or lockfile changes are included.