Skip to content

test(models): restore AnyLLM module bindings after each test - #6108

Merged
markstuart-oai merged 5 commits into
feat/simple-codexfrom
test/simple-codex-fixtures
Nov 21, 2026
Merged

markstuart-oai merged 5 commits into
feat/simple-codexfrom
test/simple-codex-fixtures

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The AnyLLM tests have been importing the adapter against a temporary provider. On a worker that has yet to import the adapter, teardown has been leaving the temporary module in sys.modules and on the parent package. Later tests on that worker can pick up the stub. Register both bindings with monkeypatch before the import so teardown restores the worker's original state.

This PR is the first of three targeting feat/simple-codex, followed by #6105 and #6106. After #6111, the target branch already handles Windows image paths, the native provider, and the filesystem test fixture. The diff here covers the AnyLLM fixture and its regression test.

Test plan

  • Reproduced the leak on cbbb009c with a worker importing the adapter for the first time. Checked teardown with both a fresh import and a preexisting module. All 102 tests in the AnyLLM module passed.
  • Ran the SDK verification script on this PR's tree. Formatting, lint, mypy, and Pyright passed. Pytest passed 12,878 parallel and 107 serial tests, with 37 skips across the two runs.

Checks

  • Exercised both initial import states in the regression test.
  • Completed independent review of the single-file diff.
  • Ran .agents/skills/code-change-verification/scripts/run.sh.
  • Confirmed all local verification steps passed.

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 20, 2026 08:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T01:43:45.800847Z a67bfc0 New commits
🔒 Security Review ✅ Completed 2026-11-21T01:44:28.062751Z a67bfc0 New commits
ℹ️ 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.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static review and an independent second review. The AnyLLM fixture restores both module bindings for absent and preexisting imports. Deferred Unix-only imports preserve portable test collection, and the app-server fixture uses the current Python executable with the launcher’s actual argument/cwd behavior. No new actionable findings. Windows CI is not fully repaired: hosted Windows 3.13 logs show the existing selector-event-loop subprocess and Windows file-URI failures, now exposed after collection succeeds.

Hosted check snapshot: {"SKIPPED": 2, "SUCCESS": 17, "FAILURE": 2}. Both Windows test jobs fail on existing selector-loop subprocess and Windows file-URI issues; the other 17 checks passed. Static review only; no candidate code or local tests were executed.

@markstuart-oai markstuart-oai changed the title test: make Codex fixtures portable and isolate AnyLLM imports fix(codex): support Windows image paths and portable provider tests Nov 20, 2026

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved the incremental Windows fixes after static review and an independent second review. Absolute paths are recognized before URL parsing, platform-aware file-URI decoding preserves drive letters and escaped characters, and remote file authorities remain rejected. The Windows-only model test configuration uses a subprocess-capable Proactor loop through the installed pytest-asyncio hook. Reviewed path/URI regression coverage; no new actionable findings.

Hosted checks completed: 19 passed, 2 skipped, including both Windows test versions and the Windows packaged-contract check. No candidate code or local tests were executed.

@markstuart-oai markstuart-oai changed the title fix(codex): support Windows image paths and portable provider tests test(models): restore AnyLLM module bindings after each test Nov 21, 2026

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved the current commit after two independent static reviews. The fixture now registers both module bindings even when initially absent, removes the temporary sentinels before import, and restores either the prior module or absence on teardown. The regression covers both initial states. Reviewed the current single-file diff against the updated target branch; no actionable findings.

Hosted checks completed: 19 passed, two skipped; none failed or pending. Static review only; no candidate code or local tests executed.

@markstuart-oai
markstuart-oai merged commit 6ba4454 into feat/simple-codex Nov 21, 2026
23 checks passed
@markstuart-oai
markstuart-oai deleted the test/simple-codex-fixtures branch November 21, 2026 02:18
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