Skip to content

fix(codex): omit empty additionalContext in hook output - #910

Open
pradigmaz wants to merge 2 commits into
mksglu:nextfrom
pradigmaz:fix/omit-empty-codex-hook-context
Open

fix(codex): omit empty additionalContext in hook output#910
pradigmaz wants to merge 2 commits into
mksglu:nextfrom
pradigmaz:fix/omit-empty-codex-hook-context

Conversation

@pradigmaz

@pradigmaz pradigmaz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove empty additionalContext from Codex PostToolUse and UserPromptSubmit hook output.

Why

An empty string produces a blank hook context: section in the Codex UI.

Verification

  • added tests that assert both hook scripts omit additionalContext
  • node hooks/codex/posttooluse.mjs -> {"hookSpecificOutput":{"hookEventName":"PostToolUse"}}
  • node hooks/codex/userpromptsubmit.mjs -> {"hookSpecificOutput":{"hookEventName":"UserPromptSubmit"}}

@beastawakens

Copy link
Copy Markdown
Contributor

Confirmed this still reproduces with context-mode 1.0.169 and Codex CLI 0.147.0 on macOS. Successful PostToolUse and UserPromptSubmit hooks show an empty hook context: block because the Codex adapter returns additionalContext: "".

This patch matches the observed cause and should remove the blank section. All current checks pass. Could a maintainer review this for next?

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.

3 participants