Skip to content

[codex] add experimental managed Amazon Bedrock login and logout#28148

Closed
celia-oai wants to merge 3 commits into
mainfrom
codex/managed-bedrock-login
Closed

[codex] add experimental managed Amazon Bedrock login and logout#28148
celia-oai wants to merge 3 commits into
mainfrom
codex/managed-bedrock-login

Conversation

@celia-oai

@celia-oai celia-oai commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Why

After #27751, account/read can report whether Amazon Bedrock is using AWS-managed credentials or a Codex-managed API key, but app-server clients still have no matching way to create or remove that managed credential.

This PR adds an experimental managed Amazon Bedrock login/logout flow so app-server clients can onboard Bedrock users without treating a Bedrock API key as general OpenAI authentication. Bedrock credentials stay provider-scoped, while account reporting, request telemetry, CLI status, and diagnostics use the auth mode reported by the active model provider.

What changed

  • Add the experimental amazonBedrock variant to v2 account/login/start, including generated JSON and TypeScript schema updates.
  • Require the experimentalApi initialization capability for managed Bedrock login. The parameterless account/logout remains available as a best-effort cleanup path for clients that cannot use the experimental login method.
  • Trim and validate the API key and Mantle region before changing persisted state, reject managed Bedrock login when external ChatGPT auth is active or ChatGPT login is forced, and allow it when API-key login is forced.
  • Persist the Bedrock API key and region in the configured auth store, reload the AuthManager cache, and keep the credential separate from CodexAuth. General API-key login clears a previously stored Bedrock credential.
  • Write model_provider = "amazon-bedrock" to the user config after login. Logout removes managed Bedrock credentials and clears that user-layer provider only when it still points to amazon-bedrock, preserving a provider value changed after login.
  • Report bedrockApiKey through account/updated and report credentialSource: "codexManaged" through account/read. An app-server already configured for Bedrock reflects transitions between Codex-managed and AWS-managed credentials without a restart.
  • Keep AWS-managed Bedrock logout as a no-op so external AWS credentials, OpenAI auth, and provider config are preserved.
  • Route request telemetry, codex login status, and codex doctor through provider-reported auth mode so managed Bedrock is visible without exposing its API key through the general OpenAI auth path.
  • Document the experimental API behavior in codex-rs/app-server/README.md.

A running session whose active provider is not Bedrock does not live-switch model providers after the config write; a new app-server session or restart picks up the persisted provider. The auth and config writes are also not transactional, so cross-store rollback remains follow-up work.

Verification

  • just test -p codex-app-server-protocol
  • just test -p codex-login
  • just test -p codex-model-provider
  • App-server v2 account integration coverage for managed Bedrock login/logout, capability gating, invalid input, provider overrides, notifications, persistence, and AWS-managed fallback

@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch from 56da969 to 1a11fef Compare June 14, 2026 03:50
@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch from 1a11fef to 6161f76 Compare June 14, 2026 04:03
@celia-oai celia-oai changed the title [codex] add managed Amazon Bedrock login and logout [codex] add experimental managed Amazon Bedrock login and logout Jun 14, 2026
@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch 7 times, most recently from 9fd89f7 to 02699b6 Compare June 14, 2026 06:30
@celia-oai
celia-oai force-pushed the dev/cc/managed-3 branch 2 times, most recently from a028e42 to e0a2c1e Compare June 16, 2026 07:09
Base automatically changed from dev/cc/managed-3 to main June 16, 2026 07:14
@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch 2 times, most recently from c7ebb58 to 297c2f6 Compare June 16, 2026 20:37
@celia-oai celia-oai changed the title [codex] add experimental managed Amazon Bedrock login and logout featL add experimental managed Amazon Bedrock login and logout Jun 16, 2026
@celia-oai celia-oai changed the title featL add experimental managed Amazon Bedrock login and logout feat: add experimental managed Amazon Bedrock login and logout Jun 16, 2026
@celia-oai celia-oai changed the title feat: add experimental managed Amazon Bedrock login and logout [codex] add experimental managed Amazon Bedrock login and logout Jun 16, 2026
@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch 5 times, most recently from 90dc87a to 29993e2 Compare June 17, 2026 00:49
@celia-oai
celia-oai force-pushed the codex/managed-bedrock-login branch from 29993e2 to 0c7bdc7 Compare June 17, 2026 23:20
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Jul 2, 2026
@celia-oai celia-oai reopened this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant