You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Think regeneration includes the previous response in the model prompt #2028
regenerate() creates a new response in the UI, but @cloudflare/think still sends the previous assistant response to the model.
Think then adds this message:
Continue your previous response from exactly where it left off. Do not repeat any of it.
As a result, regeneration behaves like “continue” instead of generating a fresh alternative.
Keeping the old response as a stored branch is correct. Including it in the new model request is not.
To Reproduce
Send a user message and wait for the assistant response.
Call regenerate().
Inspect the messages sent to the model.
The request contains the previous assistant response followed by the continuation instruction above.
This was also reproduced in the upstream Think test suite using a model test double.
Expected behavior
Regeneration should create a sibling response using conversation history only up to the user message being answered.
The previous assistant response should remain available as a stored branch, but it should not be included in the new model request.
Screenshots
Not applicable. The issue is visible in the model request.
Version:
@cloudflare/think@0.15.0
agents@0.19.0
AI SDK v7
Also reproduced against cloudflare/agents main at commit 2b2b5980e1945cf55f5a11626bc395e7c460516f, where Think is 0.15.1.
Additional context
The existing regeneration tests verify that sibling branches are stored correctly, but they do not inspect the messages sent to the model.
This is different from #1351, which tracks displaying and navigating stored branches in the UI.
It is related to #1012, where the older @cloudflare/ai-chat implementation also left the previous assistant response in server-side context during regeneration.
basically what happens is that a user tries to regen a response, the ai thinks that whatever it did in the old response already happened, the user can see it, etc. not sure this is intentional but in my usecase (and how other ai apps handle) a clean slate regen makes more sense
Activity
urjitc commentedon Aug 3, 2026
basically what happens is that a user tries to regen a response, the ai thinks that whatever it did in the old response already happened, the user can see it, etc. not sure this is intentional but in my usecase (and how other ai apps handle) a clean slate regen makes more sense
urjitc commentedon Aug 5, 2026
@ben-reitz perfect exactly what i was looking for thanks
fix(ai): regenerate from the last user message, not as a continue
feat(ai-chat): close the error and abort edge-case gaps (#791)
fix(think): cut regeneration history before repair and compact the re…
fix(think): regenerate answers the parent user message instead of con…