Skip to content

fix(evaluator): isolate uploaded patches between cases - #376

Merged
zpzjzj merged 1 commit into
alibaba:mainfrom
karanb192:fix/isolate-apply-diff
Nov 6, 2026
Merged

zpzjzj merged 1 commit into
alibaba:mainfrom
karanb192:fix/isolate-apply-diff

Conversation

@karanb192

@karanb192 karanb192 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

context.git.apply_diff uploaded each patch to os.TempDir() plus its basename. On the none runtime, parallel cases with different patches named changes.patch could overwrite that shared file and apply the wrong patch. The uploaded file was also left behind after the call.

Each invocation now uploads to a unique, workspace-relative filename and attempts to remove it before returning.

Related issues

None found. Direct bug-fix PR.

Changes

  • Use a UUID filename in the runtime workspace instead of a host-temp path derived from the source name. This also avoids sending a host-specific absolute path to remote runtimes.
  • Defer cleanup before uploading, so it also covers partial uploads, failed git apply, execution errors, and cancellation. Cleanup has its own 10-second context; a cleanup failure logs a warning without replacing the upload/apply result.
  • Add a deterministic concurrency test that finishes both uploads before either case applies its patch, plus cleanup tests using a real local runtime. The old command-string quoting test is replaced by these tests, which use source names with spaces, quotes, and a semicolon.
  • Update the changelog.

Test plan

Rebased onto 4234ca2. The code and test patch is unchanged from 176ac4b; the range-diff changes only changelog context. Verification on b65734a:

  • The concurrency test reproduces one case receiving the other's patch on the pre-fix code. All five cleanup cases also fail there.
  • make verify passes with zero findings.
  • go test -race ./... passes, including the patch isolation and cleanup tests.
  • Codex plugin unit tests pass (22 tests).
  • go test -tags e2e ./e2e passes with agent CLIs absent from PATH.

The skill regression scripts included in make test were not rerun for this rebase.

Notes for reviewers

Cleanup is best-effort if the runtime is unavailable. The new tests execute the none runtime; no live Docker or OpenSandbox run was used for this change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T08:08:17.899413Z b1f62cf PR opened
ℹ️ 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.

@zpzjzj zpzjzj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@karanb192
karanb192 force-pushed the fix/isolate-apply-diff branch from b1f62cf to 176ac4b Compare November 4, 2026 03:10
@zpzjzj
zpzjzj enabled auto-merge November 5, 2026 03:26
auto-merge was automatically disabled November 5, 2026 07:56

Head branch was pushed to by a user without write access

@karanb192
karanb192 force-pushed the fix/isolate-apply-diff branch from 176ac4b to b65734a Compare November 5, 2026 07:56
@zpzjzj
zpzjzj added this pull request to the merge queue Nov 6, 2026
Merged via the queue into alibaba:main with commit bd99815 Nov 6, 2026
14 checks passed
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.

2 participants