microsoft / microsoft/vscode

Codex Agent Host: recognize non-ChatGPT accounts (API key, Bedrock, Azure, local, custom providers) as usable

Open
#335,138 0 comments 0 reactions 1 assignee Claimed by @TylerLeonhardt View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Summary

Codex's Agent Host integration currently only recognizes a ChatGPT-subscription login as a real "account" for availability purposes. API-key, AWS Bedrock, Azure OpenAI, local, and other custom `model_provider` configurations in Codex's `config.toml` aren't yet recognized as usable accounts, so a signed-out-of-GitHub user configured against one of these providers sees Codex report as unusable / missing from the harness picker.

[#329668](https://github.com/microsoft/vscode/issues/329668)'s acceptance criteria describe this case as in scope:

> Signed out of GitHub + configured API-key/custom provider: Codex is usable.

The implementing PR, [#328461](https://github.com/microsoft/vscode/pull/328461), looks like it left this particular case for later — its reviewer notes call it out directly:

> API key, Bedrock, local, and custom providers are not displayed as accounts

This issue is to track closing that gap.

## Where this lives in source

- [`codexAccountState.ts#L21-L32`](https://github.com/microsoft/vscode/blob/9f21af25c33a63947754843950462209a1b9f8b7/src/vs/platform/agentHost/node/codex/codexAccountState.ts#L21-L32) — `codexAccountStateFromResponse()` only maps `account.type === 'chatgpt'` to `status: 'signedIn'`. `apiKey` and any other type map to `status: 'unavailable'`.
- [`codexAgent.ts#L1395-L1402`](https://github.com/microsoft/vscode/blob/9f21af25c33a63947754843950462209a1b9f8b7/src/vs/platform/agentHost/node/codex/codexAgent.ts#L1395-L1402) — `_toAccountInfo()` gates account metadata (email, plan type, profile image, rate limit) on `authType === 'chatgpt'`; non-ChatGPT auth types carry none of this.
- [`baseAgentHostSessionsProvider.ts#L465-L470`](https://github.com/microsoft/vscode/blob/9f21af25c33a63947754843950462209a1b9f8b7/src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts#L465-L470) — `resolveAgentAuthRequirement()` resolves to `SessionTypeAuthRequirement.Unusable` when an agent has dropped the GitHub requirement but reports an empty model catalog, which is the likely outcome for a Bedrock-backed Codex session.

## Impact

Users who configure Codex against a non-ChatGPT model provider (Bedrock, Azure OpenAI, a local model, or any other custom `model_provider` in `config.toml`) currently can't use Codex as a harness in VS Code's Agents window, even though Codex itself fully supports these providers on the CLI side. This affects anyone standardized on an enterprise/self-hosted model backend rather than a personal ChatGPT subscription.

## Prior art / related issues

- [#329668](https://github.com/microsoft/vscode/issues/329668) (closed) — tracked this capability for Codex and shipped the signed-out-Agents-window plumbing; full custom-provider account recognition looks like a good follow-up.
- [#323049](https://github.com/microsoft/vscode/issues/323049) (open) — the equivalent ask for Claude: making native/BYOK credentials (`claudeUseCopilotProxy: false`) discoverable and first-class in the UI, rather than a hidden host-config flag. Same underlying pattern, different harness.
- [#324652](https://github.com/microsoft/vscode/issues/324652) (open) — adjacent UX gap around billing/provider clarity for 3rd-party agents, not the same root cause.

## Suggested fix

- Recognize non-`chatgpt` Codex accounts (`apiKey`, `other`, and by extension Bedrock/Azure/local/custom `model_provider` entries) as usable accounts when Codex reports a non-empty model catalog for them, rather than only special-casing `chatgpt`.
- Surface at least a minimal account/model indicator for these providers in the Agents window and title-bar account UI, mirroring what exists for ChatGPT.
- Add test coverage for the "signed out of GitHub + custom/Bedrock provider configured" matrix cell called out in #329668's acceptance criteria.

## Repro

1. Configure Codex CLI with a custom `model_provider` (e.g. AWS Bedrock) in `config.toml`, with no ChatGPT account signed in.
2. Sign out of (or never sign in to) GitHub Copilot in VS Code.
3. Open the VS Code Agents window / harness picker.
4. Observe: Codex does not appear as an available harness (Claude and Copilot CLI do, if similarly configured/signed in).

Expected: Codex appears as a usable harness, routing requests through the configured Bedrock model provider.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.