Bug: ool_calls must be followed by ool messages error when approving prefix rules
Environment
- Application: Codex Desktop (Windows)
- Version: v0.135.0
Steps to Reproduce
- Trigger a command requiring escalated permissions (write file, install package)
- Click Yes, and don't ask again for commands that start with...
- Error appears:
{"error":{"message":"An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'."}}
Expected
Prefix rule saved, command executes normally.
Actual
API call fails. The approval flow breaks the required assistant(tool_calls) -> tool message pairing.
Root Cause
When the approval UI modifies internal message history, it violates the OpenAI API invariant that every assistant message with tool_calls must be immediately followed by corresponding tool messages.
Bug: ool_calls must be followed by ool messages error when approving prefix rules
Environment
Steps to Reproduce
Expected
Prefix rule saved, command executes normally.
Actual
API call fails. The approval flow breaks the required assistant(tool_calls) -> tool message pairing.
Root Cause
When the approval UI modifies internal message history, it violates the OpenAI API invariant that every assistant message with tool_calls must be immediately followed by corresponding tool messages.