Repository navigation
fix(config): honor CODEX_HOME through toolRoots - #942
Merged
Merged
Conversation
Codex keeps its home in $CODEX_HOME, but teamai resolved every Codex path under ~/.codex, so a member who exports the variable got no skills, hooks, agents or MCP in the directory Codex reads, and doctor stayed green. Extend the toolRoots relocation built for CLAUDE_CONFIG_DIR (Tencent#725) to Codex. A RELOCATABLE_TOOLS table maps each tool to its variable; init records CODEX_HOME into toolRoots.codex, a re-init that moves the root releases the old hooks and managed MCP servers, and doctor adds a "Codex root matches CODEX_HOME" check. The two Codex writes outside toolPaths now follow the root: the co-author setting in config.toml and the skill-existence probe used by usage tracking. The doctor check compares the paths each root resolves to rather than requiring a record, so an unrecorded CODEX_HOME=~/.codex passes while an unrecorded CLAUDE_CONFIG_DIR=~/.claude still fails (it moves .claude.json). Closes Tencent#939
Derive the Codex co-author file from the scoped paths, list relocatable skill roots from RELOCATABLE_TOOLS, and skip the root-release warning for a tool the member does not sync or whose old root does not exist.
The PR description includes sufficient real-CLI end-to-end verification for this runtime change. |
A team mapping toolPaths.codex.skills to .agents/skills sent the Codex co-author setting to ~/.agents/config.toml. Resolve each Codex's own root (toolRoots.codex or ~/.codex, ~/.tcodex, ~/.codex-internal) instead.
|
No findings.
|
jeff-r2026
approved these changes
Oct 1, 2026
SaulMoro
added a commit
to SaulMoro/teamai-cli
that referenced
this pull request
Oct 1, 2026
Tencent#942 pinned Codex's default paths before Tencent#938 moved its rules to the session-start hook: no rules path, and an AGENTS.md that follows the root in user scope.
5 of 9 tasks
jeff-r2026
pushed a commit
that referenced
this pull request
Oct 1, 2026
…s own AGENTS.md in user scope (#940) * fix(rules): inline rules without frontmatter, naming path-scoped globs hermesRulesText becomes inlinedRulesText, the one renderer for tools that read rules from a single instructions file. It strips frontmatter and leads a path-scoped rule with 'Applies to files matching: <globs>'. Hermes SOUL.md and doctor's Hermes check use it. Part of #938. * fix(rules): inline team rules into Codex AGENTS.md in project scope Codex reads instructions from AGENTS.md, not from .codex/rules, so the copies pull wrote there never reached it (#938). The codex defaults drop rules and gain claudemd (AGENTS.md, ~/.codex/AGENTS.md at user scope). pullAllRules syncs a [teamai:team-rules] block into that file once per path while an enabled, installed Codex-family tool maps it, and removes it otherwise. syncManagedInstructions probes rules ?? settings, so a machine without Codex gets no ~/.codex. * fix(rules): render the Codex team-rules block with inlinedRulesText Follows the T3 rename, so a path-scoped rule reaches AGENTS.md without frontmatter, after its Applies to line. * test(rules): cover Codex AGENTS.md in user scope, culture, shared instructions and recall Codex now reaches AGENTS.md through its default claudemd path; these tests pin user scope (~/.codex/AGENTS.md), a full project-scope pull writing all four teamai blocks into one AGENTS.md, and recall on/off. Also corrects the injectRecallBlockIntoTools comment, which listed Codex as skipped. * fix(rules): remove Codex team rules and their old copies on uninstall Uninstall strips the [teamai:team-rules] block and scans the legacy .codex/rules directory for teamai's copies. A shared instruction file now keeps only the blocks a remaining enabled, installed tool would write, so --agent codex drops the team-rules block while Pi keeps its own. * fix(doctor): check the team-rules block in Codex AGENTS.md Codex reads no rules directory, so doctor now compares the team-rules block in each AGENTS.md an enabled, installed Codex-family tool maps with what pull renders. It fails on a missing or stale block, on an AGENTS.override.md that Codex reads instead, and on an entry with no claudemd path. The file list comes from RulesHandler, the same resolver the pull writes through. * fix(rules): remove the .codex/rules copies earlier pulls delivered Codex never read the <rule>.md copies teamai wrote to .codex/rules (and .codex-internal/rules, .tcodex/rules). Every rules sync now removes the ones that still hold what teamai delivered, including teamai-recall.md, keeps edited copies and names them, and leaves *.rules alone. * docs(rules): document where Codex reads team rules (AGENTS.md) * fix(rules): give Codex its AGENTS.md rules on an already-synced pull A CLI upgrade with the team repo unchanged takes the "Already synced" fast path, which never ran the rules sync. So a member upgrading from 0.22.0 got no team-rules block in AGENTS.md and kept the old .codex/rules copies until the repo moved or they ran pull --force. The fast path now runs the Codex part of the rules sync (block + reclaim) and nothing else. * fix(doctor): tell a Codex member a plain pull restores the team-rules block The already-synced pull now rewrites the block, so the fix text no longer sends the member to pull --force. * fix(rules): give codex-internal and tcodex the codex instructions layout codex-internal and tcodex drop their rules path and read team rules from AGENTS.md like codex. Codex-family instruction writers probe rules ?? settings ?? skills, so a team entry with neither rules nor settings no longer counts as installed. writesInstructionBlock is the one answer to which blocks a tool gets, shared by pull's writers and uninstall. * fix(rules): keep an empty AGENTS.md that held no team-rules block removeClaudeMdSection now reports whether it removed a section and can delete a file left holding only whitespace. The team-rules sync and recall off use it, so a pull that removed nothing no longer deletes a member's own empty AGENTS.md. * fix(doctor): pass the Codex team-rules check when no rule has a body When every team rule is frontmatter only, pull writes no team-rules block, so a missing block is correct and an AGENTS.override.md shadows nothing. Also note that an empty override shadows AGENTS.md too. * fix(doctor): a plain pull applies the Codex claudemd toolPaths fix Editing teamai.yaml moves the team repo, so a plain pull does the full sync; --force is not needed. Matches the other Codex block checks. * fix(uninstall): name the instruction file uninstall cleans The summary and result lines said CLAUDE.md for every instruction file, including Codex's AGENTS.md. They now print the file's path under an 'Instruction-file blocks' heading. * refactor(recall): gate the recall block on writesInstructionBlock recall on now asks the same question as pull's recall writer and uninstall, so the three cannot drift. No behavior change. * fix(rules): reclaim .codex/rules copies of rules the team removed The tombstone cleanup walks toolPath.rules, which Codex no longer has, so a copy of a rule tombstoned after the member's last pre-#938 pull stayed forever. The legacy reclaim now removes tombstoned names too, keeping and naming a copy the member changed since delivery (#822). * test(rules): cover codex-internal and tcodex in reclaim, doctor and uninstall Parametrizes the project-scope legacy reclaim, the four Codex doctor failure cases and the full uninstall over the Codex family. * test(pull): cover the project-scope Codex fast path after an upgrade * test(local-agent): pin the prompt sync into Codex's AGENTS.md With Codex's default claudemd (#938), an HTTP prompt command reported by Codex writes the shared-instructions block into ~/.codex/AGENTS.md when ~/.codex exists, and creates nothing when it does not. * refactor(rules): move rulePaths into rule-format It reads a tool-neutral rule's paths: frontmatter, which both the Copilot renderer and the inlined-rules renderer use; it no longer lives in the Copilot module. * fix(doctor): ask nothing of a Codex entry that delivers no rules to it A team toolPaths entry such as codex: { agents: .codex/agents } has neither rules nor claudemd: the team sends Codex no rules on purpose, like any tool without a rules path. Doctor failed it on every member's machine (E2E doctor-delivery-cli). It now fails only an entry that still lists the pre-#938 rules path without claudemd. Part of #938. * fix(rules): keep a teamai-recall.md the member edited since the last pull The legacy Codex reclaim removed any .codex/rules/teamai-recall.md that opened with the recall heading, so text a member appended after the last pull that wrote it was deleted. The built-in rule is not in the delivery ledger, so match the file against the exact bodies teamai deployed instead; an edited copy is kept and named like other legacy copies. * fix(rules): keep a member's empty AGENTS.md when the team-rules block goes Removing the last block deleted any instructions file it left empty, so an empty AGENTS.md a repository tracked was deleted once Codex was disabled or the team had no rules left. injectClaudeMdSection now creates a file as just the block, and deleteIfEmpty deletes only a file that opens with it; a member's empty file is written back empty. Also describe the per-block cleanup of shared instruction files in the deployed uninstall skill. * fix(rules): address review on uninstall, remove, doctor and markers - uninstall and the legacy [teamai:rules] strip remove blocks through removeClaudeMdSection, so a member's empty AGENTS.md survives them as it does pull. Removing a block at the top of a file keeps the next one there, so a file teamai created still goes with its last block. - `remove rules` refreshes with the rules this member's pull delivers (role, project and tag selection) instead of every rule in the repo. - doctor reports a Codex team-rules block left behind when the team has no rules, and nothing else in that case. - teamRulesBlock strips the block markers wherever they appear in a rule, not only as whole lines, since the block is located by substring. * refactor(rules): split legacy Codex rule-copy ownership out of the reclaim legacyRuleCopies classifies each .codex/rules copy (and the codex-internal and tcodex dirs) as teamai's or edited, on the ledger, team-render, tombstone and shipped-recall proofs reclaimLegacyRuleCopies used inline. Read-only and public so uninstall can apply the same check. No behavior change. * fix(uninstall): keep edited legacy Codex rule copies, remove removed rules' copies Uninstall picked every .md in a legacy rules dir whose name matched a current team rule or a built-in, so it deleted copies a pull had kept as the member's edits, and left copies of rules the team had tombstoned. It now takes the legacy dirs from RulesHandler.legacyRuleCopies, the check pull reclaims by: owned copies go, edited ones stay and are named in one English warning. The tool's current rules dir is unchanged. Addresses the codex-review findings on #940. * fix(rules): give Codex the team rules through its session-start hook The project AGENTS.md the earlier revision wrote the rules into is read by Cursor, Copilot, OpenCode and Claude too, which already get the rules in their own format. The Codex family now gets them from the teamai session-start hook instead, and pull writes no rule file for it. - A team-rules handler adds the user-scope rules, then the cwd project's, as pull resolves them, skipping a scope that does not enable the tool. It adds nothing on resume, whose history already holds them. - A SubagentStart entry gives a fresh subagent the same rules. - Both entries set additionalContextLimit: 0; past 2,500 tokens Codex keeps only the start and end of a hook's context. - doctor checks the limit on the session-start entry; the AGENTS.md block check, its markers and its uninstall handling are gone. The block never shipped. - Culture, shared instructions and recall still go to AGENTS.md; the old .codex/rules cleanup and the remove-rules role filter are unchanged. For #938. * test(tool-roots): expect Codex's instruction file under CODEX_HOME #942 pinned Codex's default paths before #938 moved its rules to the session-start hook: no rules path, and an AGENTS.md that follows the root in user scope. * fix(rules): keep Codex's project content out of AGENTS.md (#945) The project AGENTS.md is the owners' file, and Cursor, Copilot, OpenCode and Claude read it too. The Codex family now takes its project content from the session hooks and its user content from its own AGENTS.md: - Project scope: no `claudemd` in the Codex-family defaults, so pull writes nothing to the project AGENTS.md. The session-start and subagent-start hooks add the project's rules plus the culture, claudemd/ and recall blocks, leaving out a block another tool already wrote into the project AGENTS.md. - User scope: the team rules go into a team-rules block of ~/.codex/AGENTS.md (and the variants' homes), beside the other blocks; the hook adds nothing outside a project. The "Already synced" pull writes the block too. - doctor checks that block in user scope, and both hook entries' limit in a project. uninstall removes the block. For #938. * fix(rules): keep tombstoned Codex copies without delivery records
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
* fix(config): honor CODEX_HOME through toolRoots Codex keeps its home in $CODEX_HOME, but teamai resolved every Codex path under ~/.codex, so a member who exports the variable got no skills, hooks, agents or MCP in the directory Codex reads, and doctor stayed green. Extend the toolRoots relocation built for CLAUDE_CONFIG_DIR (Tencent#725) to Codex. A RELOCATABLE_TOOLS table maps each tool to its variable; init records CODEX_HOME into toolRoots.codex, a re-init that moves the root releases the old hooks and managed MCP servers, and doctor adds a "Codex root matches CODEX_HOME" check. The two Codex writes outside toolPaths now follow the root: the co-author setting in config.toml and the skill-existence probe used by usage tracking. The doctor check compares the paths each root resolves to rather than requiring a record, so an unrecorded CODEX_HOME=~/.codex passes while an unrecorded CLAUDE_CONFIG_DIR=~/.claude still fails (it moves .claude.json). Closes Tencent#939 * fix(config): address review on CODEX_HOME relocation Derive the Codex co-author file from the scoped paths, list relocatable skill roots from RELOCATABLE_TOOLS, and skip the root-release warning for a tool the member does not sync or whose old root does not exist. * fix(coauthor): resolve the Codex config root, not the skills mapping A team mapping toolPaths.codex.skills to .agents/skills sent the Codex co-author setting to ~/.agents/config.toml. Resolve each Codex's own root (toolRoots.codex or ~/.codex, ~/.tcodex, ~/.codex-internal) instead.
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…s own AGENTS.md in user scope (Tencent#940) * fix(rules): inline rules without frontmatter, naming path-scoped globs hermesRulesText becomes inlinedRulesText, the one renderer for tools that read rules from a single instructions file. It strips frontmatter and leads a path-scoped rule with 'Applies to files matching: <globs>'. Hermes SOUL.md and doctor's Hermes check use it. Part of Tencent#938. * fix(rules): inline team rules into Codex AGENTS.md in project scope Codex reads instructions from AGENTS.md, not from .codex/rules, so the copies pull wrote there never reached it (Tencent#938). The codex defaults drop rules and gain claudemd (AGENTS.md, ~/.codex/AGENTS.md at user scope). pullAllRules syncs a [teamai:team-rules] block into that file once per path while an enabled, installed Codex-family tool maps it, and removes it otherwise. syncManagedInstructions probes rules ?? settings, so a machine without Codex gets no ~/.codex. * fix(rules): render the Codex team-rules block with inlinedRulesText Follows the T3 rename, so a path-scoped rule reaches AGENTS.md without frontmatter, after its Applies to line. * test(rules): cover Codex AGENTS.md in user scope, culture, shared instructions and recall Codex now reaches AGENTS.md through its default claudemd path; these tests pin user scope (~/.codex/AGENTS.md), a full project-scope pull writing all four teamai blocks into one AGENTS.md, and recall on/off. Also corrects the injectRecallBlockIntoTools comment, which listed Codex as skipped. * fix(rules): remove Codex team rules and their old copies on uninstall Uninstall strips the [teamai:team-rules] block and scans the legacy .codex/rules directory for teamai's copies. A shared instruction file now keeps only the blocks a remaining enabled, installed tool would write, so --agent codex drops the team-rules block while Pi keeps its own. * fix(doctor): check the team-rules block in Codex AGENTS.md Codex reads no rules directory, so doctor now compares the team-rules block in each AGENTS.md an enabled, installed Codex-family tool maps with what pull renders. It fails on a missing or stale block, on an AGENTS.override.md that Codex reads instead, and on an entry with no claudemd path. The file list comes from RulesHandler, the same resolver the pull writes through. * fix(rules): remove the .codex/rules copies earlier pulls delivered Codex never read the <rule>.md copies teamai wrote to .codex/rules (and .codex-internal/rules, .tcodex/rules). Every rules sync now removes the ones that still hold what teamai delivered, including teamai-recall.md, keeps edited copies and names them, and leaves *.rules alone. * docs(rules): document where Codex reads team rules (AGENTS.md) * fix(rules): give Codex its AGENTS.md rules on an already-synced pull A CLI upgrade with the team repo unchanged takes the "Already synced" fast path, which never ran the rules sync. So a member upgrading from 0.22.0 got no team-rules block in AGENTS.md and kept the old .codex/rules copies until the repo moved or they ran pull --force. The fast path now runs the Codex part of the rules sync (block + reclaim) and nothing else. * fix(doctor): tell a Codex member a plain pull restores the team-rules block The already-synced pull now rewrites the block, so the fix text no longer sends the member to pull --force. * fix(rules): give codex-internal and tcodex the codex instructions layout codex-internal and tcodex drop their rules path and read team rules from AGENTS.md like codex. Codex-family instruction writers probe rules ?? settings ?? skills, so a team entry with neither rules nor settings no longer counts as installed. writesInstructionBlock is the one answer to which blocks a tool gets, shared by pull's writers and uninstall. * fix(rules): keep an empty AGENTS.md that held no team-rules block removeClaudeMdSection now reports whether it removed a section and can delete a file left holding only whitespace. The team-rules sync and recall off use it, so a pull that removed nothing no longer deletes a member's own empty AGENTS.md. * fix(doctor): pass the Codex team-rules check when no rule has a body When every team rule is frontmatter only, pull writes no team-rules block, so a missing block is correct and an AGENTS.override.md shadows nothing. Also note that an empty override shadows AGENTS.md too. * fix(doctor): a plain pull applies the Codex claudemd toolPaths fix Editing teamai.yaml moves the team repo, so a plain pull does the full sync; --force is not needed. Matches the other Codex block checks. * fix(uninstall): name the instruction file uninstall cleans The summary and result lines said CLAUDE.md for every instruction file, including Codex's AGENTS.md. They now print the file's path under an 'Instruction-file blocks' heading. * refactor(recall): gate the recall block on writesInstructionBlock recall on now asks the same question as pull's recall writer and uninstall, so the three cannot drift. No behavior change. * fix(rules): reclaim .codex/rules copies of rules the team removed The tombstone cleanup walks toolPath.rules, which Codex no longer has, so a copy of a rule tombstoned after the member's last pre-Tencent#938 pull stayed forever. The legacy reclaim now removes tombstoned names too, keeping and naming a copy the member changed since delivery (Tencent#822). * test(rules): cover codex-internal and tcodex in reclaim, doctor and uninstall Parametrizes the project-scope legacy reclaim, the four Codex doctor failure cases and the full uninstall over the Codex family. * test(pull): cover the project-scope Codex fast path after an upgrade * test(local-agent): pin the prompt sync into Codex's AGENTS.md With Codex's default claudemd (Tencent#938), an HTTP prompt command reported by Codex writes the shared-instructions block into ~/.codex/AGENTS.md when ~/.codex exists, and creates nothing when it does not. * refactor(rules): move rulePaths into rule-format It reads a tool-neutral rule's paths: frontmatter, which both the Copilot renderer and the inlined-rules renderer use; it no longer lives in the Copilot module. * fix(doctor): ask nothing of a Codex entry that delivers no rules to it A team toolPaths entry such as codex: { agents: .codex/agents } has neither rules nor claudemd: the team sends Codex no rules on purpose, like any tool without a rules path. Doctor failed it on every member's machine (E2E doctor-delivery-cli). It now fails only an entry that still lists the pre-Tencent#938 rules path without claudemd. Part of Tencent#938. * fix(rules): keep a teamai-recall.md the member edited since the last pull The legacy Codex reclaim removed any .codex/rules/teamai-recall.md that opened with the recall heading, so text a member appended after the last pull that wrote it was deleted. The built-in rule is not in the delivery ledger, so match the file against the exact bodies teamai deployed instead; an edited copy is kept and named like other legacy copies. * fix(rules): keep a member's empty AGENTS.md when the team-rules block goes Removing the last block deleted any instructions file it left empty, so an empty AGENTS.md a repository tracked was deleted once Codex was disabled or the team had no rules left. injectClaudeMdSection now creates a file as just the block, and deleteIfEmpty deletes only a file that opens with it; a member's empty file is written back empty. Also describe the per-block cleanup of shared instruction files in the deployed uninstall skill. * fix(rules): address review on uninstall, remove, doctor and markers - uninstall and the legacy [teamai:rules] strip remove blocks through removeClaudeMdSection, so a member's empty AGENTS.md survives them as it does pull. Removing a block at the top of a file keeps the next one there, so a file teamai created still goes with its last block. - `remove rules` refreshes with the rules this member's pull delivers (role, project and tag selection) instead of every rule in the repo. - doctor reports a Codex team-rules block left behind when the team has no rules, and nothing else in that case. - teamRulesBlock strips the block markers wherever they appear in a rule, not only as whole lines, since the block is located by substring. * refactor(rules): split legacy Codex rule-copy ownership out of the reclaim legacyRuleCopies classifies each .codex/rules copy (and the codex-internal and tcodex dirs) as teamai's or edited, on the ledger, team-render, tombstone and shipped-recall proofs reclaimLegacyRuleCopies used inline. Read-only and public so uninstall can apply the same check. No behavior change. * fix(uninstall): keep edited legacy Codex rule copies, remove removed rules' copies Uninstall picked every .md in a legacy rules dir whose name matched a current team rule or a built-in, so it deleted copies a pull had kept as the member's edits, and left copies of rules the team had tombstoned. It now takes the legacy dirs from RulesHandler.legacyRuleCopies, the check pull reclaims by: owned copies go, edited ones stay and are named in one English warning. The tool's current rules dir is unchanged. Addresses the codex-review findings on Tencent#940. * fix(rules): give Codex the team rules through its session-start hook The project AGENTS.md the earlier revision wrote the rules into is read by Cursor, Copilot, OpenCode and Claude too, which already get the rules in their own format. The Codex family now gets them from the teamai session-start hook instead, and pull writes no rule file for it. - A team-rules handler adds the user-scope rules, then the cwd project's, as pull resolves them, skipping a scope that does not enable the tool. It adds nothing on resume, whose history already holds them. - A SubagentStart entry gives a fresh subagent the same rules. - Both entries set additionalContextLimit: 0; past 2,500 tokens Codex keeps only the start and end of a hook's context. - doctor checks the limit on the session-start entry; the AGENTS.md block check, its markers and its uninstall handling are gone. The block never shipped. - Culture, shared instructions and recall still go to AGENTS.md; the old .codex/rules cleanup and the remove-rules role filter are unchanged. For Tencent#938. * test(tool-roots): expect Codex's instruction file under CODEX_HOME Tencent#942 pinned Codex's default paths before Tencent#938 moved its rules to the session-start hook: no rules path, and an AGENTS.md that follows the root in user scope. * fix(rules): keep Codex's project content out of AGENTS.md (Tencent#945) The project AGENTS.md is the owners' file, and Cursor, Copilot, OpenCode and Claude read it too. The Codex family now takes its project content from the session hooks and its user content from its own AGENTS.md: - Project scope: no `claudemd` in the Codex-family defaults, so pull writes nothing to the project AGENTS.md. The session-start and subagent-start hooks add the project's rules plus the culture, claudemd/ and recall blocks, leaving out a block another tool already wrote into the project AGENTS.md. - User scope: the team rules go into a team-rules block of ~/.codex/AGENTS.md (and the variants' homes), beside the other blocks; the hook adds nothing outside a project. The "Already synced" pull writes the block too. - doctor checks that block in user scope, and both hook entries' limit in a project. uninstall removes the block. For Tencent#938. * fix(rules): keep tombstoned Codex copies without delivery records
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
Codex joins Claude Code as a relocatable tool.
initrecordsCODEX_HOMEintotoolRoots.codex, and every Codex user-root path follows it, the hook root in project scope included. This reuses the #725toolRootsmechanism, so no new command or config key is added.The doctor check now compares the paths each root resolves to, not "is a root recorded". An unrecorded
CODEX_HOME=~/.codexpasses because recording it would move nothing. An unrecordedCLAUDE_CONFIG_DIR=~/.claudestill fails, because it moves.claude.json.Closes #939
Evidence
Real CLI run of the issue's reproduction (
npm run build, sandboxHOME, local bare team repo with one skill,CODEX_HOME=$HOME/.codex-alt, no~/.codex). Commands:teamai init <repo> --provider git --scope user --agent codex --force,teamai pull --force,teamai doctor.Before (
origin/maindf940cd):After:
Before (initialized with
~/.codex, thenCODEX_HOMEexported):doctorshows no root check. The only failure is an indirect✖ Skills delivered to codex.After:
New unit tests pass:
tool-roots: Codex paths move to the root; hooks land in.codex-alt/hooks.jsonand~/.codexis never created;detectToolRootreadsCODEX_HOME.init: recordsCODEX_HOME; says nothing about a Codex root a Claude-only member never synced.doctor: fails and names both directories; passes when recorded; passes for an unrecorded explicit~/.codex.coauthor-reconcile:commit_attributiongoes to.codex-alt/config.toml, and stays in~/.codex/config.tomlwhen the team mapstoolPaths.codex.skillsto.agents/skills.usage-tracking: a skill under the recorded Codex root counts as installed.Co-author with a custom Codex skills mapping (review finding). Real CLI
teamai pull --force, sandboxHOME, teamtoolPaths.codex: { skills: .agents/skills },sharing.coAuthor.enabled: false, noCODEX_HOME:Checks:
npx tsc --noEmitandnpm run lintpass.npx vitest run: 6663 passed, 1 skipped, 2 failed inpush-env.test.ts. Those are timing failures under full-suite load: the file passes on its own (19/19) with and without this change.Merge Danger
Door: two-way
Nothing changes until a member runs
initwithCODEX_HOMEset. Reverting drops support for thetoolRoots.codexkey: an older CLI warns "Ignoring toolRoots.codex" and syncs to~/.codexagain.Blast Radius: Codex
CODEX_HOMEsee different behavior. After re-runninginit, their hooks and managed MCP servers are removed from the previous Codex root, and skills and rules there are left and named in the output.codex-internalandtcodexare unchanged.src/models/switch.tsstill reads the liveCODEX_HOMEfor model switching, as it does for Claude. A process without the variable, such as a hook, would switch models in~/.codex. This behavior predates this PR and is out of scope here.AGENTS.md) will follow the root automatically if it declares the file astoolPaths.codex.claudemd.