Commit Graph

9 Commits

Author SHA1 Message Date
alexsong-oai
41d3dc56a0 Surface model provider authentication recovery progress (#41239)
## What changed

- Emit turn-scoped authentication recovery started and completed events when a model provider refreshes expired credentials.
- Add stable `modelProvider/authRecoveryStarted` and `modelProvider/authRecoveryCompleted` app-server notifications with the thread, turn, provider, and user-facing message.
- Show recovery progress in the TUI and `codex exec`, including Amazon Bedrock session reauthentication.

## Testing

- Cover provider recovery success and failure events, app-server routing, client rendering, and Amazon Bedrock credential refresh.

GitOrigin-RevId: 3010c38d0676f18bced27761cf86dd38344d09f9
2026-08-28 01:14:02 +00:00
alexsong-oai
4f6d43c267 Support managed AWS access keys for Amazon Bedrock (#40481)
## What changed

- Add the experimental `amazonBedrockAccessKeys` app-server login flow, persist its credentials in the configured auth store, and use them for SigV4-signed Bedrock requests.
- Report `bedrockAccessKeys` as a distinct auth mode and document access-key login alongside AWS profile and environment credential setup.
- Clear the selected Bedrock provider, AWS settings, and Bedrock-specific model on logout while leaving external AWS credentials and `.env` untouched.
- Reject managed access-key login when higher-precedence configuration would prevent its region or profile settings from taking effect.

## Testing

- Cover access-key login, storage, request signing, configuration conflicts, status reporting, and logout cleanup.

GitOrigin-RevId: bbf297887c6503d3651ceb2aad85c4d626e32723
2026-08-24 21:39:48 +00:00
andrewgu-oai
79b7606803 Keep credentials out of app-server logs (#39993)
## Why

App-server logs can be persisted or included in submitted diagnostics, so credentials used by model providers, authentication refreshes, and attestation requests must not appear in diagnostic output.

## What changed

- Add `RedactedString`, which preserves serialization and string access while replacing debug output with `<redacted>`.
- Use it for model-provider bearer tokens, header and query values, authentication command arguments, and attestation tokens.
- Avoid logging JSON-RPC error payloads and parser or authentication errors that may echo credentials; retain safe context such as error codes and categories.

## Testing

- Add an app-server regression test that exercises provider credentials, refreshed authentication tokens, and attestation tokens, then verifies none appear in persisted SQLite or submitted diagnostic logs.

GitOrigin-RevId: 8c50408adf94d93847658b1320682cf3b637d2cc
2026-08-21 19:04:32 +00:00
alexsong-oai
3929c99a97 Refresh expired AWS credentials for Bedrock (#39410)
## Why

Bedrock sessions that use the AWS SDK credential chain need a way to recover when credentials expire during a request.

## What changed

- Add `aws.auth_refresh` provider configuration with an `aws` command, arguments, and a configurable timeout.
- Run the command for refreshable Bedrock authentication failures, reload the SDK credentials, re-sign the request, and retry it.
- Share refresh state across matching provider configurations so concurrent failures invoke the command only once. Bearer tokens, command auth, and static environment credentials do not use this recovery path.

## Testing

- Add coverage for configuration validation, refreshable error classification, concurrent refresh sharing, and an end-to-end retry signed with refreshed credentials.

GitOrigin-RevId: 0302fe3aabdbc1097e7bd62a74d407ba38a3cc57
2026-08-19 04:46:58 +00:00
viyatb-oai
e13c1d569d Prevent custom providers from inheriting ambient auth (#39214)
## Why

Custom model providers that do not require OpenAI authentication could inherit
ambient authentication headers, including the bearer token and
`ChatGPT-Account-ID`, and send them to the custom provider endpoint.

## What changed

- Resolve providers without `requires_openai_auth` or configured `auth` as
  unauthenticated.
- Continue to honor an explicit `experimental_bearer_token` or command-resolved
  provider authentication.
- Preserve ambient authentication for OpenAI providers.

## Testing

Added unit and request-level coverage for custom, explicitly authenticated, and
OpenAI provider authentication behavior.

GitOrigin-RevId: d89a79604338bc660a3edb2af0068cfa9b694fa2
2026-08-18 15:06:09 +00:00
cooper-oai
18dcc7646f Unify external authentication provider handling (#38258)
## What changed

- Use each `ExternalAuth` provider's error classification for resolve, refresh,
  and validation failures.
- Allow runtime providers to be replaced, clearing any recorded permanent
  refresh failure after the replacement resolves successfully.
- Preserve workload identity as immutable, host-managed authentication while
  sharing external ChatGPT credentials through the process-local store.

## Testing

- Cover provider replacement after a permanent failure, provider-defined error
  classification, workload identity immutability, and refreshed headers after
  an unauthorized response.

GitOrigin-RevId: ec75cf9224dc82d3fd10063606c724e3b06fb1e7
2026-08-12 22:04:27 +00:00
cooper-oai
b28aa476f4 Add configuration-backed external authentication (#38054)
## What changed

- Add a host-owned external auth source that runtime account APIs cannot replace,
  clear, or log out, and keep its credentials process-local instead of writing
  them to auth storage.
- Let configured providers classify refresh failures. Preserve cached credentials
  after permanent reload failures while retaining transient behavior for runtime
  providers.
- Compare external ChatGPT token data when detecting auth changes so a refreshed
  access token is applied to a retried request.

## Testing

- Cover configured-auth immutability, process-local storage, permanent reload
  failures, runtime error classification, and refreshed headers after a `401`.

GitOrigin-RevId: c6d70a39325c8ba6ca65ae68e12b55609f00a876
2026-08-11 19:04:07 +00:00
Celia Chen
ff352fab62 Remove codex-core's direct reqwest dependency (#36076)
## Why

`codex-http-client` is the intended owner of `reqwest`, while direct first-party
dependencies are tracked as migration debt.

## What changed

- Use `http` header and status types directly in core code and tests.
- Build the MCP test readiness client through `HttpClientBuilder`.
- Remove `reqwest` from `codex-core` and its temporary dependency-policy
  exception.

GitOrigin-RevId: 8d5c7c86256294a7bb8aa1ae10cc5bea4cb1fc56
2026-07-30 04:03:33 +00:00
lt-oai
8784de445e [codex] Add externally provided Codex auth (#31274)
## 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`

---------

Co-authored-by: pakrym-oai <pakrym@openai.com>
2026-07-07 17:43:19 -07:00