Skip to content

fix: Enable native Fast service tier UI for API-key auth#950

Open
moooyy wants to merge 1 commit into
BigPizzaV3:mainfrom
moooyy:fix/api-key-native-fast-service-tier
Open

fix: Enable native Fast service tier UI for API-key auth#950
moooyy wants to merge 1 commit into
BigPizzaV3:mainfrom
moooyy:fix/api-key-native-fast-service-tier

Conversation

@moooyy

@moooyy moooyy commented Jun 14, 2026

Copy link
Copy Markdown

Problem

API-key sessions can send a Fast/priority service tier through Codex++ request wrapping, but Codex's native service-tier UI remains gated behind ChatGPT
account auth. That means API-key users do not get the same speed selector and speed indicator that account-login users see.

A renderer/CDP-only patch is also too late for this path: Codex can load use-service-tier-settings-* and read-service-tier-for-request-* before Codex+

  • injects into the webview. In that case the native UI logic is already initialized with the original ChatGPT-only gate.

Approach

Move the native service-tier renderer-module patch to Codex startup, before Codex registers and serves its app:// web assets.

Codex++ now prepares a small main-process preload and starts the macOS Codex bundle executable with NODE_OPTIONS=--require=<preload>. The preload hooks
Node's module loader, waits for Electron to be required, then wraps electron.protocol.handle before Codex registers the app:// handler.

Solution

  • Generate service-tier-preload.js under the Codex++ state directory.
  • Patch only the two native service-tier assets served through app://:
    • use-service-tier-settings-*.js
    • read-service-tier-for-request-*.js
  • Allow apikey auth to use the same native service-tier settings path as chatgpt auth.
  • Keep explicit service_tier validation tied to the selected model instead of bypassing model/service-tier support checks.
  • Launch macOS Codex via the bundle executable instead of open -a, so the preload environment is applied before Electron loads the app modules.
  • Keep Codex++ request wrapping aligned by sending both serviceTier and service_tier when a request-tier override is applied.
  • Enable Codex++ service-tier controls by default so API-key users can see and use the speed selector/indicator path without an extra hidden setting.

Testing

  • cargo fmt --check
  • cargo test -p codex-plus-core service_tier_preload
  • cargo test -p codex-plus-core --test cdp_bridge
  • cargo test -p codex-plus-core --test launcher
  • cd apps/codex-plus-manager && npm ci && npm run vite:build
  • cargo clippy --all-features (passes; existing upstream warnings are still emitted)
  • cargo test --all-features (all tests pass except the existing upstream baseline failure codex-plus-manager --test windows_subsystem relay_settings_keeps_profile_config_and_auth_files_isolated, which also fails on clean main because App.tsx does not contain
    snapshotActiveRelayFilesBeforeSwitch)
  • Manual macOS launch verification from the local build: diagnostic logs showed launcher.service_tier_preload_enabled, service_tier_preload_loaded,
    service_tier_preload_protocol_patch_installed, and service_tier_preload_asset_patched for both service-tier renderer assets before the renderer
    injection path was needed.

@moooyy moooyy force-pushed the fix/api-key-native-fast-service-tier branch 2 times, most recently from 6080008 to ef07e17 Compare June 14, 2026 04:36
@moooyy moooyy force-pushed the fix/api-key-native-fast-service-tier branch from ef07e17 to 53c6535 Compare June 14, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant