Skip to content

fix(opencode): summarize adaptive thinking display for all modern claude models via copilot - #46576

Closed
afriemann wants to merge 3 commits into
anomalyco:devfrom
afriemann:copilot-thinking-display
Closed

fix(opencode): summarize adaptive thinking display for all modern claude models via copilot#46576
afriemann wants to merge 3 commits into
anomalyco:devfrom
afriemann:copilot-thinking-display

Conversation

@afriemann

@afriemann afriemann commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #46593 (also related to #36120, which reports the same symptom for opus-4.8 specifically)

Type of change

  • Bug fix

What does this PR do?

github-copilot/models.ts only forced thinking.display: "summarized" for models matching the literal string "opus-4.7" when building the adaptive-thinking variant for Copilot's /v1/messages endpoint. Anthropic omits thinking content by default for any adaptive-only Claude model newer than that (major version >4, or 4.7+), so claude-sonnet-5, claude-opus-4.8, etc. silently return no thinking text even with reasoning enabled and billed.

This reuses the existing anthropicUsesModernAdaptiveThinking() classifier (already used correctly elsewhere in provider/transform.ts for other providers) instead of the hardcoded string check, so it covers any current or future model in that range, not just opus-4.7.

How did you verify your code works?

  • Added a test in test/plugin/github-copilot-models.test.ts with a claude-sonnet-5 fixture: fails against the old code (display undefined), passes with the fix.
  • Full affected suite (github-copilot-models.test.ts + transform.test.ts): 433/433 pass. tsgo --noEmit and oxlint clean on changed files.
  • Live-tested with opencode run --model github-copilot/claude-sonnet-5 --variant high --thinking --format json, same prompt against pre-fix and post-fix source: pre-fix emits a reasoning part with text: ""; post-fix emits real reasoning content.
  • Confirmed interactively in the TUI (bun dev) that thinking is now visible when chatting with claude-sonnet-5.

Screenshots / recordings

N/A — provider/data layer change, not UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…ude models via copilot

github-copilot/models.ts only forced thinking.display: "summarized" for
opus-4.7 specifically. Anthropic omits thinking content by default for any
adaptive-only model newer than that (major >4, or 4.7+), so claude-sonnet-5,
claude-opus-4.8, etc. silently return no thinking text even with reasoning
enabled. Reuse the existing anthropicUsesModernAdaptiveThinking() classifier
from provider/transform.ts instead of the hardcoded opus-4.7 string check.

Related: anomalyco#36120
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@afriemann
afriemann marked this pull request as ready for review September 1, 2026 13:20
@rekram1-node

Copy link
Copy Markdown
Collaborator

Thanks — moved this to #48269 and #48271 for v2, and added you as co-author.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Copilot: Claude models newer than opus-4.7 never show thinking (adaptive display omitted)

2 participants