fix(codex): respect CODEX_HOME for profile installs#830
Merged
Conversation
Contributor
Author
|
I can confirm this works. I have installed CE as a plugin in a secondary Codex profile on my machine and am using brainstorm/plan/work right now to build a new project. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc288338bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dc28833 to
4031935
Compare
Merged
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
This fixes Codex profile installs for Compound Engineering by making the Codex converter and cleanup paths honor the active Codex home consistently.
Before this change,
codex plugin marketplace addrespectedCODEX_HOME, but the companion CE Bun install defaulted to~/.codex. A profile install such asCODEX_HOME="$HOME/.codex/profiles/work" ...could therefore register the marketplace in the profile while writing CE custom agents into the default Codex home. The result was a half-installed profile: native plugin skills could be installed through Codex, but CE skills that delegate to custom agents would still fail because the agents were in the wrong root.What Changed
resolveCodexHome, which resolves Codex output roots as: explicit--codex-home, then$CODEX_HOME, then~/.codex.install,convert, andcleanupto use that resolver.install --to allrecognizes a Codex install located at$CODEX_HOME.~/.codex/profiles/workinstead of a literal.codexdirectory.writeCodexBundle.workprofile example and a local-worktree development variant./pluginsTUI install is still required today: marketplace registration only makes CE available, and the TUI install activates native skills; the Bun step installs the custom agents that those skills delegate to.Root Cause
The Codex native command and the CE Bun installer were using different ideas of “Codex home.” Codex itself follows
CODEX_HOME, but the CE installer hard-codedpath.join(os.homedir(), ".codex")unless--codex-homewas passed. That mismatch only shows up for non-default profiles, which is why the normal~/.codexinstall path appeared fine.There was a second edge case: passing
--codex-home ~/.codex/profiles/workshould write directly into that profile root. The Codex writer historically treated any output path not named.codexas a project root and nested another.codexdirectory under it. The CLI now explicitly tells the Codex writer that resolved Codex homes are already Codex roots.User Impact
Users can now install CE into a named Codex profile with consistent commands:
Inside Codex, users still run
/pluginsand installcompound-engineering. That step is expected with current Codex because there is no CLI plugin-install subcommand for plugins from added marketplaces.Validation
bun testbun run release:validate