codex icon indicating copy to clipboard operation
codex copied to clipboard

invalid_request_error: reasoning item provided without required following item (Codex CLI 0.92)

Open ibabencu opened this issue 10 months ago • 5 comments

Summary

When using Codex CLI (v0.92) with GPT-5 Codex high reasoning, the API returns an invalid_request_error indicating a reasoning item was provided without a required following item.

Error

{
  "error": {
    "message": "Item 'rs_02df0e1c14fc6c3000697b676491008195a9819c02bdf5feab' of type 'reasoning' was provided without its required following item.",
    "type": "invalid_request_error",
    "param": "input",
    "code": null
  }
}

Environment

  • Codex CLI: 0.92
  • Model: GPT-5 Codex (high reasoning)
  • OS: Windows
  • Date/Time: 2026-01-29 (time + timezone not captured)
  • Request ID: N/A

Steps to Reproduce

  1. Run Codex CLI with GPT-5 Codex high reasoning.
  2. Submit a prompt that triggers reasoning items in the request.
  3. API fails with the error above.

Expected

Request succeeds or error message explains the required following item format.

Actual

Request fails with invalid_request_error.

Additional Context

If you need the raw request payload, let me know what to capture from Codex CLI logs and I can provide it.

ibabencu avatar Jan 29 '26 14:01 ibabencu

Hey @ibabencu, do you mind running /feedback and sharing the thread-id?

sayan-oai avatar Jan 29 '26 17:01 sayan-oai

i'll try finding the convo. i hope i can. yolo. Edit: i'll ask codex to find it i have a SS

ibabencu avatar Jan 29 '26 18:01 ibabencu

Hi! Adding redacted technical details (no secrets):

Thread ID: 019c092e-93f4-7e83-8c0b-9c60dabe27a6 Date/Time (UTC): 2026-01-29 ~14:00Z (from local Codex logs) Codex CLI version: 0.92.0 OS: Windows Provider: Azure OpenAI via Codex CLI Model (deployment name): gpt-5.2-codex Reasoning effort: high (via CLI profile)

Error (verbatim):

{
  "error": {
    "message": "Item 'rs_02df0e1c14fc6c3000697b676491008195a9819c02bdf5feab' of type 'reasoning' was provided without its required following item.",
    "type": "invalid_request_error",
    "param": "input",
    "code": null
  }
}

Repro (minimal):

  1. Run Codex CLI with profile high (reasoning effort = high).
  2. Send any prompt (I saw it on a normal user prompt; not tool-specific).
  3. Response fails immediately with the error above.

Redacted request outline (best-effort; NOT a raw wire dump):

POST Responses API (Azure OpenAI)
model: "gpt-5.2-codex"  // deployment name
reasoning: { effort: "high" }
input: [
  { "type": "input_text", "text": "<redacted user prompt>" }
]

Not available in CLI logs by default: request_id, response headers, and raw request/response JSON. If you want me to re-run with a specific debug/logging flag to capture a fully redacted raw dump, tell me which flags/fields you need and I’ll provide it.

Redactions: No API keys, tokens, full base URL, or user paths included.

ibabencu avatar Jan 29 '26 19:01 ibabencu

Additional detail: I ran Codex CLI with the YOLO option (flag: codex --dangerously-bypass-approvals-and-sandbox).

ibabencu avatar Jan 29 '26 20:01 ibabencu

Similar to this https://github.com/openai/codex/issues/13480

Please report if you notice again

charley-oai avatar Mar 05 '26 02:03 charley-oai