Skip to content

Fix Codex reasoning replay after session resume - #5461

Merged
freeqaz-openai merged 1 commit into
mainfrom
fix/codex-reasoning-content-replay
Nov 11, 2026
Merged

freeqaz-openai merged 1 commit into
mainfrom
fix/codex-reasoning-content-replay

Conversation

@freeqaz-openai

Copy link
Copy Markdown
Collaborator

Problem

After Codex reloads saved history, manual compaction and ordinary turns can fail through protected Responses inference. Codex saves a reasoning item with empty content by omitting the field. A subsequent process can reload that item and replay it as content: null. The request validator rejects that representation before Secret access.

Change

Accept explicit null for content on replayed reasoning input. Content arrays still require the existing reasoning text shape. The egress regression checks that the provider receives the request unchanged and that malformed reasoning, mismatched compaction metadata, hosted tools, and models outside the grant cannot read a Secret or dispatch.

Verification

  • Ran packaged Codex 0.164.0 against a synthetic loopback provider in a container without external networking. At both tested reasoning efforts, the fresh process omitted the field and compacted successfully. After a process restart and thread resume, the same saved shape produced explicit null and the baseline rejected it.
  • With the patch, all three resumed cases completed compaction, continued with the unique synthetic summary, and compacted again. One case used an initialized Git workspace.
  • The new assertion failed on the public base at request admission. Three focused static egress cases passed on the patch, including unchanged forwarding and pre-access rejection controls.
  • Typecheck, scoped ESLint, workspace boundary, formatting, docs checks, and flow validation passed.
  • An independent source review found no P0–P2 issues in the final diff.

Risks

The admission change applies to one optional field on an existing request item. The accepted null value contains no text and enables no tool. The provider-facing response schema continues to require an array if reasoning content is present.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@freeqaz-openai
freeqaz-openai marked this pull request as ready for review November 11, 2026 11:09
@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner November 11, 2026 11:09
@freeqaz-openai
freeqaz-openai merged commit e445695 into main Nov 11, 2026
44 of 45 checks passed
@freeqaz-openai
freeqaz-openai deleted the fix/codex-reasoning-content-replay branch November 11, 2026 11:18
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.

1 participant