@plugin-creator validator rejects supported plugin hooks manifest field
Summary
The bundled @plugin-creator sample still treats hooks as an unsupported plugin manifest field, but current Codex plugin documentation and runtime code support plugin-bundled hooks.
This creates a false-negative validation failure for valid plugin manifests that include:
{
"hooks": "./hooks/hooks.json"
}
Evidence
Current official documentation:
Build pluginssays plugins are appropriate when authors want to package lifecycle hooks: [https://developers.openai.com/codex/plugins/build](<https://developers.openai.com/codex/plugins/build>)Hookssays installed plugins can bundle lifecycle config through their plugin manifest or a defaulthooks/hooks.jsonfile: [https://developers.openai.com/codex/hooks](<https://developers.openai.com/codex/hooks>)
Current open-source runtime also supports plugin hooks:
codex-rs/core-plugins/src/manifest.rsparseshooksin plugin manifests.codex-rs/core-plugins/src/loader.rsdiscovers defaulthooks/hooks.json.codex-rs/plugin/src/load_outcome.rsexposeseffective_plugin_hook_sources.- Historical PRs: [#19705](<https://github.com/openai/codex/issues/19705>) discovered hooks bundled with plugins; [#22549](<https://github.com/openai/codex/issues/22549>) enabled plugin hooks by default; [#26272](<https://github.com/openai/codex/issues/26272>) optimized hook-only plugin loading.
Current @plugin-creator content still says otherwise:
codex-rs/skills/src/assets/samples/plugin-creator/SKILL.mdsays to omit unsupported fields includinghooks.codex-rs/skills/src/assets/samples/plugin-creator/references/plugin-json-spec.mdsays validation rejects unsupported manifest fields such ashooks.codex-rs/skills/src/assets/samples/plugin-creator/scripts/validate_plugin.pyexcludeshooksfrom allowed top-level manifest keys.
Reproduction
- Create or install a valid local plugin with
.codex-plugin/plugin.jsoncontaining"hooks": "./hooks/hooks.json". - Ensure
hooks/hooks.jsonexists and contains a JSON object. - Run:
python3 codex-rs/skills/src/assets/samples/plugin-creator/scripts/validate_plugin.py <plugin-root>
Expected: validation accepts the supported hooks field.
Actual: validation fails with:
plugin.json field `hooks` is not accepted by plugin validation
Minimal Fix
Keep the scaffold behavior unchanged, but update the sample skill and validator so they match the current plugin contract:
- Remove the
SKILL.mdinstruction that sayshooksis unsupported. - Update
plugin-json-spec.mdsohooksis described as a supported manifest field. - Add
hooksto the validator's top-level allowed keys. - Validate hook path values as in-archive JSON files.
- Accept inline hook config objects and arrays, matching the runtime manifest parser.
I have a local three-file patch for that shape and verified it against a real plugin manifest containing "hooks": "./hooks/hooks.json".
Related but Distinct
openai/codex#16430 tracks plugin hook runtime behavior and is covered by the broader hooks tracker openai/codex#21753. This issue is narrower: the bundled @plugin-creator sample/validator now lags behind the documented and implemented plugin manifest contract.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗