headroom/docs
Rod Boev 232fb49c73
fix(proxy): route Codex Live voice through a dedicated /v1/live transport (#2709)
## Description

Codex Live traffic currently reaches an unrouted WebSocket path and
receives HTTP 403 before the proxy can contact an upstream.

Closes #2653

## Type of Change

- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring

## Changes Made

- Add a dedicated `/v1/live` WebSocket route family and transparent
transport.
- Preserve subscription auth routing, account headers, origin policy,
subprotocols, and text/binary frame bytes.
- Propagate WebSocket close metadata and cancel relay tasks
deterministically on every exit.
- Keep Live outside the Responses parser, compression, memory injection,
and Responses beta-header path.
- Keep generic HTTP paths on the existing catch-all and document the
Live aliases plus the derived-path override.
- Add real-app route, relay, and loopback integration proof.
- Add coverage for authorization fallback, defensive receive events, and
cancellation cleanup in the Live relay.

## Testing

The focused Live handshake, preservation suites, Ruff, format, and diff
checks pass. The base comparison, Codex Desktop owner round trip, and
ChatGPT backend acceptance of the derived `/backend-api/codex/live` path
remain untested.

- [x] Unit tests pass (`pytest`)
- [x] Linting passes (`ruff check`)
- [x] Type checking passes (`mypy headroom --ignore-missing-imports`)
- [x] New tests added for the reported failure
- [x] Manual loopback testing performed

### Test Output

```text
uv run pytest tests/test_codex_live.py -q: 6 passed, 7 warnings in 11.03s
uv run pytest tests/test_provider_proxy_routes.py tests/test_proxy_codex_route_aliases.py tests/test_provider_codex_endpoints.py tests/test_openai_codex_routing.py -q: 53 passed in 90.54s (0:01:30)
uv run ruff check headroom/providers/codex/live.py headroom/providers/proxy_routes.py headroom/proxy/handlers/openai.py headroom/proxy/ws_headers.py tests/test_codex_live.py: All checks passed
uv run ruff format --check headroom/providers/codex/live.py headroom/providers/proxy_routes.py headroom/proxy/handlers/openai.py headroom/proxy/ws_headers.py tests/test_codex_live.py: 5 files already formatted
uv run mypy headroom --ignore-missing-imports: Success: no issues found in 508 source files
git diff --check: pass
```

## Real Behavior Proof

The local WebSocket integration floor uses real uvicorn, a real
WebSocket client, and a real loopback WebSocket upstream. The base 403
comparison was not run. Head observes HTTP 101 on every Live alias and a
byte-identical binary frame relay.

- Environment: Windows, CPython 3.13, the Headroom proxy test
environment.
- Exact command / steps: run the focused Live test against the local
uvicorn proxy and loopback WebSocket upstream, then run the preservation
suite listed in `Test Output`.
- Observed result: all four Live aliases return HTTP 101, negotiate
`codex.live.v1`, preserve text and binary frames, and pass the
preservation suite.
- Not tested: Codex Desktop Live session; ChatGPT backend acceptance of
`/backend-api/codex/live`; the base 403 comparison.

## Review Readiness

- Live has a separate transport and does not enter Responses handling.
- Existing Responses and generic passthrough suites remain preservation
gates.
- No `CHANGELOG.md` or install/crate changes are included.
- [x] I have performed a self-review
- [x] This PR is ready for human review

## Checklist

- [x] Closes #2653
- [x] Real loopback handshake and binary-frame proof required
- [x] No audio payload logging
- [x] No unqualified end-to-end claim

## Screenshots

Not applicable.

## Additional Notes

The upstream Live path is derived from the repository’s Codex URL
formula and remains explicitly unconfirmed until owner evidence is
available.
2026-08-02 13:15:47 -07:00
..
app docs: improve discoverability for AI agents and search crawlers 2026-05-13 17:36:06 -07:00
components docs: sync Vercel docs with current code and add in-depth proxy config (#2475) 2026-07-21 16:26:56 -07:00
content/docs fix(proxy): route Codex Live voice through a dedicated /v1/live transport (#2709) 2026-08-02 13:15:47 -07:00
lib docs: sync Vercel docs with current code and add in-depth proxy config (#2475) 2026-07-21 16:26:56 -07:00
overrides fix: repair release and docs pipelines 2026-04-16 12:53:51 -05:00
screenshots Merge pull request #147 from JerrettDavis/feat/anthropic-usage-insights 2026-04-12 10:54:22 -07:00
.gitignore new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
bun.lock fix(deps): remediate dependency CVEs and publish SBOM (#1509) 2026-06-27 15:28:12 -07:00
claude-code-bedrock-headroom.md fix(bedrock): route ARNs via converse, named AWS profiles, and au. re… (#1456) 2026-07-02 22:51:05 -05:00
next.config.mjs new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
observability.md fix: remove rtk and lean-ctx CLI context tools (#2677) 2026-07-30 22:59:41 -07:00
package-lock.json deps: bump the npm-minor-patch group across 3 directories with 7 updates (#2276) 2026-07-21 11:21:14 -05:00
package.json deps: bump the npm-minor-patch group across 3 directories with 7 updates (#2276) 2026-07-21 11:21:14 -05:00
platform-feature-matrix.json fix: harden persistent install startup (#1851) 2026-07-10 00:40:34 -04:00
platform-stabilization.md fix: harden persistent install startup (#1851) 2026-07-10 00:40:34 -04:00
postcss.config.mjs new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
proxy.ts new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
README.md new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
source.config.ts docs(ci): add CI/CD flow diagrams (#1062) 2026-06-16 23:05:15 -07:00
tsconfig.json new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
vercel.json fix: add Vercel deploy config and workflow for docs site (#1739) 2026-07-14 13:25:18 -04:00

docs

This is a Next.js application generated with Create Fumadocs.

Run development server:

npm run dev
# or
pnpm dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

Explore

In the project, you can see:

  • lib/source.ts: Code for content source adapter, loader() provides the interface to access your content.
  • lib/layout.shared.tsx: Shared options for layouts, optional but preferred to keep.
Route Description
app/(home) The route group for your landing page and other pages.
app/docs The documentation layout and pages.
app/api/search/route.ts The Route Handler for search.

Fumadocs MDX

A source.config.ts config file has been included, you can customise different options like frontmatter schema.

Read the Introduction for further details.

Learn More

To learn more about Next.js and Fumadocs, take a look at the following resources: