Skip to content

fix: codex stop hook guidance output - #75

Open
obrunogonzaga wants to merge 1 commit into
vinilana:mainfrom
obrunogonzaga:fix/codex-stop-system-message
Open

fix: codex stop hook guidance output#75
obrunogonzaga wants to merge 1 commit into
vinilana:mainfrom
obrunogonzaga:fix/codex-stop-system-message

Conversation

@obrunogonzaga

@obrunogonzaga obrunogonzaga commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Map Codex Stop workflow guidance to systemMessage instead of hookSpecificOutput.
  • Keep Codex SessionStart guidance behavior unchanged.
  • Update dispatch and round-trip tests for the Codex Stop contract.
image

Root cause

Codex rejects active Stop hook stdout that only contains hookSpecificOutput. With active PREVC guidance, dotcontext emitted that shape, so Codex reported hook returned invalid stop hook JSON output.

Validation

  • npx jest src/integrations/__tests__/hookRoundTrip.test.ts --runInBand
  • npx jest src/cli/services/__tests__/hookDispatchService.test.ts --runInBand
  • npm test -- --runInBand
  • npm run build

Fixes #74

@obrunogonzaga
obrunogonzaga marked this pull request as ready for review July 1, 2026 13:12
Comment on lines +618 to 620
continue: true,
systemMessage: expect.stringContaining('feature-x'),
});

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prevent this to happen to other harnesses as well, this is why it was a generic message, we should map to Codex output and so others instead of only covering it here for Codex, because we support other tools, @cursoragent can you help us here?

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.

Codex Stop hook emits invalid JSON when workflow guidance is active

2 participants