Skip to content

Codex/hooks model lifecycle - [OPENCLAW CONTRIBUTOR VINCENT K] - #19182

Closed
pash-openai wants to merge 5 commits into
openai:mainfrom
vincentkoc:codex/hooks-model-lifecycle
Closed

pash-openai wants to merge 5 commits into
openai:mainfrom
vincentkoc:codex/hooks-model-lifecycle

Conversation

@pash-openai

Copy link
Copy Markdown
Contributor

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.

@pash-openai
pash-openai requested a review from a team as a code owner April 23, 2026 18:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +29 to +30
"needs_follow_up": {
"type": "boolean"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +1887 to +1892
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

2 participants