Skip to content

feat(proxy): add account-bound Codex upstream routing#878

Merged
Komzpa merged 20 commits into
mainfrom
feature/codex-proxy-pool-egress-clean
Jun 2, 2026
Merged

feat(proxy): add account-bound Codex upstream routing#878
Komzpa merged 20 commits into
mainfrom
feature/codex-proxy-pool-egress-clean

Conversation

@Soju06
Copy link
Copy Markdown
Owner

@Soju06 Soju06 commented Jun 2, 2026

Summary

Recreates the #869 account-bound Codex upstream proxy routing work on top of current main as a clean, focused PR.

This intentionally supersedes the closed stacked PR #869 after its base branch was deleted when #868 merged. It does not use the broader #873 repair/consolidation branch, because #873 also mixes in #804 account OAuth proxy work and merge/consolidation commits.

Scope

  • Adds account-bound upstream proxy routing for Codex/ChatGPT upstream HTTP and websocket traffic.
  • Uses the curl_cffi async Codex upstream client with the built-in Codex CLI TLS fingerprint.
  • Keeps route-required account-bound traffic fail-closed: no default pool, environment proxy, or direct fallback for bound routes.
  • Preserves route metadata in request logs/audit paths and websocket handshakes.
  • Adds settings validation for proxy pools/endpoints and route-related regression coverage.
  • Includes OpenSpec change: openspec/changes/add-codex-proxy-pool-egress/.

What this excludes

Validation

uv run openspec validate add-codex-proxy-pool-egress --strict
uv run openspec validate --specs
git diff --name-only origin/main..HEAD -- '*.py' | xargs uv run ruff check
git diff --name-only origin/main..HEAD -- '*.py' | xargs uv run ruff format --check
git diff --name-only origin/main..HEAD -- '*.py' | xargs uv run ty check
uv run pytest \
  tests/unit/test_auth_dependencies_upstream_proxy.py \
  tests/unit/test_auth_manager.py \
  tests/unit/test_codex_client.py \
  tests/unit/test_codex_upstream_paths.py \
  tests/unit/test_files_client.py \
  tests/unit/test_limit_warmup.py \
  tests/unit/test_model_fetcher.py \
  tests/unit/test_model_refresh_scheduler.py \
  tests/unit/test_proxy_utils.py \
  tests/unit/test_proxy_websocket_client.py \
  tests/unit/test_request_log_upstream_proxy_metadata.py \
  tests/unit/test_upstream_proxy_resolver.py \
  tests/unit/test_usage_client.py \
  tests/unit/test_usage_updater.py \
  tests/integration/test_oauth_flow.py \
  tests/integration/test_proxy_files.py \
  tests/integration/test_settings_api.py \
  tests/integration/test_migrations.py \
  -q
# 596 passed, 3 skipped

Supersedes #869.

@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Jun 2, 2026

@codex review

@github-actions github-actions Bot added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label Jun 2, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

@Soju06 Soju06 force-pushed the feature/codex-proxy-pool-egress-clean branch from b1cd843 to b1862c9 Compare June 2, 2026 05:41
@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

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

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: b1862c9bdc

ℹ️ 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/settings/api.py
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label Jun 2, 2026
@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Jun 2, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ 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".

@Soju06 Soju06 removed the 🤖 codex: needs work [@codex review] raised an issue label Jun 2, 2026
@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Jun 2, 2026

@codex review

@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Jun 2, 2026

@codex review

@Soju06 Soju06 force-pushed the feature/codex-proxy-pool-egress-clean branch from 94564ed to 23bfbf8 Compare June 2, 2026 06:36
@chatgpt-codex-connector
Copy link
Copy Markdown

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

ℹ️ 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".

@Soju06 Soju06 added the 🤖 codex: ok [@codex review] says no issues found. label Jun 2, 2026
@Komzpa Komzpa merged commit 0c01b19 into main Jun 2, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok [@codex review] says no issues found. 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