code-abyss icon indicating copy to clipboard operation
code-abyss copied to clipboard

codex hooks config is generated with invalid TOML schema

Open EricDasha opened this issue 5 months ago • 1 comments

After installing code-abyss v4.7.1 for Codex on Windows, running codex fails:

Error loading config.toml: invalid type: map, expected a sequence
in `hooks`

The generated ~/.codex/config.toml contains:

[hooks.SessionStart]
timeout = 10
command = "bash \"C:/Users/Admin/.codex/skills/indexing-code/hooks/common/session-init.sh\""
matcher = "startup|resume"

[hooks.PreToolUse]
timeout = 5
command = "bash \"C:/Users/Admin/.codex/skills/indexing-code/hooks/common/pre-edit-check.sh\""
matcher = "Bash|shell"

But Codex expects array-style hooks:

[[hooks.SessionStart]]
matcher = "startup|resume"

[[hooks.SessionStart.hooks]]
type = "command"
command = "bash \"C:/Users/Admin/.codex/skills/indexing-code/hooks/common/session-init.sh\""
timeout = 10

[[hooks.PreToolUse]]
matcher = "Bash|shell"

[[hooks.PreToolUse.hooks]]
type = "command"
command = "bash \"C:/Users/Admin/.codex/skills/indexing-code/hooks/common/pre-edit-check.sh\""
timeout = 5

Could you update the Codex installer to generate the new hooks schema?

Also, on Windows, command = "bash ..." may fail if Git Bash is not in PATH, so command_windows support would be helpful.

EricDasha avatar Jun 12 '26 15:06 EricDasha

Fixed in v4.7.2 (just published to npm). Thanks for the precise report and the suggested schema — both spot on.

What changed

  • The installer now generates the array-of-tables hooks schema Codex 0.125+ expects: [[hooks.SessionStart]] + [[hooks.SessionStart.hooks]] (and likewise for PreToolUse), instead of the deprecated flat [hooks.X] form that triggered invalid type: map, expected a sequence in hooks.
  • Added the Windows command_windows override you asked for: on Windows the installer locates Git Bash (where bash, then common install dirs) and emits command_windows, so the hook scripts run even when Git Bash isn't on PATH.

To pick it up

npx code-abyss@latest -t codex -y

No need to hand-edit your existing ~/.codex/config.toml — the old flat [hooks.*] block carries our marker, so the reinstall re-anchors it into the new array-of-tables form automatically.

Closed via #50 (fix) and shipped in #51 → v4.7.2. Reopen if anything's still off on your end. 🙏

telagod avatar Jun 13 '26 14:06 telagod