Skip to content

feat(proxy): support OAuth callers for Codex Live Voice - #1577

Open
crowscc wants to merge 8 commits into
Soju06:mainfrom
crowscc:feature/oauth-live-global-policy
Open

feat(proxy): support OAuth callers for Codex Live Voice#1577
crowscc wants to merge 8 commits into
Soju06:mainfrom
crowscc:feature/oauth-live-global-policy

Conversation

@crowscc

@crowscc crowscc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Support Codex Live Voice through codex-lb for both the built-in openai OAuth provider and registered Proxy API Key clients. OAuth callers use the zero-key origin boundary plus a Settings-managed upstream account pool, while call creation and every sideband route remain bound to the same serving account.

Type of change

  • fix: — bug fix (no behavior change beyond the bug)
  • feat: — new user-facing feature or capability
  • refactor: — internal refactor (no behavior change, no API change)
  • docs: — documentation only
  • chore: / ci: / build: — tooling, CI, packaging
  • test: — test-only change
  • Breaking change

Linked issue: Related to #1492.

OpenSpec

  • This PR includes / updates an OpenSpec change
  • Not applicable — bug fix that matches the existing spec
  • Not applicable — docs / CI / chore only
  • This PR touches a codex-faithful path and preserves upstream-equivalent request, response, and sideband behavior

Change directory: openspec/changes/add-oauth-live-voice-auth/

Capabilities:

  • realtime-api-compat
  • database-migrations
  • frontend-architecture

Changes

Live caller admission and ownership

  • Keep registered sk-clb-* callers on strict Proxy API Key authentication, assignment, limits, attribution, and affinity.
  • Admit official Codex OAuth callers through the zero-key origin boundary when global Proxy API Key authentication is disabled.
  • Derive a purpose-separated HMAC caller scope from the OAuth bearer and normalized chatgpt-account-id; credentials and raw account headers are never persisted.
  • Bind call creation and all three supported sideband routes to the exact serving account, then enforce the current caller policy and account eligibility on every sideband connection.

Policy and persistence

  • Add one default-off global OAuth Live policy with an explicit allowed upstream account set.
  • Provide transactional dashboard read/write APIs, active-account filtering, safe audit metadata, and cascade cleanup for removed accounts.
  • Store only the scoped caller digest, call digest, serving account reference, and expiry required for ownership.
  • Preserve nullable API-key attribution for OAuth Live logs while keeping registered-Key attribution unchanged.

Settings and client profiles

  • Add a Settings → Live Voice card with one enable switch, a compact account multi-select, and one save action.
  • Keep selected unavailable accounts visible so operators can remove them from the policy.
  • Document the built-in openai OAuth profile and registered Proxy API Key profile, including both experimental realtime base URLs.
  • Keep WebRTC media peer-to-peer; codex-lb handles private call creation and control sideband routing only.

Simplicity

  • New feature defaults to off
  • No new required setup step
  • New setting(s) and why each can't be a default: the persisted OAuth Live policy requires an operator-selected upstream account pool, so it starts disabled with an empty pool. No new CODEX_LB_* environment setting is added.
  • No README section, .env.example entry, dashboard navigation item, or dependency is added

Test plan

Local verification:

make ci-fast
  architecture checks passed
  Ruff and formatting passed
  ty passed
  frontend: 136 files / 1,032 tests passed; production build passed
  backend unit: 5,194 passed, 68 skipped
  source distribution, wheel, and packaged frontend assets passed

openspec validate add-oauth-live-voice-auth --strict
  Change 'add-oauth-live-voice-auth' is valid

openspec validate --specs --strict
  49 passed, 0 failed

focused OAuth Live and migration suite
  215 passed, 3 skipped (PostgreSQL-only cases)

Manual Codex Desktop acceptance:

Client profile Normal conversation Live Voice
Built-in openai OAuth provider Passed Passed
Registered Proxy API Key Passed Passed

Both realtime base URLs targeted codex-lb during Live Voice acceptance.

Screenshots / output

Before

No OAuth Live policy control was available in Settings.

Settings before OAuth Live policy

After

Settings exposes the default-off OAuth Live policy and compact upstream account selector.

Settings with OAuth Live policy

Checklist

  • Title is in Conventional Commits format (<type>(<scope>)?: <subject>).
  • Linked the related issue / discussion above.
  • Added or updated tests covering the change.
  • Ran the relevant make ci-fast local gate.
  • openspec validate --specs --strict passes and the OpenSpec change is complete.
  • Simplicity gates reviewed: the five simplicity rules (PRINCIPLES.md P1-P5).
  • CHANGELOG is not edited by hand.

@github-actions github-actions Bot added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label Aug 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@crowscc

crowscc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f807e55d62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/modules/proxy/api.py Outdated
@crowscc

crowscc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26d657492b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/core/auth/codex_oauth_identity.py Outdated
@crowscc

crowscc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddddd6b463

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/core/auth/dependencies.py Outdated
Comment thread app/core/auth/codex_oauth_identity.py Outdated
Comment thread frontend/src/features/settings/components/oauth-live-settings.tsx
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 3, 2026
@crowscc

crowscc commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5959e764eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/core/auth/dependencies.py Outdated
@crowscc

crowscc commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 5428e89f46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@crowscc
crowscc marked this pull request as ready for review August 4, 2026 04:20
@crowscc

crowscc commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bc228d88b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/troubleshooting.md
**Codex CLI falls back to POST instead of WebSockets.**
Run the [WebSocket verification steps](client-setup.md#verify-websocket-transport). If codex-lb sits behind a reverse proxy, make sure it forwards WebSocket upgrades — see [Remote Access](deployment/remote.md).

## Live Voice

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Link Live Voice pages to their owning spec

The new Live Voice material here, along with the additions in docs/client-setup.md and docs/configuration.md, links only to docs/live-voice.md; none of these affected pages links directly to openspec/specs/realtime-api-compat, and their existing footer links name unrelated capabilities. Add the owning capability link to each affected page so the published guidance remains directly traceable to its normative requirements.

AGENTS.md reference: AGENTS.md:L39-L39

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: needs work [@codex review] raised an issue db migration PR changes Alembic database migrations; maintainer must coordinate merge order

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants