refactor: remove codex auto-takeover, unify to manual config (closes #83) - #88
Merged
Merged
Conversation
) - Delete codex-takeover.ts (~400 lines) + tests - Remove enable/disable/status CLI + API endpoints - Remove web UI toggle button + route status badges - Add manual config snippet + copy button (matches API-key card style) - Add WS 426 for /codex/responses upgrade (fast-fallback) - Always allow /codex/ requests (no takeover state gate) - Cleanup note for users who previously auto-enabled
…f path detection)
…config-based override
…e on GitHub top-right
…assertions, dedup import
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.
Summary
Removes the Codex auto-takeover feature entirely. The auto-takeover button modified another app's
config.toml, which breaks on Codex version upgrades (issue #83). Users now configure manually via a config snippet, consistent with the API-key client cards.Changes
Deleted:
src/codex-takeover.ts(~400 lines) — state machine that rewrote~/.codex/config.tomltests/codex-takeover.test.ts— all takeover unit testsModified:
src/cli.ts— removedbili codex enable/disable/statussubcommand + startupclaimCodexTakeover/recoverStaleCodexTakeovercallssrc/server.ts:GET /__bili/codex,POST /__bili/codex/enable,POST /__bili/codex/disableendpointsresolveUpstreamnow usesresolveActiveCodexProvider()(reads config.toml directly) instead of takeover state!getCodexRouteState()gate on/codex/— requests always allowedrecordCodexRouteRequestactivity tracking + shutdown cleanup/codex/responsesupgrade requests (Codex fast-fallback to HTTP POST)src/web/client.ts— removedloadRouting/toggleRoute/copyRoute/routeStatesrc/web/page.ts— replaced Codex subscription card with manual-config card (matches API-key card style with copy button)src/web/styles.ts— added.config-blockstyletests/upstream-proxy-routing.test.ts— rewrote 2 tests to useCODEX_HOMEinstead of takeover statetests/web-routing.test.ts— removed codex endpoint assertions, kept upstream/history/config testsKept intact:
src/codex-provider.ts— provider resolution/codex/responsesproxy endpoint + handling logic/__bili/codex-historyendpoints)Validation
npm run typecheck— cleannpm test— 214 tests passnpm run build— successCloses #83