Skip to content

Fix reasoning data lost when restoring conversation history#301

Merged
pushpak1300 merged 2 commits into
laravel:0.xfrom
Cbrad24:fix/restore-reasoning-data-from-conversation-history
Apr 30, 2026
Merged

Fix reasoning data lost when restoring conversation history#301
pushpak1300 merged 2 commits into
laravel:0.xfrom
Cbrad24:fix/restore-reasoning-data-from-conversation-history

Conversation

@Cbrad24

@Cbrad24 Cbrad24 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Originally introduced in PR #203.

This fixes #271, by ensuring that reasoning_id and reasoning_summary are replayed from database conversations to OpenAI reasoning models.

@mohali-id

Copy link
Copy Markdown
Contributor

Its works very well for me

@joelclermont

Copy link
Copy Markdown

I can also confirm that this fixes the issue. We have run into this issue with reasoning models and this solves it.

Any timeline on when it could be merged?

@mohali-id

Copy link
Copy Markdown
Contributor

I can also confirm that this fixes the issue. We have run into this issue with reasoning models and this solves it.

Any timeline on when it could be merged?

It still error if function call more then one in one message. Fixed in PR 461

@nikitaku11

Copy link
Copy Markdown

This doesn’t fix the issue, because all tool calls are still merged into a single message, while every provider requires two messages per tool call: #402

@mohali-id

Copy link
Copy Markdown
Contributor

This doesn’t fix the issue, because all tool calls are still merged into a single message, while every provider requires two messages per tool call: #402

This PR #461 actually fix the issue

@Cbrad24

Cbrad24 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

This doesn’t fix the issue, because all tool calls are still merged into a single message, while every provider requires two messages per tool call: #402

Yes this PR is a month old now, and since then this package has pulled in its own gateway functionality into the package natively, but at the time I also lodged prism-php/prism#971 upstream to fix the other issue in the Prism gateway.

Been running both fixes using cweagans/composer-patches without issue since then, but the other PR might be the go now.

@pushpak1300 pushpak1300 merged commit 64291ae into laravel:0.x Apr 30, 2026
5 checks passed
pushpak1300 added a commit to nikitaa01/laravel-ai that referenced this pull request May 4, 2026
Issue laravel#361 (rehydrating reasoningId/reasoningSummary on ToolCall) is already
resolved on 0.x via laravel#301. The remaining real bug this branch addresses is
multi-turn message ordering loss in DatabaseConversationStore. Drop the
unrelated OpenAI/xAI streaming changes so this PR stays focused.
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.

OpenAI 400 error when continuing conversation with reasoning model (gpt-5-mini)

5 participants