🤖 Add integration test for OpenAI reasoning error #73
+462
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds integration tests to reproduce the intermittent OpenAI reasoning error and updates dependencies to attempt to fix it:
Changes
1. Integration Test (Test Coverage)
File:
tests/ipcMain/openaiReasoning.test.tsTwo test approaches:
cmux-docs-styleworkspace that had 3800+ reasoning parts and 17 tool callsThe deterministic test successfully reproduces the error with 100% consistency on Turn 1.
Run with:
2. Dependency Updates & Configuration Fix
include: ['reasoning.encrypted_content']from provider optionsRationale: Per OpenAI docs, encrypted reasoning content is only needed when
store: false(ZDR compliance). We usestore: true(default) withpreviousResponseId, so OpenAI manages reasoning state automatically.Investigation Results
Key Findings
Error is a Vercel AI SDK bug, tracked in:
Error occurs during streaming on FIRST turn (no history), when:
[stream-start, reasoning-delta..., reasoning-end, tool-call-start, stream-error]Configuration doesn't fix it: Tested both WITH and WITHOUT
include: ['reasoning.encrypted_content']- error occurs in both casesSDK updates don't fix it: Error persists even with latest AI SDK 5.0.60
Debug Dumps
Test creates detailed dumps in
~/.cmux/debug_obj/:1_original_messages.json- Messages from history1b_openai_stripped.json- After stripping reasoning2_model_messages.json- After convertToModelMessages3_final_messages.json- Final messages sent to APIKnown Limitation
Testing Status
Next Steps
If monitoring shows the error persists in production:
Generated with
cmux