fix: Enable native Fast service tier UI for API-key auth#950
Open
moooyy wants to merge 1 commit into
Open
Conversation
6080008 to
ef07e17
Compare
ef07e17 to
53c6535
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-*andread-service-tier-for-request-*before Codex+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 hooksNode's module loader, waits for Electron to be required, then wraps
electron.protocol.handlebefore Codex registers theapp://handler.Solution
service-tier-preload.jsunder the Codex++ state directory.app://:use-service-tier-settings-*.jsread-service-tier-for-request-*.jsapikeyauth to use the same native service-tier settings path aschatgptauth.service_tiervalidation tied to the selected model instead of bypassing model/service-tier support checks.open -a, so the preload environment is applied before Electron loads the app modules.serviceTierandservice_tierwhen a request-tier override is applied.Testing
cargo fmt --checkcargo test -p codex-plus-core service_tier_preloadcargo test -p codex-plus-core --test cdp_bridgecargo test -p codex-plus-core --test launchercd apps/codex-plus-manager && npm ci && npm run vite:buildcargo clippy --all-features(passes; existing upstream warnings are still emitted)cargo test --all-features(all tests pass except the existing upstream baseline failurecodex-plus-manager --test windows_subsystem relay_settings_keeps_profile_config_and_auth_files_isolated, which also fails on cleanmainbecauseApp.tsxdoes not containsnapshotActiveRelayFilesBeforeSwitch)launcher.service_tier_preload_enabled,service_tier_preload_loaded,service_tier_preload_protocol_patch_installed, andservice_tier_preload_asset_patchedfor both service-tier renderer assets before the rendererinjection path was needed.