fix(opencode): support encrypted_content and previous_response_id for OpenAI flows#23496
fix(opencode): support encrypted_content and previous_response_id for OpenAI flows#23496Maaannnn wants to merge 3 commits into
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: I found some related PRs that address similar OpenAI functionality:
These PRs appear to cover overlapping functionality with the current PR #23496 regarding |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #20847
Type of change
What does this PR do?
This PR fixes two OpenAI replay gaps in
packages/opencode.openai.responseIdonstep-finishparts and reuses it asprevious_response_idon later matching turns.encrypted_contentfrom raw chunks, stores it on reasoning metadata, and folds it back into replayed assistant messages.It also adds regression tests for the two riskiest mock-only cases: automatic
previous_response_idreuse in the prompt loop, and repeated raw chunks keeping the latestencrypted_contentvalue.How did you verify your code works?
bun test --timeout 30000 test/provider/transform.test.ts test/session/message-v2.test.ts test/session/processor-effect.test.ts test/session/llm.test.tsbun test --timeout 30000 test/session/prompt-effect.test.ts -t "loop automatically reuses previous_response_id for matching OpenAI responses turns"bun typecheckKey coverage added in this PR:
test/session/processor-effect.test.tsVerifies multiple raw chunks keep the latest
encrypted_contenton reasoning metadata.test/session/prompt-effect.test.tsVerifies the next matching OpenAI Responses turn automatically sends
previous_response_id.Screenshots / recordings
Not applicable.
Checklist