fix(ai): skip reasoning-only responses replay #838
Closed
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.
I have two reports where we corrupted the session for OpenAI:
OpenAI Responses 400: “Item ‘rs_…’ of type ‘reasoning’ was provided without its required following item.”
Trigger: history replay includes assistant turns with only thinking/reasoning (often from aborted runs). pi-ai replays thinking Signature as a reasoning item even when the same turn has no message or function_call.
OpenAI Responses reasoning item replay causes 400 (missing following item) moltbot/moltbot#1126
OpenAI GPT-5.2: reasoning item without required following item moltbot/moltbot#1158
I did check and found no docs (ofc) but forum entries and it happening twice seems this is a real issue.
Don't have session logs.
vibed pr. fix is small and for now I ship a local workaround.