Skip to content

fix(evals): use cancel endpoint for evaluation runs - #3812

Open
arvindg-openai wants to merge 2 commits into
openai:mainfrom
arvindg-openai:codex/fix-eval-run-cancel-endpoint
Open

fix(evals): use cancel endpoint for evaluation runs#3812
arvindg-openai wants to merge 2 commits into
openai:mainfrom
arvindg-openai:codex/fix-eval-run-cancel-endpoint

Conversation

@arvindg-openai

Copy link
Copy Markdown
  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Append /cancel to the request path in both Runs.cancel and AsyncRuns.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.
  • Generated-code budget check against the public snapshot: passed (6,630 custom lines; limit 10,000).

The unchanged checkout reports a stale lockfile under uv sync --locked --all-extras. Tests used the exact committed dependencies installed with uv sync --frozen --all-extras; no dependency or lockfile changes are included.

@arvindg-openai
arvindg-openai marked this pull request as ready for review September 9, 2026 11:04
@arvindg-openai
arvindg-openai requested a review from a team as a code owner September 9, 2026 11:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T11:07:13.348539Z 9019df9 Draft marked ready
🔒 Security Review Completed 2026-09-09T11:11:40.031271Z 9019df9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9019df92c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

raise ValueError(f"Expected a non-empty value for `run_id` but received {run_id!r}")
return self._post(
path_template("/evals/{eval_id}/runs/{run_id}", eval_id=eval_id, run_id=run_id),
path_template("/evals/{eval_id}/runs/{run_id}/cancel", eval_id=eval_id, run_id=run_id),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate the API contract alongside this route change

When the full ./scripts/test suite runs, it starts Steady from the checked-in api_reference/openapi.transformed.yml, where cancelEvalRun is still defined as POST /evals/{eval_id}/runs/{run_id}. Consequently, the existing sync and async cancellation tests in tests/api_resources/evals/test_runs.py now request an unmatched /cancel route and fail, while the new isolated MockTransport tests conceal the contract mismatch; api.md also continues documenting the old path. Update the generation source and regenerate the contract, generated client, tests, and documentation together.

AGENTS.md reference: AGENTS.md:L3-L8

Useful? React with 👍 / 👎.

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