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 intoanomalyco:devfrom
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. 👍 |
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