Skip to content

codex-cli 0.118.0 hook failed #138

Closed

Description

@Sinnhu

I've updated to v0.3.20, and created a .codex/hooks.json in the project:
{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "[ -f graphify-out/graph.json ] && echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","systemMessage":"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files."}}' || true" } ] } ] } }

error:
`• Running PreToolUse hook

PreToolUse hook (failed)
error: hook returned invalid pre-tool-use JSON output`

Image

Activity

  1. added a commit that references this issue on Apr 9, 2026
  2. safishamsi commented on Apr 9, 2026

    @safishamsi
    Member

    Fixed in v0.3.21. The root cause was that systemMessage was nested inside hookSpecificOutput, but the codex-cli schema uses additionalProperties: false on that object — so any unknown field fails validation. It now lives at the top level where the schema expects it.

    Upgrade and re-run the install to get the fixed hook:

    pip install --upgrade graphifyy
    graphify codex install
    
  3. added a commit that references this issue on Apr 23, 2026
  4. added a commit that references this issue on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions