Skip to content

Tighten hook output event schemas#24962

Merged
abhinav-oai merged 1 commit into
mainfrom
abhinav/tighten-hook-output-event-schemas
May 28, 2026
Merged

Tighten hook output event schemas#24962
abhinav-oai merged 1 commit into
mainfrom
abhinav/tighten-hook-output-event-schemas

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

Why

Fixes #23993.

Hook command output schemas are published as the contract for hook authors and schema-driven tooling. The event-specific output schemas previously described hookSpecificOutput.hookEventName as the global HookEventNameWire enum, so a pre-tool-use.command.output schema would validate mismatched values like PostToolUse. That made the schemas less precise than the intended event-specific contract.

What

Constrain each hook-specific output schema to the matching literal hookEventName value, mirroring the existing input-schema shape.

Also split SubagentStartHookSpecificOutputWire from the session-start output wire so subagent-start.command.output.schema.json can emit const: "SubagentStart" instead of sharing the session-start definition.

Verification

  • cargo nextest run -p codex-hooks
  • just fix -p codex-hooks
  • just argument-comment-lint -p codex-hooks -- --all-targets

@abhinav-oai abhinav-oai marked this pull request as ready for review May 28, 2026 20:50
@abhinav-oai abhinav-oai merged commit a576be2 into main May 28, 2026
31 checks passed
@abhinav-oai abhinav-oai deleted the abhinav/tighten-hook-output-event-schemas branch May 28, 2026 22:55
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten hookSpecificOutput.hookEventName schemas to the matching hook event

2 participants