Skip to content

Preserve native Python provider replay and retry behavior - #6004

Merged
markstuart-oai merged 11 commits into
feat/codex-harnessfrom
codex/parity-python-providers-20261114
Nov 14, 2026
Merged

markstuart-oai merged 11 commits into
feat/codex-harnessfrom
codex/parity-python-providers-20261114

Conversation

@markstuart-oai

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

Copy link
Copy Markdown
Contributor

Summary

This PR preserves provider reasoning, tool media, and usage across native Python retries and resumes. It keeps retries within the authority of the existing provider client. It also keeps the unfinished checkpoint history when an ordinary staged retry follows a rejected input, while retaining the native continuation and accepted tool receipts.

The PyPy job builds a Linux x64 wheel, installs it in a clean environment, and exercises the installed SDK.

Test plan

  • 154 checkpoint and storage cases passed locally across the original run and two targeted reruns. One Windows-only case was skipped on Linux. All three previously failing checkpoint cases also passed against the official Linux release binding.
  • 63 focused provider cases passed for retries, media, request handling, model callbacks, and usage. Eight Gemini cases and 58 API and package surface cases passed separately.
  • All five provider span ownership tests passed after updating the test double to accept the production callback's model keyword.
  • A local PyPy 3.11.17 install passed the SDK's installed-wheel smoke test. Hosted tests and hosted PyPy qualification are in progress.

Checks

  • I've added or updated tests where relevant.
  • I've completed the review required by AGENTS.md.
  • I've confirmed all required checks pass.

@markstuart-oai
markstuart-oai force-pushed the codex/parity-python-providers-20261114 branch from 5998131 to 9613327 Compare November 14, 2026 16:48
@markstuart-oai
markstuart-oai force-pushed the codex/parity-python-runtime-20261114 branch from 2bc7654 to b3da261 Compare November 14, 2026 17:12
@markstuart-oai
markstuart-oai force-pushed the codex/parity-python-providers-20261114 branch 2 times, most recently from 8c199c7 to 8025e6d Compare November 14, 2026 17:21
@markstuart-oai
markstuart-oai marked this pull request as ready for review November 14, 2026 17:27
@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 14, 2026 17:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T18:35:28.147641Z 7a4686c New commits
🔒 Security Review ✅ Completed 2026-11-14T18:35:27.475884Z 7a4686c 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.

@markstuart-oai
markstuart-oai force-pushed the codex/parity-python-providers-20261114 branch from 6d9a6a8 to abcd5a6 Compare November 14, 2026 17:31

@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.

Reviewed provider replay/reasoning/media conversion, response-start and usage accounting, per-attempt borrowed-client retry ownership, LiteLLM header scoping, trace spans, and isolated PyPy wheel qualification, with independent reviewers. No actionable findings. Static review only; no local code or tests executed. Hosted PyPy/native qualification remains pending. This review covers the current stacked diff against codex/parity-python-runtime-20261114.

Base automatically changed from codex/parity-python-runtime-20261114 to feat/codex-harness November 14, 2026 17:41
@markstuart-oai
markstuart-oai force-pushed the codex/parity-python-providers-20261114 branch from abcd5a6 to 387dc61 Compare November 14, 2026 17:42

@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.

Reconfirmed after retargeting to feat/codex-harness. The complete Git tree f090601623906e7f0566b5482fbe46ee9f4875c0 is identical to the comprehensively reviewed abcd5a6 tree. No new actionable findings. Static review only; no local code or tests executed. Hosted PyPy/native qualification remains pending.

@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.

Re-reviewed 14b9f28 with an independent reviewer. The sole incremental change updates the API snapshot to match the already reviewed model declarations and reachable types; public signatures are unchanged. No actionable finding in this increment. Static review only; no candidate code or local tests executed. Hosted CI is pending. Native checkpoint-restore failures observed in the merged base PR #6003 remain under follow-up; this approval does not establish CI qualification.

@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.

Re-reviewed the checkpoint retry fix at 878f4c9 with an independent reviewer. Ordinary staged retries now retain the original unfinished history while preserving the current native continuation, accepted application outputs, and remembered approvals. Source-session and turn ownership checks remain enforced; provider-managed occurrence-projected retries keep their existing path. No actionable findings in this increment. Static review only; no candidate code or local tests executed. Hosted CI remains pending; previously reported failures in the merged base remain separate follow-up items.

@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.

Re-reviewed 00d9f7e with an independent reviewer. The sole incremental change makes the tracing test double accept the keyword-only model argument passed by the production callback and assert the expected None value. Ownership, cancellation, retirement, loop-affinity, and reply assertions remain intact. No actionable findings in this increment. Static review only; no candidate code or local tests executed. Hosted CI remains pending.

@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.

Re-reviewed the sole change since 00d9f7e with an independent reviewer: the Docker qualification fixture now matches mounts by destination instead of assuming Docker inspection order. The hosted failure at the previous commit returned writable before readonly. The new uniqueness and exact-destination-set assertions reject duplicate, missing, and unexpected mounts while preserving bind type, source, and read/write checks. Cold-restore authority rejection, denied writes, persistence, and cleanup assertions remain intact. No new actionable findings.

Static review only; no candidate code or local tests executed. Current-head hosted checks are still pending; this approval does not claim Docker/native qualification has passed.

@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.

Re-reviewed the sole change since 7a4686c with an independent reviewer. The Docker qualification fixture now expects the precise ValueError and executor-policy mismatch message raised by the restore guard. This addresses the remaining 1-failure/7-pass hosted Docker result at the preceding commit. The changed-permissions restore remains rejected; subsequent request-count, filesystem-isolation and container-cleanup assertions are preserved. Three created containers remains correct because the failed restore acquires its environment before policy validation and releases it on the opening-error path. No new actionable findings.

Static source and hosted-log review only; no candidate code or local tests executed. Current-head hosted checks are pending, so this approval does not claim Docker/native qualification has passed.

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Hosted CI follow-up at 96c821b: the Docker qualification run finishes with 1 failure / 7 passes. The mount-order and changed-policy exception checks now pass, but the actual command-output assertion at test_native_docker_path_authority.py:140 exposes an execution failure: exit 101, bubblewrap is unavailable: no system bwrap was found on PATH and no bundled codex-resources/bwrap binary was found next to the Codex executable.

fixture_archive() in packages/codex/tests/test_native_docker_gateway.py:47–67 supplies exec-server, its loader/libraries and the sandbox-helper symlink, but no bubblewrap. Please provide the supported bubblewrap binary and dependencies in the qualification image or helper resources, retaining the sandbox policy and the command-output, read-only/write, persistence and cleanup assertions. The canned model final response does not establish that the filesystem command succeeded; the later safety assertions were not all reached.

The source approval for the exception correction stands. This is a newly exposed qualification dependency blocker, not an established production regression. Static source and hosted-log review only; no local tests run.

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Additional hosted qualification follow-up at 96c821b: Windows 3.10 shard 2 reports 25 failures / 3,717 passes, and macOS sandbox shard 2 reports 12 failures / 3,043 passes. These include previously reported managed-approval failures and incomplete test doubles; they are not all new runtime regressions.

One concrete Windows fixture blocker is test_explicit_enrollment_restores_current_owner_without_factory_replay: its subprocess imports packages/codex/tests/_asyncio.py instead of the standard-library _asyncio extension. That helper imports async_timeout, which accesses the still-partially-initialized asyncio.AbstractEventLoop, so the subprocess fails before exercising session restoration. The launcher executes runtime_handoff_enrollment_process.py directly from that tests directory. Please remove the stdlib-name collision (for example, rename the test helper and update its imports) or otherwise isolate the subprocess import path while retaining the cold-process restore assertion.

Static source and hosted-log review only; no candidate code or local tests executed. Current qualification remains incomplete; the source approval for the exception-only correction is unchanged.

@markstuart-oai
markstuart-oai merged commit c5f0060 into feat/codex-harness Nov 14, 2026
30 of 46 checks passed
@markstuart-oai
markstuart-oai deleted the codex/parity-python-providers-20261114 branch November 14, 2026 19:46
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