Skip to content

fix(codex): resolve PYTHON_CMD placeholder in hooks.json for Windows#132

Merged
taosu0216 merged 1 commit intomindfold-ai:mainfrom
yyyzl:fix/codex-hooks-python-cmd
Mar 27, 2026
Merged

fix(codex): resolve PYTHON_CMD placeholder in hooks.json for Windows#132
taosu0216 merged 1 commit intomindfold-ai:mainfrom
yyyzl:fix/codex-hooks-python-cmd

Conversation

@yyyzl
Copy link
Copy Markdown
Contributor

@yyyzl yyyzl commented Mar 27, 2026

Summary

  • Codex hooks.json hardcoded python3, which doesn't exist on Windows (only python). The claude-code and iflow platforms already use resolvePlaceholders() from shared.ts — codex was simply missed.
  • This fix covers both code paths: trellis init --codex (codex.ts) and trellis update (index.tscollectPlatformTemplates). Without the latter, trellis update would detect a false diff between the resolved on-disk file and the raw template.

Changes (4 files)

File Change
packages/cli/src/templates/codex/hooks.json python3{{PYTHON_CMD}} placeholder
packages/cli/src/configurators/codex.ts Call resolvePlaceholders() when writing hooks.json during init
packages/cli/src/configurators/index.ts Call resolvePlaceholders() in collectPlatformTemplates("codex") for update tracking
packages/cli/test/configurators/platforms.test.ts 3 new tests: init resolves correctly, update templates match, raw template retains placeholder

Test plan

  • vitest run test/configurators/platforms.test.ts — 41/41 passed
  • Manual: trellis init --codex on Windows → verify .codex/hooks.json contains "python" not "python3"
  • Manual: trellis update after init → no false diff reported for hooks.json

The codex platform's hooks.json had `python3` hardcoded, but Windows
only has `python`. The claude-code and iflow platforms already use
`resolvePlaceholders()` for this — codex was simply missed.

This fix covers both code paths:
- `trellis init --codex` (codex.ts → writeFile)
- `trellis update` (index.ts → collectPlatformTemplates)

Without the collectPlatformTemplates fix, `trellis update` would detect
a false diff between the resolved on-disk file and the raw template.
@taosu0216 taosu0216 merged commit 0041a52 into mindfold-ai:main Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants