opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: track reasoning by output_index for copilot compatibility

Open NateSmyth opened this issue 20 hours ago • 5 comments

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 copilot_reasoning

Only works for Codex models via the /responses endpoint.

NateSmyth avatar Jan 17 '26 20:01 NateSmyth