Skip to content

Codex Stop hook emits invalid JSON when workflow guidance is active #74

Description

@obrunogonzaga

Problem

When @dotcontext/cli@1.1.1 dispatches a Codex Stop hook while PREVC workflow guidance is active, stdout contains only hookSpecificOutput:

{
  "hookSpecificOutput": {
    "hookEventName": "Stop",
    "additionalContext": "dotcontext workflow guide: ..."
  }
}

Codex CLI 0.142.4 rejects that output with:

Stop hook (failed) error: hook returned invalid stop hook JSON output
Image

Expected

Codex Stop output should use fields accepted by Codex for Stop hooks, e.g. continue plus systemMessage, while preserving hookSpecificOutput for Codex SessionStart if needed.

Example:

{
  "continue": true,
  "systemMessage": "dotcontext workflow guide: ..."
}

Repro Context

  • @dotcontext/cli: 1.1.1
  • Codex CLI: 0.142.4
  • Hook source: codex
  • Event: Stop
  • Workflow: active PREVC guidance

Impact

The hook failure is noisy and makes Codex users disable or remove the Stop hook instead of receiving dotcontext workflow guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions