fix: make the app-server bridge opt-in so Computer Use keeps working - #8
Open
skychentian wants to merge 1 commit into
Open
fix: make the app-server bridge opt-in so Computer Use keeps working#8skychentian wants to merge 1 commit into
skychentian wants to merge 1 commit into
Conversation
Installing DSCodex used to set CODEX_CLI_PATH globally via launchctl. That forces the Codex desktop app off its local app-server daemon websocket (the transport with reconnect support) onto stdio through the DSCodex shim for every spawn - app-server, MCP servers, and Computer Use included. The bridge was also fragile: launchctl login variables do not survive reboots, so a missing DSCODEX_REAL_CODEX made the wrapper exit(1), and the shim embedded a version-manager node path that disappears on upgrade. Any of these left the app unable to spawn Codex at all, which users saw as Computer Use being blocked by DSCodex. Model switching never needed the bridge - it works through the merged model catalog. The bridge only adds per-provider effort/speed memory, so it is now opt-in: - install no longer sets CODEX_CLI_PATH and actively removes DSCodex-owned copies left by older versions, including the ones the Codex app snapshots into [mcp_servers.*.env]; new `dscodex bridge enable|disable|status` command manages the opt-in - the wrapper resolves the stock Codex binary through a shared fallback chain (launchctl -> env -> bundled app binary -> PATH) instead of exiting when DSCODEX_REAL_CODEX is missing, so a stale CODEX_CLI_PATH degrades to stock Codex rather than hard-failing every spawn - the shim resolves node from PATH at runtime and only falls back to the absolute path baked at install time, so fnm/nvm/Homebrew upgrades no longer strand it - doctor now accepts a cleanly disabled bridge and only fails when an active DSCodex bridge is broken Also backfill newly required catalog fields (supports_reasoning_summaries) on native entries: Codex bumps can make a stale models_cache.json entry unparseable, which takes down the whole model_catalog_json and the app-server with it (picker smoke failed before this). Bumps version to 0.6.0.
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
Installing DSCodex sets
CODEX_CLI_PATHglobally vialaunchctl setenv. The Codex desktop app treats that variable as a hard override and abandons its local app-server daemon websocket (the transport that supports reconnect), routing every spawn — app-server, MCP servers (node_repl→ Computer Use), and CLI — through the DSCodex shim over stdio.The bridge was also fragile, so this hijack turned into outages:
launchctl setenvdoes not survive reboots. OnceDSCODEX_REAL_CODEXwas lost,codex-wrapper.mjsprinted an error andexit(1)— every spawn through the still-setCODEX_CLI_PATHhard-failed.fnm/node-versions/vX/...) that disappears on the next Node upgrade, killing the shim.CODEX_CLI_PATHinto[mcp_servers.*.env]inconfig.toml, persisting the hijack even afterlaunchctl unsetenv.Net effect reported by users: Computer Use is blocked by DSCodex's environment variables, and app-server reconnect loops when the shim dies.
Fix
Model switching never needed the bridge — it works through the merged model catalog. The bridge only adds per-provider effort/speed memory in the desktop app, so it is now opt-in:
installno longer setsCODEX_CLI_PATHand actively removes DSCodex-owned copies left by older versions, including the ones the Codex app snapshotted into[mcp_servers.*.env](newstripBridgeCliPathinconfig.mjs).dscodex bridge enable|disable|statuscommand manages the opt-in;disablealso strips the MCP-env snapshots.src/real-codex.mjs, shared with the CLI): launchctl → env → bundled app binary → PATH. A staleCODEX_CLI_PATHnow degrades to stock Codex instead ofexit(1).Bonus fix: catalog forward-compatibility
picker-smokecurrently fails on a stock install: Codex now requiressupports_reasoning_summariesinmodel_catalog_jsonentries, and a stalemodels_cache.jsondoes not contain it — one unparseable entry takes down the whole catalog and app-server with it.buildCatalognow backfills known-required fields (NATIVE_ENTRY_DEFAULTS) on native entries with safe defaults; smoke passes again.Tests
test/real-codex.test.mjs(fallback order, self-exclusion, reboot survival),stripBridgeCliPathcases, catalog backfill case.bridge disableclears the login-session env,doctorreports 6/6 ok,picker-smokefinds 🐳 V4 Flash with native GPT preserved.Bumps version to 0.6.0 (behavior change: bridge off by default;
bridge enablerestores previous behavior).