Skip to content

fix(github-copilot): enable /thinking levels for Claude models via Copilot catch-all path - #100756

Closed
yplongapp wants to merge 2 commits into
openclaw:mainfrom
yplongapp:fix/github-copilot-reasoning-levels
Closed

yplongapp wants to merge 2 commits into
openclaw:mainfrom
yplongapp:fix/github-copilot-reasoning-levels

Conversation

@yplongapp

Copy link
Copy Markdown

What Problem This Solves

/thinking high (and all levels except off) is rejected for github-copilot provider models like claude-sonnet-4.6:

Thinking level "high" is not supported for github-copilot/claude-sonnet-4.6. Use one of: off.

Why This Change Was Made

Two issues:

  1. Catch-all model reasoning flag too narrow: In models.ts, the catch-all path only marked o1/o3 and Codex models as reasoning-capable. Claude models served via Copilot's anthropic-messages transport also support reasoning but got reasoning=false.

  2. Thinking profile resolver missed SDK-registered plugins: provider-thinking.ts only checked the legacy PLUGIN_REGISTRY_STATE and bundled policy surface. Providers like github-copilot that register thinking hooks through the SDK runtime plugin path (via api.registerProvider) were never reached.

Changes

  • extensions/github-copilot/models.ts: Add anthropic-messages transport check to catch-all reasoning detection (+4/-1)
  • src/plugins/provider-thinking.ts: Add fallback to resolveProviderRuntimePlugin for SDK-registered providers (+11/-1)

Real behavior proof

Behavior addressed: /thinking high now works for Claude models via github-copilot provider.
Environment tested: Node 22.x on Linux
Steps run after the patch: Verified compilation with node --import tsx
Evidence after fix:

$ node --import tsx --no-warnings -e "import('./src/plugins/provider-thinking.ts')"
OK

Observed result: Module imports cleanly with no circular dependency issues. The fix enables reasoning detection for Claude models via Copilot and ensures the provider's thinking profile is reachable.
Not tested: Live /thinking high in a running session with github-copilot provider.

Fixes #99240

@vincentkoc vincentkoc self-assigned this Jul 6, 2026
@vincentkoc
vincentkoc requested a review from a team as a code owner July 6, 2026 09:20
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: telegram Channel integration: telegram app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: anthropic extensions: openai extensions: qa-lab extensions: memory-wiki extensions: codex extensions: google extensions: openrouter labels Jul 6, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 011f00790c3ccf659260a50bad3aa0f96f2b26e5

@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: anthropic extensions: openai extensions: qa-lab extensions: memory-wiki extensions: codex extensions: google extensions: openrouter size: XL labels Jul 6, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 5:37 AM ET / 09:37 UTC.

Summary
The branch marks unknown GitHub Copilot Claude/anthropic-messages fallback models as reasoning-capable and adds focused GitHub Copilot model resolver tests.

PR surface: Source +4, Tests +2. Total +6 across 3 files.

Reproducibility: yes. at source level: current main can map a live Copilot Claude catalog row without reasoning_effort to reasoning: false, and the shared thinking resolver then returns off-only. I did not establish a fresh live Copilot account reproduction.

Review metrics: 1 noteworthy metric.

  • Copilot model-resolution paths: 1 synthetic path changed; 0 live-catalog or preserve-policy paths changed. The linked bug can flow through both synthetic fallback metadata and live /models metadata, so maintainers should notice the uncovered sibling path before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99240
Summary: This PR is a candidate fix for the open GitHub Copilot Claude thinking-level issue, but another open PR overlaps with a broader provider-policy approach and neither PR has live Copilot proof yet.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal output, logs, or a recording showing /thinking high succeeds on a real GitHub Copilot Claude model, or get an explicit maintainer proof override.
  • Cover the live Copilot /models Claude path as well as the synthetic catch-all path, ideally with shared resolver-level regression coverage.
  • Coordinate with fix(github-copilot): preserve thinking levels for Claude models #99798 so only one provider-policy direction remains active.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body shows only a module-import terminal check and explicitly says the live GitHub Copilot /thinking high flow was not tested, so real behavior proof is still needed with private details redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Live-discovered Copilot Claude rows can still carry reasoning: false, so the reported /thinking high rejection may remain for users whose model comes from the live catalog rather than the synthetic catch-all.
  • [P1] The branch broadens the synthetic catch-all to treat every anthropic-messages Copilot model ID as reasoning-capable without redacted live Copilot proof that the provider accepts those levels for the target model.
  • [P1] There are two open overlapping candidate PRs for the same issue, and the broader candidate also lacks live proof, so maintainers need to converge on one source of truth before merge.

Maintainer options:

  1. Cover both Copilot model sources before merge (recommended)
    Update the provider thinking surfaces or model metadata so synthetic fallback rows and live /models Claude rows both keep the intended thinking levels, then add focused regression coverage.
  2. Require live Copilot proof
    Ask for redacted terminal output, logs, or a recording showing /thinking high succeeds on a real GitHub Copilot Claude model before accepting the provider-boundary change.
  3. Accept synthetic-only scope knowingly
    A maintainer could merge this as a narrow catch-all fix while keeping the live-catalog bug tracked by [Bug]: /thinking levels not available for github-copilot provider models (e.g. claude-sonnet-4.6) #99240 or another candidate PR.

Next step before merge

  • [P1] Human review is needed because the branch has an incomplete provider-path fix and lacks real Copilot behavior proof; automation should not replace the contributor's live setup evidence.

Security
Cleared: The final diff changes TypeScript provider metadata logic and tests only; I found no concrete security or supply-chain concern.

Review findings

  • [P1] Cover live Copilot Claude catalog rows — extensions/github-copilot/models.ts:100
Review details

Best possible solution:

Use one provider-owned GitHub Copilot thinking policy that covers both synthetic fallback and live-catalog Claude rows, with regression coverage and redacted real /thinking high proof or an explicit maintainer proof override before merge.

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

Yes at source level: current main can map a live Copilot Claude catalog row without reasoning_effort to reasoning: false, and the shared thinking resolver then returns off-only. I did not establish a fresh live Copilot account reproduction.

Is this the best way to solve the issue?

No. The patch handles only the synthetic catch-all path; the more maintainable fix is provider-owned handling that also preserves Copilot Claude levels for live-catalog rows with focused regression coverage.

Full review comments:

  • [P1] Cover live Copilot Claude catalog rows — extensions/github-copilot/models.ts:100
    This only flips reasoning for the synthetic catch-all model. If Copilot /models returns a Claude row without reasoning_effort, mapCopilotApiModelToDefinition still stores reasoning: false, and resolveThinkingProfile still collapses the provider profile to off-only unless the Copilot thinking surface opts into preserving it. That leaves the live-discovered path for the linked /thinking high rejection broken; move the fix to the provider thinking surfaces or cover both metadata sources.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5000f324cbbe.

Label changes

Label changes:

  • add P2: This is a bounded GitHub Copilot provider/model behavior bug where the model remains usable with thinking off but requested thinking levels can be rejected.
  • add merge-risk: 🚨 auth-provider: The PR changes GitHub Copilot model capability metadata, which controls accepted thinking levels for routed Copilot Claude model choices.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows only a module-import terminal check and explicitly says the live GitHub Copilot /thinking high flow was not tested, so real behavior proof is still needed with private details redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded GitHub Copilot provider/model behavior bug where the model remains usable with thinking off but requested thinking levels can be rejected.
  • merge-risk: 🚨 auth-provider: The PR changes GitHub Copilot model capability metadata, which controls accepted thinking levels for routed Copilot Claude model choices.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows only a module-import terminal check and explicitly says the live GitHub Copilot /thinking high flow was not tested, so real behavior proof is still needed with private details redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +4, Tests +2. Total +6 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 2 +4
Tests 2 11 9 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 17 11 +6

What I checked:

Likely related people:

What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 6, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer closeout: closing rather than merging.

Focused proof on exact head 011f00790c3ccf659260a50bad3aa0f96f2b26e5 established both sides of the behavior:

  • A live GitHub Copilot CLI request using claude-sonnet-4.6 with --reasoning-effort high succeeded, so the provider/model supports the requested level.
  • The repaired synthetic catch-all resolves Sonnet 4.6 to reasoning: true and levels off, minimal, low, medium, high; focused tests passed 39/39 and exact-head CI passed all 54 jobs.
  • However, the reported issue uses a dynamically discovered model. The live /models mapper still records reasoning: false when Copilot omits capabilities.supports.reasoning_effort, and the shared resolver then collapses that row to off-only. This PR only changes the synthetic fallback, so it does not reliably fix the reported path.

The provider-owned fix in #99798 covers both active and bundled thinking-policy surfaces, is Claude-scoped, and preserves off-only behavior for non-Claude models. Closing this PR in favor of that canonical contributor path rather than duplicating the implementation here.

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

Labels

extensions: github-copilot merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /thinking levels not available for github-copilot provider models (e.g. claude-sonnet-4.6)

2 participants