Skip to content

[codex] Implement managed Bedrock logout#31325

Draft
celia-oai wants to merge 1 commit into
codex/managed-bedrock-login-v2from
codex/managed-bedrock-logout
Draft

[codex] Implement managed Bedrock logout#31325
celia-oai wants to merge 1 commit into
codex/managed-bedrock-login-v2from
codex/managed-bedrock-logout

Conversation

@celia-oai

@celia-oai celia-oai commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Why

Managed Bedrock API keys are primary CodexAuth values and can use the existing generic logout path. AWS-managed Bedrock credentials are different: they live outside Codex, and logging out while that provider is active must not delete an unrelated stored OpenAI or ChatGPT login.

Logout also needs to remove the user-level Bedrock provider default without overwriting a concurrent config change.

What changed

  • Detect managed Bedrock logout from the current cached CodexAuth::BedrockApiKey value.
  • Use the existing generic AuthManager::logout_with_revoke path for managed Bedrock auth.
  • Clear the user-level model_provider only when it is still "amazon-bedrock", using the config-layer version as a compare-and-set guard.
  • Make logout a no-op when the active Bedrock provider is using the external AWS credential chain.
  • Preserve unrelated OpenAI auth and provider config in the AWS-managed case.
  • Emit account updates from the resulting primary auth state.
  • Add integration coverage for managed logout, AWS-managed no-op behavior, config preservation, and logout without the experimental login capability.

Impact

Logging out of Codex-managed Bedrock removes the primary Bedrock credential and safely clears the persisted Bedrock default. AWS SDK-chain credentials remain untouched.

Validation

  • just test -p codex-app-server -E 'test(/suite::v2::account/)' — 40 passed
  • just fix -p codex-app-server -p codex-app-server-protocol -p codex-model-provider

Stack

  1. [codex] Add managed Bedrock login API #31327 Managed Bedrock experimental API — base: main
  2. [codex] Implement managed Bedrock login #31326 Managed Bedrock login — base: codex/managed-bedrock-api
  3. [codex] Implement managed Bedrock logout #31325 Managed Bedrock logout — base: codex/managed-bedrock-login-v2

@celia-oai celia-oai force-pushed the codex/managed-bedrock-login-v2 branch from fc7cbe0 to fa240d8 Compare July 8, 2026 00:16
@celia-oai celia-oai force-pushed the codex/managed-bedrock-logout branch from c9d1ab6 to 1573973 Compare July 8, 2026 00:16
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.

1 participant