opencode
opencode copied to clipboard
fix: track reasoning by output_index for copilot compatibility
Problem
Copilot changes the item_id on every event, meaning reasoning delta get dropped because they don't match the stored ID.
Fix
Reuse the existing currentTextId pattern that is already used for text streaming
Testing
Verified with:
"provider": {
"github-copilot": {
"models": {
"gpt-5.2-codex": {
"variants": {
"reasoning-test": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
}
}
}
}
}
Throws an error pre-fix.
"reasoning part <long base64 string>:0 not found"
Post-fix shows reasoning blocks in the UI.
Screenshot
Only works for Codex models via the /responses endpoint.