fix(codex): generate array-of-tables hooks schema (Codex 0.125+)#50
Merged
Conversation
Codex 0.125+ rejects the flat [hooks.X] table form with 'invalid type: map, expected a sequence in hooks', breaking codex startup after install. - injectCodexHooks now emits [[hooks.X]] + [[hooks.X.hooks]] array-of-tables; marker-based block injection keeps idempotency, stale-path re-anchoring, and user-owned hook preservation - stripCodexAbyssIntegration groups [[hooks.X]] units for clean uninstall - resolveWindowsBash() locates Git Bash at install time and emits command_windows so hooks run when bash is not on PATH (Windows) - install-hooks.sh codex branch updated to the same schema Verified: generated TOML parses cleanly; 410 tests pass. Fixes #49
This was referenced Jun 13, 2026
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.
Problem
Closes #49. After installing for Codex,
codexfails to start:Codex 0.125+ deprecated the flat
[hooks.X]table form. It now requires array-of-tables:[[hooks.X]]+[[hooks.X.hooks]]. Both our generators emitted the old form.Fix
injectCodexHooksrewritten to emit[[hooks.X]](matcher) +[[hooks.X.hooks]](type/command/timeout/statusMessage). Marker-based block injection preserves the prior contracts: idempotent re-runs, stale-path re-anchoring, and non-destructive skip when a user owns the event.stripCodexAbyssIntegrationupgraded to group[[hooks.X]]units so uninstall stays clean.resolveWindowsBash()added — at install time on Windows it locates Git Bash (where bash→ common install dirs) and emitscommand_windows, so hooks run even when bash is not on PATH (the reporter's second ask). Omitted on non-Windows.install-hooks.shcodex branch updated to the same schema.Verification
tomllib; parsed structure matches thehooks.jsonsource shape exactly.npm test→ 410 passed (added 3 assertions: array-table form, conditionalcommand_windows).npm run verify:skills→ 30 skills pass.Out of scope
Web research flagged a separate Codex regression where inline config.toml hooks may not fire interactively (workaround: write
~/.codex/hooks.json). That is distinct from this parse-error crash and not addressed here.