Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add per account proxy support#314

Open
baltic-tea wants to merge 10 commits into
qxcnm:main from
baltic-tea:add-account-proxy-features
Open

feat: add per account proxy support #314
baltic-tea wants to merge 10 commits into
qxcnm:main from
baltic-tea:add-account-proxy-features

Conversation

@baltic-tea

@baltic-tea baltic-tea commented Jun 11, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

  • Added per-account proxy support so each account can use its own proxy configuration independently of the global runtime proxy settings.
  • Added persistent account proxy settings storage, including migration, storage APIs, service/RPC handlers, Tauri commands, frontend API bindings, and account list normalization.
  • Added proxy health checks with account-level status, latency, error details, IP/geo metadata, ASN/ISP metadata, timezone metadata, and flag image / emoji fields.
  • Updated gateway, usage, subscription, and token-refresh paths so account-scoped proxy settings are applied consistently where account-specific network requests are made.
  • Added frontend account proxy UI and localization updates for English, Korean, and Russian.
  • Updated and stabilized affected frontend/runtime/e2e tests so the available frontend test commands pass with the new account proxy UI and account data shape.

Scope

  • Frontend
  • Desktop / Tauri
  • Service
  • Gateway / Protocol Adapter
  • Docs / Governance
  • Workflow / Release

Tests and Verification

  • pnpm -C apps run test:runtime
  • pnpm -C apps run test:e2e
  • pnpm -C apps run test:navigation
  • pnpm -C apps run build
  • pnpm -C apps run build:desktop
  • cargo test --workspace

Actually executed verification:

pnpm -C apps run test:runtime
pnpm -C apps run test:e2e
pnpm -C apps run test:navigation
pnpm -C apps run build
pnpm -C apps run build:desktop
cargo test --workspace
cargo build -p codexmanager-service --release
cargo build -p codexmanager-web --release --features embedded-ui
cargo build -p codexmanager-start --release

All frontend tests were executed successfully after updating the affected tests by 1c7503b52f commit.

Main Files

  • crates/core/migrations/069_account_proxy_settings.sql
  • crates/core/src/storage/account_proxy_settings.rs
  • crates/core/src/storage/accounts.rs
  • crates/core/src/storage/mod.rs
  • crates/core/src/rpc/types.rs
  • crates/service/src/account/account_proxy.rs
  • crates/service/src/account/account_proxy_health.rs
  • crates/service/src/rpc_dispatch/account.rs
  • apps/src-tauri/src/commands/account/remote.rs
  • apps/src-tauri/src/commands/registry.rs
  • crates/service/src/gateway/core/runtime_config.rs
  • crates/service/src/gateway/upstream/attempt_flow/transport.rs
  • crates/service/src/gateway/upstream/attempt_flow/postprocess.rs
  • crates/service/src/gateway/auth/openai_fallback.rs
  • crates/service/src/gateway/auth/token_exchange.rs
  • crates/service/src/usage/usage_http.rs
  • crates/service/src/usage/refresh/mod.rs
  • crates/service/src/usage/usage_token_refresh.rs
  • apps/src/components/accounts/account-proxy-cell.tsx
  • apps/src/components/accounts/account-proxy-status-grid.tsx
  • apps/src/lib/api/account-proxy-settings.ts
  • apps/src/lib/api/account-proxy-normalize.ts
  • apps/src/lib/utils/proxy-geo.ts
  • apps/src/lib/api/account-client.ts
  • apps/src/lib/api/normalize.ts
  • apps/src/hooks/useAccounts.ts
  • apps/src/app/accounts/accounts-page-view.tsx
  • apps/src/app/accounts/accounts-page-helpers.tsx
  • apps/src/app/accounts/page.tsx
  • apps/src/types/account.ts
  • apps/src/lib/i18n/messages/en.ts
  • apps/src/lib/i18n/messages/ko.ts
  • apps/src/lib/i18n/messages/ru.ts
  • apps/src/lib/i18n/messages/sections/en-accounts.ts
  • apps/src/lib/i18n/messages/sections/ko-accounts.ts
  • apps/src/lib/i18n/messages/sections/ru-accounts.ts
  • apps/tests/account-proxy-geo.test.mjs
  • apps/tests/account-list-cache.test.mjs
  • apps/tests/accounts-toolbar.spec.ts
  • apps/tests/accounts-usage-auto-refresh.spec.ts
  • apps/tests/api-keys-model-prefix.spec.ts
  • apps/tests/ccswitch.test.mjs
  • apps/tests/models-management.spec.ts
  • apps/tests/transport-web-commands.test.mjs
  • crates/core/tests/storage.rs
  • crates/core/tests/storage/migration_tests.rs
  • crates/service/src/gateway/core/tests/runtime_config_tests.rs
  • crates/service/src/usage/tests/usage_http_tests.rs

Risks and Impact

  • The account network path now has two possible proxy sources: explicit per-account proxy settings and the existing global/runtime proxy configuration. Regressions are possible if fallback order or cache invalidation behaves incorrectly.
  • Invalid enabled account proxy settings intentionally fail closed for account-scoped requests instead of silently falling back to the global proxy path.
  • Proxy health checks now persist additional account-level state, including IP, geo, ASN/ISP, timezone, and flag metadata. Existing account data should remain compatible through the new migration and default handling.
  • Account proxy settings are cached for gateway clients, so proxy updates and clears must invalidate the account proxy cache correctly.
  • Usage, subscription, and token-refresh flows now support explicit account proxy routing; failures in these paths may affect account availability/balance refresh results.
  • The affected runtime/e2e/navigation tests were updated to match the current app settings/account payload shape and account proxy additions. This reduces false failures, but these test changes should still be reviewed carefully to ensure they preserve the intended coverage.

Notes

  • Supported account proxy URL protocols: http://, https://, socks4://, socks4a://, socks5://, socks5h://.
  • Proxy protocols such as VLESS, Trojan, SS (Shadowsocks), and Hysteria2 are rejected with guidance to use a local HTTP/SOCKS endpoint instead, for example a sing-box mixed inbound like http://127.0.0.1:7891.
  • Proxy health checks use ipwho.is as the default geo provider. The public API is available without an API key or account and allows up to 2,000 requests per day, so the implementation keeps cached flag image lookup by country code when possible to avoid unnecessary repeated fetches.

Screencast

Codex-Manager-account-proxy.mp4

baltic-tea added 10 commits June 11, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /