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
The Responses API returns a response ID that can be used on the next provider turn as previous_response_id. OpenCode was capturing that metadata but always serializing the full conversation again.
This change carries the response ID through the prompt loop and provider request options. Once a Responses API response ID is available, only the newest message is sent on the next continuation turn. The chain is reset after compaction and whenever processing does not continue. Other providers keep their existing behavior.
How did you verify your code works?
Ran bun test test/provider/transform.test.ts in packages/opencode: 348 tests passed.
Ran bun x tsgo --noEmit in packages/opencode: passed.
The repository pre-push typecheck is currently blocked by an unrelated existing packages/ui error involving missing exports from motion.
Screenshots / recordings
Not applicable, this is a backend/session runtime change.
I hope that isResponsesApiModel() doesn't prevent previousResponseId from being set when using GPT 5.6 via a personal LiteLLM or similar proxy, or for other models that benefit from previous_response_id, such as Grok 4.5 and Muse Spark 1.1
I hope that isResponsesApiModel() doesn't prevent previousResponseId from being set when using GPT 5.6 via a personal LiteLLM or similar proxy, or for other models that benefit from previous_response_id, such as Grok 4.5 and Muse Spark 1.1
yes... LiteLLM works when configured with @ai-sdk/openai, but the default @ai-sdk/openai-compatible path is not currently chained. There is also an xAI allowlist mismatch: it receives previousResponseId without switching to delta-only messages. I’ll align these checks and add coverage before merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Issue for this PR
Closes #34133
Type of change
What does this PR do?
The Responses API returns a response ID that can be used on the next provider turn as
previous_response_id. OpenCode was capturing that metadata but always serializing the full conversation again.This change carries the response ID through the prompt loop and provider request options. Once a Responses API response ID is available, only the newest message is sent on the next continuation turn. The chain is reset after compaction and whenever processing does not continue. Other providers keep their existing behavior.
How did you verify your code works?
bun test test/provider/transform.test.tsinpackages/opencode: 348 tests passed.bun x tsgo --noEmitinpackages/opencode: passed.packages/uierror involving missing exports frommotion.Screenshots / recordings
Not applicable, this is a backend/session runtime change.
Checklist