Skip to content

fix: bound authentication recovery across transport fallback - #2162

Merged
markstuart-oai merged 38 commits into
feat/codex-harnessfrom
codex/terminal-authentication-retry-v1-6b753b17
Nov 5, 2026
Merged

markstuart-oai merged 38 commits into
feat/codex-harnessfrom
codex/terminal-authentication-retry-v1-6b753b17

Conversation

@markstuart-oai

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

Copy link
Copy Markdown
Contributor

Builds on merged #2172. Current head: 8a22c449, with the exact source tree qualified at 15b9bf5d. The merge adds current v1 ancestry and resolves the historical series conflict without changing source.

Summary

A final HTTP 401 or 403 must end sampling after the provider client's normal credential recovery. Share that recovery budget across WebSocket-to-HTTP fallback so one model request cannot recover twice. Preserve final HTTP metadata and completed tool effects. Independent startup preconnect and later requests keep their own recovery opportunity.

This authentication change targets current v1, including the extracted @openai/agents-codex runtime. Earlier head a580fde7 included the reviewed child-tracing composition from #2179 on v1 512b066a; its auth feature patch remains unchanged.

Test plan

At 15b9bf5d, the normal development producer verifies Core 77c98d47, all 133 native inputs and six physical products. All 26 source authentication cases and 18 authentication tests from freshly installed normal archives pass with no skips. Installed ESM/CommonJS imports pass.

The first cached product failed 11 cases. Invalidating the five changed Cargo source owners and rebuilding the same source cleared all failures; the matching binding changed. Source preparation, cumulative TypeScript checks and integration source reviews pass. Current-head human approval and hosted code/security reviews are complete on 8a22c449. Two independent reviews passed on the complete authentication change. After review, the required full SDK script passed 9,549 tests with 116 skips across 368 passing test files. Source, component, repository and native-product guards remained stable; changeset validation passed.

Final verification used private candidate f57f795c, which integrates actual v1 ee46a255 with public head 8a22c449. Its tree is ac61a34f3e54e7724ecf4d9375ae434fe024df95. The authentication diff and its recorded dependencies remain unchanged across the upstream advances. All 78 native cases in the three updated upstream suites also pass on the qualified Core 77c98d47 product.

Earlier qualification:

The authentic Linux release from alpha run 42008988825 passes all 18 installed-package auth controls and all 26 supported source cases, with no skips. The supported command is pnpm test:native packages/agents-codex/test/native/parity-error-metadata.test.ts --maxWorkers=1. Normal source preparation/audit, test typing, focused lint, five-package JS builds and commit hooks also pass.

The earlier CI merge producer 633cb827 had the identical complete source tree as that earlier qualified head. All five physical SDK archives, starter archive, native input/product hashes, release receipt, helper modes and installed-app/starter receipts verify. The executor fixture retains its original producer identity; its full 45-crate dependency and source closure matches this candidate. Earlier combined Core is 52d2ec0d.

The controls cover terminal 401/403, fresh later requests, cancellation, retained metadata and single tool effects. Two cases finish a real tool turn, await the Core-facing carrier's close handshake, then submit another public request. Each observes two rejected turn-kind WebSocket upgrades and exactly one final HTTP attempt, without repeating the effect. The separate unknown-outcome guard remains unchanged. Earlier Core controls cover successful credential rotation and cross-transport recovery; those production functions are unchanged here.

At that earlier qualification, Linux alpha passed while the other platform and final gates remained pending. The separate policy-isolation correction later landed in #2179. Earlier producers retain their own historical evidence; current validation is recorded above.

Issue number

This covers terminal provider authentication failures under REQ62 and the protection of completed tool effects under REQ63. It does not claim complete acceptance of either requirement.

Checks

  • I've added new tests, if relevant
  • I've added a changeset
  • I've run the full test and example type-check gates on the integrated candidate
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all required verification steps pass
  • I've completed the review required by AGENTS.md

@changeset-bot

changeset-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8a22c44

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@openai/agents Patch
@openai/agents-codex Patch
@openai/agents-core Patch
@openai/agents-extensions Patch
@openai/agents-openai Patch
@openai/agents-realtime Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markstuart-oai
markstuart-oai marked this pull request as ready for review November 5, 2026 05:12
@markstuart-oai
markstuart-oai requested a review from a team as a code owner November 5, 2026 05:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-05T17:39:38.064361Z 8a22c44 Manual request
🔒 Security Review ✅ Completed 2026-11-05T17:39:59.686578Z 8a22c44 Manual request
ℹ️ 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 coordinator and independent static review. The native patch matches the reviewed Python authentication correction: terminal HTTP 401 stops outer sampling retries, client refresh remains bounded, and rejected WebSocket handshakes fall back before prompt dispatch. TS regressions cover preserved status/code/request ID, completed tool effects and cancellation. All eight hosted checks passed on this exact commit. No candidate code or local tests ran.

@markstuart-oai markstuart-oai changed the title fix: stop sampling retries after terminal authentication failure fix: bound authentication recovery across transport fallback Nov 5, 2026
@markstuart-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d08cfd8e0c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d08cfd8e0c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@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 d08cfd8e0c9a53d6f0bc00b3c53501f20e22fb05: approved. Authentication recovery now shares one budget across WebSocket-to-HTTP fallback; terminal 403 joins 401 as non-retryable. Preconnect, warmup and subsequent requests retain independent budgets. Reviewed credential rotation, cancellation, effect preservation and metadata coverage. Hosted CI is still running; this is a code-review approval, not a claim that all checks passed. Static review only; no local tests run.

@markstuart-oai
markstuart-oai force-pushed the codex/terminal-authentication-retry-v1-6b753b17 branch from d08cfd8 to 291d975 Compare November 5, 2026 07: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.

Package relocation and authentication patch rebasing preserve behavior. Updated recovery test distinguishes startup preconnect from the first turn HTTP recovery budget. Node tests, coverage and Windows paths passed; native packaging pending. Static and independent review; hosted CI follow-up remains open; no candidate code or tests executed.

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

Base integration preserves the authentication runtime patch byte-for-byte. Stronger tests distinguish startup prewarm from sampling retries, verify identical retry bodies and prevent repeated tool effects. Static and independent review; hosted CI pending. No candidate code or tests executed.

@markstuart-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 231f7a6aa9

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: 231f7a6aa9

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: a580fde7c2

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a580fde7c2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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 follow-up and independent review. The six-file increment integrates the reviewed child-tracing changes from #2179 at 44f6e78. Child creation context, including absent context, remains authoritative for later steps and direct/CodeMode approvals. Existing feature changes remain intact; no new actionable findings. Hosted native and Node CI remain pending. No candidate code or tests were executed locally.

@markstuart-oai
markstuart-oai changed the base branch from feat/codex-harness to codex/a2a-json-output-req744 November 5, 2026 16:07

Copy link
Copy Markdown
Contributor Author

@codex review
@codex security review

Please review current head 15b9bf5d8994b56bac7520951f2c72da43a73cb7 against its updated dependency branch. The body distinguishes source integration checks from native qualification and hosted CI.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 15b9bf5d89

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 15b9bf5d89

ℹ️ 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".

@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 at 15b9bf5. Authentication recovery remains intact; inherited A2A serialized-result and response-encoding changes compose without regression. Shared tracing/child-admission changes match reviewed 1875314, and patch hashes match the manifests.

Current reported hosted checks: 7 SUCCESS, 1 IN_PROGRESS. Coordinator and independent static review found no actionable integration regressions. No candidate code or local tests executed; no CI reruns requested.

Base automatically changed from codex/a2a-json-output-req744 to feat/codex-harness November 5, 2026 17:28
@markstuart-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 8a22c44991

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8a22c44991

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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 at 8a22c44. This merge has exactly the same complete Git tree (8e405a35f9b3176328de6c4f5d91203fbeee150a) as previously approved 15b9bf5. No new code or substantive unresolved feedback was introduced. Coordinator and independent static review found no actionable source issues.

Current reported hosted CI: {"IN_PROGRESS": 3, "SUCCESS": 5}. No candidate code, local tests, generators, or CI reruns were executed by this reviewer.

@markstuart-oai
markstuart-oai merged commit a3b429b into feat/codex-harness Nov 5, 2026
8 checks passed
@markstuart-oai
markstuart-oai deleted the codex/terminal-authentication-retry-v1-6b753b17 branch November 5, 2026 18:20
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.

3 participants