Skip to content

feat: add opt-in provider runtime abstraction#17713

Merged
celia-oai merged 8 commits intomainfrom
dev/cc/provider
Apr 17, 2026
Merged

feat: add opt-in provider runtime abstraction#17713
celia-oai merged 8 commits intomainfrom
dev/cc/provider

Conversation

@celia-oai
Copy link
Copy Markdown
Collaborator

@celia-oai celia-oai commented Apr 13, 2026

Summary

  • Add codex-model-provider as the runtime home for model-provider behavior that does not belong in codex-core, codex-login, or codex-api.
  • The new crate wraps configured ModelProviderInfo in a ModelProvider trait object that can resolve the API provider config, provider-scoped auth manager, and request auth provider for each call.
  • This centralizes provider auth behavior in one place today, and gives us an extension point for future provider-specific auth, model listing, request setup, and related runtime behavior.

Tests

Ran tests manually to make sure that provider auth under different configs still work as expected.

@celia-oai celia-oai force-pushed the dev/cc/provider branch 6 times, most recently from 7796ab2 to 4d9d09d Compare April 14, 2026 04:47
@celia-oai celia-oai changed the title draft feat: add opt-in provider runtime abstraction Apr 14, 2026
@celia-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@celia-oai celia-oai marked this pull request as ready for review April 14, 2026 06:06
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

let auth_env_telemetry = collect_auth_env_telemetry(
&session_configuration.provider,
auth_manager.codex_api_key_env_enabled(),

P2 Badge Use runtime auth source when building session telemetry

Session::new still builds auth-env telemetry from the legacy provider and base auth manager. When ProviderRuntime::Resolved is active, request auth can come from resolved auth state (env/static/command) and a different auth manager, so startup telemetry reports incorrect auth-env context and can mislead diagnostics.

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

@celia-oai
Copy link
Copy Markdown
Collaborator Author

💡 Codex Review

let auth_env_telemetry = collect_auth_env_telemetry(
&session_configuration.provider,
auth_manager.codex_api_key_env_enabled(),

P2 Badge Use runtime auth source when building session telemetry
Session::new still builds auth-env telemetry from the legacy provider and base auth manager. When ProviderRuntime::Resolved is active, request auth can come from resolved auth state (env/static/command) and a different auth manager, so startup telemetry reports incorrect auth-env context and can mislead diagnostics.

ℹ️ About Codex in GitHub

this seems to be a small tech debt. Cleaning it up as part of this PR.

@celia-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

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

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

@celia-oai celia-oai requested a review from pakrym-oai April 14, 2026 06:44
Comment thread codex-rs/core/src/config/config_tests.rs Outdated
Comment thread codex-rs/model-provider/src/lib.rs Outdated
Comment thread codex-rs/model-provider/src/lib.rs Outdated
@celia-oai celia-oai force-pushed the dev/cc/provider branch 7 times, most recently from 84c82b0 to b5c6093 Compare April 14, 2026 22:49
@celia-oai celia-oai requested a review from pakrym-oai April 14, 2026 23:07
@celia-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@celia-oai celia-oai force-pushed the dev/cc/provider branch 2 times, most recently from a13e12b to 4393774 Compare April 15, 2026 19:45
@celia-oai celia-oai force-pushed the dev/cc/provider branch 2 times, most recently from c6f1a7d to 995e851 Compare April 16, 2026 03:50
@celia-oai celia-oai requested a review from pakrym-oai April 16, 2026 03:52
@celia-oai celia-oai force-pushed the dev/cc/provider branch 7 times, most recently from ee65513 to 7d0908f Compare April 17, 2026 01:09
@celia-oai celia-oai enabled auto-merge (squash) April 17, 2026 01:09
@celia-oai celia-oai force-pushed the dev/cc/provider branch 2 times, most recently from 8d91aed to fb75598 Compare April 17, 2026 01:16
@celia-oai celia-oai disabled auto-merge April 17, 2026 01:17
@celia-oai celia-oai enabled auto-merge (squash) April 17, 2026 02:05
@celia-oai celia-oai merged commit a803790 into main Apr 17, 2026
28 checks passed
@celia-oai celia-oai deleted the dev/cc/provider branch April 17, 2026 02:27
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 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.

2 participants