Skip to content

feat: pass hooks through natively for codex instead of degrading to prose - #10

Merged
Disdjj merged 1 commit into
mainfrom
feat/codex-native-hooks
Aug 24, 2026
Merged

feat: pass hooks through natively for codex instead of degrading to prose#10
Disdjj merged 1 commit into
mainfrom
feat/codex-native-hooks

Conversation

@Disdjj

@Disdjj Disdjj commented Aug 24, 2026

Copy link
Copy Markdown
Member

Follow-up to #9 (this commit was pushed after the merge).

Codex plugins support native hooks — default file hooks/hooks.json at the plugin root, Claude-compatible schema: same events (incl. SessionStart/Stop/PreCompact/SubagentStart), matchers, type:command, additionalContextLimit. Sources: plugins guide ("The default plugin hook file is hooks/hooks.json … you don't need a hooks entry in .codex-plugin/plugin.json") and the hooks reference.

So convertHooks(codex) now passes hooks through losslessly to hooks/hooks.json (fields beyond our HookEntry type survive since the scanner keeps parsed JSON; Codex itself skips non-command handler types) and warns that plugin hooks are non-managed (/hooks trust review). The AGENTS.md prose degradation stays for opencode only, where #9's PreCompact inclusion and timing phrases still apply. README capability table updated.

Verified end-to-end on the llmdoc plugin surface: all three hook events land in hooks/hooks.json with additionalContextLimit: 1200 intact, no AGENTS.md fallback. 92 tests pass (2 new passthrough tests; degradation tests moved to opencode).

…rose

Codex plugins do support native hooks: the default hook file is
hooks/hooks.json at the plugin root with a Claude-compatible schema —
same events (SessionStart/Stop/PreCompact and more, incl. SubagentStart),
matchers, type:command, additionalContextLimit. Verified against
https://developers.openai.com/plugins/build/plugins and
https://learn.chatgpt.com/docs/hooks.

convertHooks(codex) now emits hooks/hooks.json losslessly (fields beyond
our HookEntry type survive since the scanner keeps the parsed JSON) and
warns that plugin hooks are non-managed (users trust via /hooks). The
AGENTS.md degradation path remains for opencode only; the PreCompact
inclusion and timing phrases from the previous commit still apply there.
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.

1 participant