fix(installer): honor CODEX_HOME for the Codex global install (#1627) - #1633
Open
maxmilian wants to merge 1 commit into
Open
fix(installer): honor CODEX_HOME for the Codex global install (#1627)#1633maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
…chenry#1627) Codex resolves its user layer from `CODEX_HOME` and only falls back to `~/.codex`. The target hardcoded the fallback, so a user on a custom profile got a correct install into a directory Codex never reads — the MCP entry, the AGENTS.md block, and detect() all pointed at the wrong profile, and the failure is silent. Resolve the global config dir from `CODEX_HOME` when set and non-blank, mirroring what the copilot-cli target already does for `COPILOT_HOME`. Only the user layer moves; the project layer (colbymchenry#1531) stays anchored to the project. The test harness now also clears `CODEX_HOME` in setHome() alongside HERMES_HOME/COPILOT_HOME — without that, the existing codex tests fail on a developer machine that has the variable exported. Note this is only half of colbymchenry#1627: the CLAUDE_CONFIG_DIR half is already covered by the open PR colbymchenry#1029, which this deliberately does not touch. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Addresses the
CODEX_HOMEhalf of #1627.Codex resolves its user layer from
CODEX_HOMEand only falls back to~/.codex. The Codex target hardcoded the fallback, so a user running Codex against a custom profile got a correct install into a directory Codex never reads — the[mcp_servers.codegraph]entry, theAGENTS.mdblock, anddetect()all pointed at the default profile. Nothing errors; CodeGraph simply never loads.Resolution now mirrors what the copilot-cli target already does for
COPILOT_HOME:Only the user layer moves. The project layer from #1531 stays anchored to the project —
.codex/config.tomlbeside the repo is not a profile artifact — and there is a test pinning that.Scope: this is deliberately half of #1627
The issue names two variables. The
CLAUDE_CONFIG_DIRhalf is already handled by #1029 (open since June, rebased onto currentmainon Aug 25, waiting on review) — it was opened before this issue existed, so the two aren't linked in either direction. This PR does not touchtargets/claude.ts, so the two don't collide. Landing both closes #1627.Tests
Four cases in a new
describe, following the shape of the existingopencode XDG config path (#535)block:$CODEX_HOMEand nothing lands in~/.codex— fails before the changedetect()anduninstall()follow$CODEX_HOMEtoo — fails before the changeCODEX_HOMEstill falls back to~/.codex— green before and after, guarding the fallbackCODEX_HOME(Codex CLI now supports project-local config (.codex/config.toml) — CodexTarget.supportsLocation('local') is stale #1531) — green before and afterOne extra fix in the harness:
setHome()clearsHERMES_HOMEandCOPILOT_HOMEbut notCODEX_HOME. Now that the target reads it, the existing codex tests would fail on any machine that has the variable exported, so it is cleared and restored alongside the other two.Full suite: 178 files / 3056 tests passing (3052 on
mainplus these four).npm run buildclean.Reported by @seanchann.