Files
codex/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json
Celia Chen 432771c5fd feat: expose AWS account state from account/read (#19048)
## Why

AWS/Bedrock mode currently reports `account: null` with
`requiresOpenaiAuth: false` from `account/read`. That suppresses the
OpenAI-auth requirement, but it does not let app clients distinguish AWS
auth from any other non-OpenAI custom provider. For the prototype AWS
provider UX, clients need a simple provider-derived signal so they can
suppress ChatGPT/API-key login and token-refresh paths without
hardcoding Bedrock checks.

## What changed

- Adds an `aws` variant to the v2 `Account` protocol union.
- Adds `ProviderAccountKind` to `codex-model-provider` so the runtime
provider owns the app-visible account classification.
- Makes Amazon Bedrock return `ProviderAccountKind::Aws` from the
model-provider layer.
- Updates app-server `account/read` to map `ProviderAccountKind` to the
existing `GetAccountResponse` wire shape.
- Preserves the existing `account: null, requiresOpenaiAuth: false`
behavior for other non-OpenAI providers.
- Regenerates the app-server protocol schema fixtures.
- Adds coverage for provider account classification and for the Amazon
Bedrock `account/read` response.

## Testing

- `cargo test -p codex-model-provider`
- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-app-server get_account_with_aws_provider`

## Notes

I attempted `just bazel-lock-update` and `just bazel-lock-check`, but
both are blocked in my local environment because `bazel` is not
installed.
2026-04-24 01:53:13 +00:00

102 lines
2.0 KiB
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Account": {
"oneOf": [
{
"properties": {
"type": {
"enum": [
"apiKey"
],
"title": "ApiKeyAccountType",
"type": "string"
}
},
"required": [
"type"
],
"title": "ApiKeyAccount",
"type": "object"
},
{
"properties": {
"email": {
"type": "string"
},
"planType": {
"$ref": "#/definitions/PlanType"
},
"type": {
"enum": [
"chatgpt"
],
"title": "ChatgptAccountType",
"type": "string"
}
},
"required": [
"email",
"planType",
"type"
],
"title": "ChatgptAccount",
"type": "object"
},
{
"properties": {
"type": {
"enum": [
"amazonBedrock"
],
"title": "AmazonBedrockAccountType",
"type": "string"
}
},
"required": [
"type"
],
"title": "AmazonBedrockAccount",
"type": "object"
}
]
},
"PlanType": {
"enum": [
"free",
"go",
"plus",
"pro",
"prolite",
"team",
"self_serve_business_usage_based",
"business",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"unknown"
],
"type": "string"
}
},
"properties": {
"account": {
"anyOf": [
{
"$ref": "#/definitions/Account"
},
{
"type": "null"
}
]
},
"requiresOpenaiAuth": {
"type": "boolean"
}
},
"required": [
"requiresOpenaiAuth"
],
"title": "GetAccountResponse",
"type": "object"
}