Skip to content

[codex] Add externally provided Codex auth#31274

Merged
pakrym-oai merged 2 commits into
mainfrom
codex/reconcile-external-auth
Jul 8, 2026
Merged

[codex] Add externally provided Codex auth#31274
pakrym-oai merged 2 commits into
mainfrom
codex/reconcile-external-auth

Conversation

@lt-oai

@lt-oai lt-oai commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an in-memory externally provided Codex auth snapshot with explicit runtime capabilities, installed through the existing ExternalAuth provider path.

Testing

  • just fmt-check
  • cargo test -p codex-login --lib externally_provided_auth
  • cargo test -p codex-core --lib external_auth_snapshot_is_installed_from_runtime_config
  • cargo test -p codex-model-provider --lib external_auth
  • cargo test -p codex-mcp-extension --test hosted_apps_mcp hosted_apps_mcp_accepts_external_provided_codex_auth
  • cargo check -p codex-app-server -p codex-core-api -p codex-thread-manager-sample

@lt-oai lt-oai changed the title refactor: reconcile external auth snapshots [codex] Add externally provided Codex auth Jul 6, 2026
@lt-oai lt-oai changed the base branch from codex/cloud-agent-fileparams-bridge to main July 6, 2026 18:22
@lt-oai

lt-oai commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67d318abc9

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

Comment thread codex-rs/model-provider-info/src/lib.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
Comment thread codex-rs/model-provider/src/provider.rs Outdated
@lt-oai lt-oai force-pushed the codex/reconcile-external-auth branch from 67d318a to 075c379 Compare July 6, 2026 21:57
@lt-oai

lt-oai commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 075c379528

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

Comment thread codex-rs/app-server-protocol/src/protocol/common.rs Outdated
Comment thread codex-rs/protocol/src/auth.rs Outdated
pub requires_openai_auth: bool,
/// Whether the active credentials can authenticate Codex backend requests.
#[serde(default)]
pub has_codex_backend_auth: bool,

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.

P3 Badge Document the new account API fields

This changes the v2 account/read response shape, but app-server/README.md still shows response examples without hasCodexBackendAuth and still lists the old account/updated auth-mode values, so clients following the documented app-server contract will implement stale payload handling. Update the app-server README alongside the schema change.

AGENTS.md reference: AGENTS.md:L298-L300

Useful? React with 👍 / 👎.

Comment thread codex-rs/login/src/auth/manager.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
@lt-oai lt-oai force-pushed the codex/reconcile-external-auth branch 2 times, most recently from 362d3e7 to d10e3d9 Compare July 7, 2026 01:31
self.thread_manager
.plugins_manager()
.set_auth_mode(self.auth_manager.get_api_auth_mode());
.set_auth_mode(self.auth_manager.get_plugin_routing_auth_mode());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can this become set_uses_codex_backend?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

get_plugin_routing_auth_mode feels very hacky

Comment thread codex-rs/core/src/config/mod.rs Outdated
/// In-memory auth supplied by a trusted embedding runtime.
///
/// This is never loaded from config files or user overrides.
pub external_auth_snapshot: Option<ExternalAuthSnapshot>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need this on the config?

Comment thread codex-rs/protocol/src/auth.rs Outdated
Comment thread codex-rs/model-provider/src/auth.rs Outdated
Comment thread codex-rs/model-provider/src/provider.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs Outdated
Comment thread codex-rs/login/src/auth/manager.rs Outdated

@pakrym-oai pakrym-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should unify on ExternalAuth returning a ExternalAuthSnapshot instead having double code path of resolve + snapshot and separate auth_mode.

ExternalAuthSnapshot should be deleted from config and provided like we normally provide ExternalAuth (via AuthManager passed into ThreadManager)

@lt-oai lt-oai closed this Jul 7, 2026
@pakrym-oai pakrym-oai reopened this Jul 7, 2026
@pakrym-oai pakrym-oai force-pushed the codex/reconcile-external-auth branch from d10e3d9 to 2e6428a Compare July 7, 2026 17:49
@pakrym-oai pakrym-oai changed the base branch from main to pakrym/unify-external-auth-resolution July 7, 2026 17:50
@pakrym-oai pakrym-oai marked this pull request as ready for review July 7, 2026 17:56
@pakrym-oai pakrym-oai requested a review from a team as a code owner July 7, 2026 17:56
@pakrym-oai

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e6428a59c

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

Comment thread codex-rs/login/src/auth/manager.rs
Comment thread codex-rs/model-provider/src/auth.rs
Comment thread codex-rs/core-api/src/lib.rs
Comment thread codex-rs/app-server-protocol/src/protocol/common.rs
Comment thread codex-rs/app-server-protocol/src/protocol/common.rs
@celia-oai celia-oai self-requested a review July 7, 2026 22:10
Base automatically changed from pakrym/unify-external-auth-resolution to main July 8, 2026 00:05
@pakrym-oai pakrym-oai force-pushed the codex/reconcile-external-auth branch from cbffe23 to de64bf2 Compare July 8, 2026 00:15
@pakrym-oai pakrym-oai enabled auto-merge (squash) July 8, 2026 00:23
@pakrym-oai pakrym-oai dismissed their stale review July 8, 2026 00:43

it's cool now

@pakrym-oai pakrym-oai merged commit 8784de4 into main Jul 8, 2026
63 of 66 checks passed
@pakrym-oai pakrym-oai deleted the codex/reconcile-external-auth branch July 8, 2026 00:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 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.

3 participants