Skip to content

Centralize provider request preparation auth checks - #58121

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ed8710d1c344b48ebf6182e25e6269214dd2d3fe
Oct 29, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ed8710d1c344b48ebf6182e25e6269214dd2d3fe

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Centralize provider request preparation auth checks

What changed

Move the model client's request-preparation loop into the shared prepare_provider_request helper and add RequestAuthChange to classify auth state changes. For managed auth, retry preparation when credentials change and reject account changes, including when the provider starts or stops exposing an auth manager during setup.

Capture the auth owner and credential generations together and pass them into the preparation callback so the resulting client setup records the state used for that attempt.

Testing

Add a test verifying that an explicit provider bearer token survives a workspace switch during setup without retrying preparation.

## What changed

Move the model client's request-preparation loop into the shared `prepare_provider_request` helper and add `RequestAuthChange` to classify auth state changes. For managed auth, retry preparation when credentials change and reject account changes, including when the provider starts or stops exposing an auth manager during setup.

Capture the auth owner and credential generations together and pass them into the preparation callback so the resulting client setup records the state used for that attempt.

## Testing

Add a test verifying that an explicit provider bearer token survives a workspace switch during setup without retrying preparation.

GitOrigin-RevId: ed8710d1c344b48ebf6182e25e6269214dd2d3fe
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ed8710d1c344b48ebf6182e25e6269214dd2d3fe branch from 8944399 to 53d3d7f Compare October 29, 2026 16:39
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T16:39:53.568562Z 8944399 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.

@copyberry
copyberry Bot merged commit 53d3d7f into main Oct 29, 2026
7 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ed8710d1c344b48ebf6182e25e6269214dd2d3fe branch October 29, 2026 16:39
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant