Repository navigation
fix(github-copilot): preserve thinking levels for Claude models - #99798
Darren2030 wants to merge 4 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 23, 2026, 6:18 AM ET / 10:18 UTC. ClawSweeper reviewWhat this changesThe PR adds a provider-policy flag intended to keep GitHub Copilot Claude models’ existing Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep open: the fix remains necessary, but it still derives Claude eligibility from a static model-ID heuristic instead of the catalog-selected API route now carried by current main. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherCopilot model discovery converts the account’s flowchart LR
A[Copilot model catalog] --> B[Route and reasoning metadata]
B --> C[Provider thinking policy]
C --> D[Shared thinking resolver]
D --> E[Accepted /thinking levels]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +22, Tests +68. Total +90 across 4 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, use the selected catalog API route in both provider-policy surfaces, and prove the route-based positive and negative cases before obtaining a redacted live Copilot round trip. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: a live Anthropic-vendor catalog row can select Is this the best way to solve the issue? No. The current main resolver already carries the catalog-selected API route into provider policy, so both changed surfaces should use that prepared route rather than reclassifying the model name. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7700a3b3e331. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Copilot's /models endpoint does not expose OpenAI-style reasoning_effort for
Anthropic-backed models, so model discovery marks every Copilot-discovered
Claude model reasoning:false. The shared thinking resolver then discarded this
provider's declared level set and fell back to off-only, so /thinking
high|low|medium was rejected ("not supported ... use one of: off") for Claude
models that do support reasoning.
Set preserveWhenCatalogReasoningFalse for Claude models (detected via the
existing anthropic-messages transport signal), mirroring anthropic, bedrock,
google, and moonshot. This preserves the levels the hook already declares
(off/minimal/low/medium/high) and invents no new ones; non-Claude Copilot
models without reasoning_effort stay off-only.
Closes openclaw#99240
Co-Authored-By: Claude Fable 5 <[email protected]>
feefe37 to
0419704
Compare
…y surface The active provider hook (index.ts) and the bundled provider-policy surface (provider-policy-api.ts) are parallel code paths that must agree. The prior commit set preserveWhenCatalogReasoningFalse on the active hook only; the bundled surface (used by /think, ACP controls, and directive parsing when no active plugin supplies the hook) still collapsed to off-only for Claude models under catalog reasoning:false. Mirror the same Claude-scoped flag here so both surfaces preserve the declared levels. Per review on openclaw#99240 (sync both thinking surfaces). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Addressed the review feedback:
Live end-to-end Copilot proof (a real @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Added standalone harness proof (outside the test runner) to the PR body: a
This covers the complete in-repo code path (catalog → resolver → offered levels). /cc @vincentkoc — ClawSweeper's remaining blocker is a live Copilot |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
What Problem This Solves
Fixes an issue where
/thinking high|low|mediumwas rejected with "not supported for github-copilot/claude-sonnet-4.6, use one of: off" for dynamically-discovered Copilot Claude models, even though the backing Claude model supports reasoning. Onlyoffwas advertised.Why This Change Was Made
Copilot's
/modelsendpoint does not expose OpenAI-stylereasoning_effortfor Anthropic-backed models, so model discovery marks every Copilot-discovered Claude modelreasoning: false. The shared thinking resolver (src/auto-reply/thinking.ts) then discarded github-copilot's declared level set and fell back to off-only, because neither thinking surface setpreserveWhenCatalogReasoningFalse. This PR sets that flag for Claude models (detected via the existinganthropic-messagestransport signal) on BOTH github-copilot thinking surfaces, mirroringanthropic,amazon-bedrock,google, andmoonshot:resolveThinkingProfileinindex.ts), andprovider-policy-api.ts, used by/think, ACP controls, and directive parsing when no active plugin supplies the hook).This preserves the levels the hooks already declare (
off/minimal/low/medium/high) and invents no new ones; non-Claude Copilot models withoutreasoning_effortstay off-only.Per review on #99240: both thinking surfaces must agree before merge.
User Impact
Users running Copilot-routed Claude models (e.g.
claude-sonnet-4.6,claude-opus-4.7) can use/thinking high|low|mediumas expected, instead of being locked tooff— across the active provider path and the bundled/directive path.Evidence
extensions/github-copilot/index.test.ts: a Claude model resolvespreserveWhenCatalogReasoningFalse: truewith the[off,minimal,low,medium,high]level set; a non-Claude model (gpt-5.4-mini) leaves the flag unset.extensions/github-copilot/provider-policy-api.test.ts: the same assertions for the bundled policy surface (Claude → flag set; non-Claude → unset) — 11/11 pass.node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-providers.config.ts extensions/github-copilot: thinking tests pass. The full github-copilot suite only has pre-existing WindowsEBUSYSQLite-teardown flakes in token-onboarding tests, unrelated to this change.Live end-to-end Copilot proof (a real
/thinking highround-trip) still requires a maintainer with Copilot credentials; the code fix is complete on both surfaces and covered by the unit tests above.Standalone harness proof (outside the test runner)
ClawSweeper flagged unit-test-only evidence. The transcript below is produced by a standalone harness (
npx tsx, no vitest, no mocks, noexpect) that drives the real shared thinking resolver (src/auto-reply/thinking.ts— the exact user-facing path that decides which/thinkinglevels a model offers) plus the real Copilot provider-policy (provider-policy-api.ts, the code this PR changes). It feeds the catalog shape live discovery produces for Copilot Anthropic-backed models (reasoning: false).Layer 2 is the merge-relevant result: it shows the full resolver path. Under
catalog reasoning: false,github-copilot/claude-sonnet-4.6now offers[off,minimal,low,medium,high](so/thinking highis accepted — fixing #99240), while the non-Claudegpt-5.4-ministill collapses to[off].The non-Claude
gpt-5.4-minirow is the control for the pre-fix behavior: any Copilot model withoutpreserveWhenCatalogReasoningFalsecollapses to off-only underreasoning: false— exactly what happened to Claude on main. The PR's only effect is opting Claude into the existing preserve path; it adds no new levels.This exercises the complete in-repo code path (catalog → shared resolver → offered levels). The remaining unprovable step is the Copilot API accepting the
/thinking highrequest at the wire level, which needs Copilot credentials the contributor does not have.Harness source — reproducible; save as
proof-copilot-thinking.tsat the repo root and runnpx tsx proof-copilot-thinking.tsCloses #99240