Skip to content

Copilot GPT-6 loses prompt cache when reasoning effort changes mid-session #59868

Open

Description

@fayomitz

OpenCode 2.2.0 sends the new effort as a top-level Responses parameter when switching variants on github-copilot/gpt-6-luna. That changes the cached prefix instead of inserting a configuration_update.

The model resolves through aisdk:@ai-sdk/github-copilot. In an isolated server, connecting directly to Copilot without Headroom:

Turn Effort Input tokens Cache read Output tokens
1 high 8,092 0 5
2 high 26 8,089 5
3 low 8,138 0 5

The captured turn-3 request has top-level reasoning.effort: "low" and no configuration_update. Setting compatibility.supportsEffortUpdates: true does not fix the bridge path.

A direct Copilot /responses test outside OpenCode used configuration_update, retained 7,673 cached tokens and reduced reasoning without errors. Copilot Claude Opus 5.5 and Haiku 5.5 also retain cache across effort switches.

Expected: retain the original top-level effort and express subsequent switches as configuration_update items, preserving the prompt cache.

Native Responses already implements this in #48513 and #51339, but Copilot GPT takes the AI SDK bridge. #51850 fixed the earlier missing-effort issue; #53362 routes Copilot Claude through native Messages. The Copilot Responses bridge could carry the same effort markers and lower them into configuration updates, with appropriate model and compatibility gating.

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up and measurements!

    To restate the request: when you switch reasoning effort mid-session on Copilot GPT models (e.g. github-copilot/gpt-6-luna), OpenCode should keep the original top-level reasoning.effort and send later switches as configuration_update items, so the prompt cache survives. This already happens on the native Responses route.

    You're right about the cause. Copilot GPT models go through the AI SDK bridge (@ai-sdk/github-copilot). The effort-update handling and the compatibility.supportsEffortUpdates override only exist in the native Responses protocol, so setting that flag has no effect on this route. This works as currently built rather than as a regression, so I've filed it as a feature request: extend effort updates to the Copilot Responses bridge, or route Copilot GPT through native Responses as #53362 did for Copilot Claude. Maintainers will consider it.

    Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions