Repository navigation
Codex/hooks model lifecycle - [OPENCLAW CONTRIBUTOR VINCENT K] - #19182
pash-openai wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 544282868e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "needs_follow_up": { | ||
| "type": "boolean" |
There was a problem hiding this comment.
Allow null needs_follow_up in post-model hook schema
The post-model hook schema declares needs_follow_up as boolean, but runtime sends None for failed/interrupted responses, which serializes as null. Schema-driven hook consumers will reject these events. Make this field nullable in the schema (or omit it when absent) so failed/interrupted payloads conform to the documented contract.
Useful? React with 👍 / 👎.
| let hook_prompt_input = match serde_json::to_value(&prompt.input) { | ||
| Ok(input) => input, | ||
| Err(_) => Value::Null, | ||
| }; | ||
| let hook_prompt_tools = match serde_json::to_value(&prompt.tools) { | ||
| Ok(tools) => tools, |
There was a problem hiding this comment.
Serialize pre-model hooks from actual outgoing request payload
PreModelRequest currently serializes raw prompt.input and prompt.tools, but the client sends transformed data (get_formatted_input() and create_tools_json_for_responses_api()). Hooks can therefore inspect a payload that differs from what the model actually receives (e.g., apply_patch output reserialization), which breaks auditing/policy logic tied to this lifecycle event.
Useful? React with 👍 / 👎.
External (non-OpenAI) Pull Request Requirements
Before opening this Pull Request, please read the dedicated "Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md
If your PR conforms to our contribution guidelines, replace this text with a detailed and high quality description of your changes.
Include a link to a bug report or enhancement request.