Skip to content

fix(github-copilot): allow xhigh and max thinking levels on claude-opus-5 - #129690

Merged
steipete merged 2 commits into
openclaw:mainfrom
mitchdevenport:fix/copilot-opus5-reasoning-efforts
Aug 26, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
mitchdevenport:fix/copilot-opus5-reasoning-efforts

Conversation

@mitchdevenport

@mitchdevenport mitchdevenport commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users on the GitHub Copilot provider running claude-opus-5 could not select thinking levels above high. /think max and /think xhigh were both rejected, and the model picker offered only default, off, minimal, low, medium, high — even with agents.defaults.thinkingDefault: "max" set in config.

The Copilot API advertises low, medium, high, xhigh, max for this model, so the two highest reasoning tiers were simply unreachable through OpenClaw.

There is no user-side workaround. A models.providers config overlay does not help: resolveCopilotForwardCompatModel() returns early when the model is already present in the bundled registry (extensions/github-copilot/models.ts:43-46), and that function is the only path that applies a user-supplied thinkingLevelMap. Setting the overlay, restarting, and re-testing produced no change.

Why This Change Was Made

The bundled manifest entry for claude-opus-5 declared "compat": { "codeMode": "capable" } with no supportedReasoningEfforts. resolveCopilotThinkingLevelMap() (extensions/github-copilot/models.ts:245-258) returns undefined unless that field is an array, so no thinkingLevelMap was ever attached and clampThinkingLevel() filtered both xhigh and max out of the supported set.

The native Claude fallback does not cover this either. resolveClaudeNativeThinkingLevelMap() would grant {xhigh, max} for Opus 5, but model-utils.ts:41-45 only consults it for api === "anthropic-messages" routes, and Copilot resolves through its OpenAI-compatible transport.

This declares the effort list on the manifest entry, matching how extensions/opencode/openclaw.plugin.json already declares the same field for the same model id. extensions/anthropic/openclaw.plugin.json ships an equivalent thinkingLevelMap for it as well.

Scope is deliberately limited to claude-opus-5, the model verified end to end on a live account. claude-fable-5 and claude-sonnet-5 appear to have the same gap and are left for a follow-up so each can be tested rather than pattern-matched.

User Impact

Copilot users can select xhigh and max thinking levels on claude-opus-5, and an existing thinkingDefault of max now resolves instead of being silently clamped to high.

Higher reasoning tiers consume more reasoning tokens per turn, which maps to premium-request consumption on Copilot token auth. This is opt-in: the default is unchanged, and users reach the new tiers only by explicitly selecting them or configuring a higher thinkingDefault.

Evidence

Verified on a live GitHub Copilot account (token auth) against a local gateway.

Before — /status reported think high despite thinkingDefault: "max", and /think max was rejected:

Thinking level "max" is not supported by github-copilot/claude-opus-5.
Valid: default, off, minimal, low, medium, high

Note that xhigh is absent from that list too, confirming the resolver attached no map at all rather than mapping one tier and not the other.

After — with this change applied and the gateway restarted, /think max is accepted and /status reports:

🎛️ Modes: think max · fast off · elevated

Tests — pnpm vitest run extensions/github-copilot/models.test.ts: 9 files, 166 tests passed.

The existing suite already covers this resolver's behavior, including models.test.ts:117 asserting thinkingLevelMap becomes { xhigh: "xhigh", max: null } when supportedReasoningEfforts includes xhigh but not max.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added extensions: github-copilot size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 26, 2026
@mitchdevenport mitchdevenport changed the title fix(***): declare reasoning efforts for claude-opus-5 fix(github-copilot): allow xhigh and max thinking levels on claude-opus-5 Aug 26, 2026
…us-5

Copilot users could not select thinking levels above `high` on
`claude-opus-5`. Both `/think xhigh` and `/think max` were rejected and the
picker offered only up to `high`, even with `thinkingDefault: "max"` set.

The bundled manifest entry declared no `supportedReasoningEfforts`, so
`resolveCopilotThinkingLevelMap()` in extensions/github-copilot/models.ts
returned undefined and `clampThinkingLevel()` filtered both tiers out.

A user-side `models.providers` overlay cannot fix this: models.ts
short-circuits `resolveCopilotForwardCompatModel()` when the model is
already in the bundled registry, so the only path that applies a
`thinkingLevelMap` is never reached. The native Claude fallback does not
apply either, since model-utils.ts only consults it for
`api === "anthropic-messages"` routes and Copilot resolves through its
OpenAI-compatible transport.

Declares the effort list the same way extensions/opencode already does for
the same model id. Verified on a live account: after this change `xhigh`
and `max` are selectable and accepted at runtime.
@mitchdevenport
mitchdevenport force-pushed the fix/copilot-opus5-reasoning-efforts branch from ee82dbd to 27b1cb9 Compare August 26, 2026 00:11
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 3:13 PM ET / 19:13 UTC.

ClawSweeper review

What this changes

This PR declares xhigh and max as supported GitHub Copilot thinking levels for bundled Claude Opus 5 and tests that the registered provider exposes them.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. Current main still omits the Opus 5 effort list, while the current head adds it and directly covers the manifest-to-provider-profile path requested in the prior review. Likely related people: @steipete (medium confidence; added the exact-head regression).

Priority: P2
Reviewed head: d4ff071c9e3f7eb7cdd4ee3aa8842929c9125585

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused provider-owned repair has live after-fix output and now covers the manifest-backed behavior that the prior review identified.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body contains after-fix live gateway output showing /think max accepted and /status reporting max; the focused regression also covers both newly exposed tiers.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body contains after-fix live gateway output showing /think max accepted and /status reporting max; the focused regression also covers both newly exposed tiers.
Evidence reviewed 6 items Current-main gap: Current main’s Claude Opus 5 manifest row has only codeMode; it does not declare supported reasoning efforts.
Owner decision path: The Copilot policy adds xhigh and max only when compatibility metadata advertises the relevant effort, and the registered provider returns those levels to callers.
Manifest reaches runtime: Manifest catalog normalization copies a model’s compat object into the runtime model definition, so the added data reaches the provider policy rather than remaining inert metadata.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/github-copilot/index.test.ts

Result: FAIL (failed) — step 1 run pnpm test extensions/github-copilot/index.test.ts: previous terminal command was still running after 30 seconds: "pnpm test extensions/github-copilot/index.test.ts"

$ node --import tsx scripts/test-projects.mts extensions/github-copilot/index.test.ts
[test] starting test/vitest/vitest.extension-providers.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129690-OwRV52/target

Assertions:

  • FAIL expect_output: exposes xhigh and max thinking for the bundled Claude Opus 5 model

How this fits together

The GitHub Copilot plugin converts bundled model-manifest metadata into the runtime model catalog. The provider’s thinking-policy hook then uses that catalog compatibility metadata to decide which /think levels and configured defaults are accepted.

flowchart LR
A[Copilot plugin manifest] --> B[Model catalog normalization]
B --> C[Registered Copilot provider]
C --> D[Thinking policy]
D --> E[Think command and default]
E --> F[Selected reasoning tier]
Loading

Before merge

  • Resolve merge risk (P1) - Existing Copilot users who already configured thinkingDefault: "max" for Claude Opus 5 will begin using that tier after upgrade, with the associated premium-request consumption; this is the intentional behavior described and live-checked in the PR.
Agent review details

Security

None.

PR surface

Source +4, Tests +20. Total +24 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 1 20 0 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 25 1 +24

Review metrics

Metric Value Why it matters
Production versus test LOC production +4 net (5 added, 1 removed); tests +20 The small production increase is the model capability declaration; the added test protects the manifest-to-provider behavior that previously lacked coverage.
Bundled model capability 1 model changed; 2 reasoning tiers enabled The manifest change affects only GitHub Copilot Claude Opus 5 and adds xhigh plus max without changing the default tier.

Merge-risk options

Maintainer options:

  1. Accept the intended configured-default change (recommended)
    Merge the narrow Opus 5 capability update, acknowledging that an existing explicit thinkingDefault: "max" will now resolve to max rather than clamp to high.

Technical review

Best possible solution:

Keep the narrow provider-owned manifest declaration and its manifest-backed regression, then merge after exact-head CI completes successfully.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main lacks the Opus 5 effort list, and the Copilot policy therefore cannot add xhigh or max; the PR also supplies a live before/after gateway transcript.

Is this the best way to solve the issue?

Yes. The owning Copilot plugin manifest is the canonical producer of this model capability, and the new test exercises that manifest through the registered provider instead of adding a fallback or user configuration path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3826b52c51ee.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains after-fix live gateway output showing /think max accepted and /status reporting max; the focused regression also covers both newly exposed tiers.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a bounded GitHub Copilot model-capability defect without an availability, data-loss, or security impact.
  • merge-risk: 🚨 compatibility: The bundled capability metadata changes the effective tier for existing users who explicitly configured Claude Opus 5 to use max.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains after-fix live gateway output showing /think max accepted and /status reporting max; the focused regression also covers both newly exposed tiers.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains after-fix live gateway output showing /think max accepted and /status reporting max; the focused regression also covers both newly exposed tiers.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the exact-head commit that added the manifest-backed regression after the earlier review requested it. (role: recent area contributor; confidence: medium; commits: d4ff071c9e3f; files: extensions/github-copilot/index.test.ts, extensions/github-copilot/openclaw.plugin.json)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-26T00:18:30.133Z sha 27b1cb9 :: needs changes before merge. :: [P2] Add a manifest-backed Opus 5 reasoning regression
  • reviewed 2026-08-26T00:59:53.592Z sha 27b1cb9 :: needs changes before merge. :: [P2] Cover the manifest-backed Opus 5 profile

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@steipete

Copy link
Copy Markdown
Contributor

Verified the public github-copilot/claude-opus-5 path with the provider-owned manifest change and the new actual-manifest regression. Current Claude requests use anthropic-messages: the Copilot plugin's resolveThinkingProfile reads the effort list through resolveCopilotExtendedThinkingLevels. The missing manifest metadata was what kept xhigh and max out of that profile. This corrects the older transport explanation in the PR body.

Independent authenticated proof used trusted main with the same reviewed capability declaration, without executing fork code locally:

pnpm --silent openclaw agent exec 'Do not use any tools. Reply with exactly COPILOT_OPUS_MAX_INDEPENDENT_OK.' --auth-env-only --cwd /tmp --model github-copilot/claude-opus-5 --thinking max --timeout 120 --json

The real provider returned /models HTTP 200, /v1/messages HTTP 200 with an SSE response, the exact expected reply, and JSON identifying provider github-copilot and model claude-opus-5. No response was mocked. Request bodies and credentials were not captured; this trace proves the real explicit-max execution, while the owner test/source establish effort serialization. This is not full release validation or a Gateway UI screenshot.

Hosted CI passed on d4ff071c9e3f7eb7cdd4ee3aa8842929c9125585: run 33003284643, attempt 2. The first attempt's extension lint process received SIGTERM 143 and GitHub reported cancellation without any lint finding. The failed-jobs retry passed lint and the aggregate CI gate without changing source.

Fresh source-only Codex autoreview at P2 returned no accepted/actionable findings (patch correct, confidence 0.90); independent review also found no code issue. The prior manifest-backed test request is addressed by the 20-line regression, which reads the actual bundled model rather than constructing effort metadata in a fixture.

Maintainer acceptance: a pre-existing explicit thinkingDefault: "max" now means max instead of being clamped to high. That can increase usage and is the requested repair; this change does not raise the default tier. The production delta is +5/-1 (the capability declaration), with +20 test lines exercising the actual bundled manifest through the registered provider. No fallback or new runtime special case was added.

Thanks @mitchdevenport for the original fix. The nearby duplicate Opus 5 predicate in src/plugins/provider-claude-thinking.ts is a separate cleanup follow-up, not a reason to expand this focused contributor PR. Public catalog propagation will be checked after merge.

@steipete
steipete merged commit a27f7fe into openclaw:main Aug 26, 2026
165 of 167 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…us-5 (openclaw#129690)

* fix(github-copilot): allow xhigh and max thinking levels on claude-opus-5

Copilot users could not select thinking levels above `high` on
`claude-opus-5`. Both `/think xhigh` and `/think max` were rejected and the
picker offered only up to `high`, even with `thinkingDefault: "max"` set.

The bundled manifest entry declared no `supportedReasoningEfforts`, so
`resolveCopilotThinkingLevelMap()` in extensions/github-copilot/models.ts
returned undefined and `clampThinkingLevel()` filtered both tiers out.

A user-side `models.providers` overlay cannot fix this: models.ts
short-circuits `resolveCopilotForwardCompatModel()` when the model is
already in the bundled registry, so the only path that applies a
`thinkingLevelMap` is never reached. The native Claude fallback does not
apply either, since model-utils.ts only consults it for
`api === "anthropic-messages"` routes and Copilot resolves through its
OpenAI-compatible transport.

Declares the effort list the same way extensions/opencode already does for
the same model id. Verified on a live account: after this change `xhigh`
and `max` are selectable and accepted at runtime.

* test(github-copilot): cover Opus 5 manifest reasoning levels

---------

Co-authored-by: mitch <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: github-copilot merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants