Skip to content

Avoid sending orphaned reasoning items to OpenAI Responses API#11140

Open
siewcapital wants to merge 1 commit intocontinuedev:mainfrom
Siew-s-Capital:fix/openai-codex-reasoning-item-order-11138
Open

Avoid sending orphaned reasoning items to OpenAI Responses API#11140
siewcapital wants to merge 1 commit intocontinuedev:mainfrom
Siew-s-Capital:fix/openai-codex-reasoning-item-order-11138

Conversation

@siewcapital
Copy link

@siewcapital siewcapital commented Mar 6, 2026

Summary\n- only include messages in when a later assistant message exists\n- skip trailing/orphaned reasoning items so we don't send invalid entries without the required follow-up item\n- add regression tests that cover both skipped trailing reasoning and preserved reasoning before assistant output\n\n## Testing\n- undefined

 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "vitest" not found (fails in this environment: )\n\nCloses #11138


Continue Tasks: 🔄 7 running — View all


Summary by cubic

Stops sending orphaned reasoning items to the OpenAI Responses API by only including “thinking” entries when followed by an assistant message. Prevents invalid input and enforces correct item order. Fixes #11138.

  • Bug Fixes
    • Skip trailing “thinking” messages without a following assistant.
    • Preserve reasoning when followed by assistant output.
    • Add unit tests covering both scenarios.

Written for commit d90c504. Summary will update on new commits.

@siewcapital siewcapital requested a review from a team as a code owner March 6, 2026 21:03
@siewcapital siewcapital requested review from Patrick-Erichsen and removed request for a team March 6, 2026 21:03
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-merge size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Error: OpenAI Codex - 400

1 participant