Repository navigation
fix(github-copilot): listed Chat Completions-only and new Claude models fail their first turn - #167941
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Maintainer decision: accept the heuristic. A Copilot Claude row that lists xhigh effort is treated as adaptive thinking with xhigh/max per its listed efforts, so new Claude models on Copilot work on their first turn; rows without that signal keep the ID rules. |
|
Codex review: needs maintainer review before merge. What this changesThe GitHub Copilot plugin uses account-listed endpoints and Claude thinking capabilities so newly listed models can complete their first turn. Example: A user asks github-copilot/kimi-k3 to reply OK.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR retains useful work that current main does not provide. The reported live results support the repair, and no actionable correctness or security finding remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe GitHub Copilot provider plugin converts an authenticated account's model listing into models available to OpenClaw. Its endpoint and thinking metadata determine how the shared inference transports construct requests. flowchart TD
A[Authenticated Copilot account] --> B[Account model listing]
B --> C[Copilot catalog projection]
C --> D[Choose listed endpoint]
C --> E[Resolve thinking capabilities]
D --> F[Shared inference transport]
E --> F
F --> G[Copilot model response]
Technical reviewBest possible solution: Keep endpoint and effort projection in the Copilot plugin and reuse the shared Claude request contract. Do we have a high-confidence way to reproduce the issue? Yes, the source establishes the path: current main sends a Chat Completions-only kimi-k3 listing through Responses and lacks adaptive capability metadata for unknown Claude IDs. The contributor also reports matching live baseline failures; this review did not run a current-main reproduction. Is this the best way to solve the issue? Yes, this repairs the provider's catalog projection directly and feeds its existing transports and shared Claude predicates. It preserves older-listing fallback behavior without adding another catalog or configuration path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 97ead0272fa6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +35, Tests +80, Docs +5. Total +120 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 9, 2026, 3:57 PM ET / 19:57 UTC. |
|
Landed in d6158cc. Copilot now uses the API each listed model supports (kimi-k3 works) and sends adaptive thinking to listed Claude models OpenClaw doesn't know yet (simulated new Claude model works at every level). Proof: real Copilot Individual account, 29/29 picker models match the account's picker list, real turns per model, new-model simulation. |
…ls fail their first turn (openclaw#167941) ## What Problem This Solves Fixes: GitHub Copilot models fail on their first turn when the account lists a chat model that only serves Chat Completions (`kimi-k3` today), or a Claude model OpenClaw does not recognize yet (a newly launched Claude). ## User Impact User impact: every chat model a Copilot account shows in the picker now answers its first turn, including Claude models released after the installed OpenClaw version. No config, schema, or protocol changes. Merge danger: low. Shipped models keep their current transport and thinking shape (the transport only changes when the account's listing says the default endpoint is unsupported; Claude capabilities are only derived for rows that list `xhigh`, which every currently listed adaptive Claude model already matches by ID). Older listings without `supported_endpoints` keep the ID rules. ## Why This Change Was Made Copilot's `/models` already says how each model can be called: - `supported_endpoints` names the endpoints a model accepts. OpenClaw picked the transport from the model ID only, so a non-Claude, non-Gemini ID always went to `/responses`. `kimi-k3` lists only `/chat/completions` and was rejected (`unsupported_api_for_model`). The Copilot plugin now keeps the family transport when it is listed and otherwise uses a listed endpoint, with the existing Copilot Chat Completions request options. - Copilot lists effort levels instead of Anthropic's capability tree, so Claude request shaping fell back to ID rules. An unknown Claude ID got manual `thinking.type: enabled` budgets, which current Claude models reject (`Use thinking.type.adaptive and output_config.effort`). Claude rows that list `xhigh` (only adaptive-thinking Claude models offer it) now carry the existing `params.claudeCapabilities` contract (openclaw#167658), so they get adaptive thinking and the listed xhigh/max levels before OpenClaw learns their ID. The `fetchCopilotUsage` tests moved from `models.test.ts` to `usage.test.ts` (their owner) to keep `models.test.ts` under the line cap; no test was removed. ## Evidence Real GitHub Copilot (Individual) account, device-flow sign-in on isolated profiles and loopback Gateways. - Sign-in with the Gateway running: Copilot picker 0 → 29 rows, no restart. Account `/models` returned 54 rows; the picker equals the listed `type: chat` + `model_picker_enabled: true` rows exactly (context/prompt limits and vision match). Hidden: 3 embeddings, 7 internal Fireworks rows (copilot-search/exec-agent/trajectory-compaction), `gpt-5.6-luna-utility`, `gpt-5.4-nano`, and legacy GPT-3.5/4/4o/4.1 rows, all `model_picker_enabled: false`. - One `reply OK` turn per picker model on `origin/main` (2fd61a9): 27/29 ok. `kimi-k3` failed with HTTP 400 `unsupported_api_for_model` on `openai-responses`. `claude-haiku-4.5` at `--thinking low` was refused locally (the listing gives it no efforts); it passes at default/off. - With this branch: `kimi-k3` 200 on `openai-completions` (low and medium). Regression set across transports and vendors: `gpt-5-mini`, `grok-4.7`, `mai-code-1.1-flash` (Responses), `gemini-3.8-flash` (Chat Completions), `claude-haiku-5.5` (Messages): all 200. - New-model simulation (throwaway worktree, never pushed): removed `gpt-5.6-terra` and `claude-haiku-5.5` from the bundled manifests, ID rules/aliases, the recommended list, and a local copy of catalog.openclaw.ai served through `models.catalogRefresh.url`. Both still appeared after sign-in (29 rows). On main, `gpt-5.6-terra` worked (default/low) but `claude-haiku-5.5` failed with HTTP 400 (`thinking.type.enabled is not supported`). With this branch applied, both returned 200 at default, low, max, and off. - `node scripts/run-vitest.mjs extensions/github-copilot`: 17 files, 214 tests pass. The new Claude test fails without the fix (manual budget payload) and passes with it. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: GitHub Copilot models fail on their first turn when the account lists a chat model that only serves Chat Completions (
kimi-k3today), or a Claude model OpenClaw does not recognize yet (a newly launched Claude).User Impact
User impact: every chat model a Copilot account shows in the picker now answers its first turn, including Claude models released after the installed OpenClaw version. No config, schema, or protocol changes.
Merge danger: low. Shipped models keep their current transport and thinking shape (the transport only changes when the account's listing says the default endpoint is unsupported; Claude capabilities are only derived for rows that list
xhigh, which every currently listed adaptive Claude model already matches by ID). Older listings withoutsupported_endpointskeep the ID rules.Why This Change Was Made
Copilot's
/modelsalready says how each model can be called:supported_endpointsnames the endpoints a model accepts. OpenClaw picked the transport from the model ID only, so a non-Claude, non-Gemini ID always went to/responses.kimi-k3lists only/chat/completionsand was rejected (unsupported_api_for_model). The Copilot plugin now keeps the family transport when it is listed and otherwise uses a listed endpoint, with the existing Copilot Chat Completions request options.thinking.type: enabledbudgets, which current Claude models reject (Use thinking.type.adaptive and output_config.effort). Claude rows that listxhigh(only adaptive-thinking Claude models offer it) now carry the existingparams.claudeCapabilitiescontract (fix(anthropic): newly listed Claude models stay hidden until an OpenClaw release #167658), so they get adaptive thinking and the listed xhigh/max levels before OpenClaw learns their ID.The
fetchCopilotUsagetests moved frommodels.test.tstousage.test.ts(their owner) to keepmodels.test.tsunder the line cap; no test was removed.Evidence
Real GitHub Copilot (Individual) account, device-flow sign-in on isolated profiles and loopback Gateways.
/modelsreturned 54 rows; the picker equals the listedtype: chat+model_picker_enabled: truerows exactly (context/prompt limits and vision match). Hidden: 3 embeddings, 7 internal Fireworks rows (copilot-search/exec-agent/trajectory-compaction),gpt-5.6-luna-utility,gpt-5.4-nano, and legacy GPT-3.5/4/4o/4.1 rows, allmodel_picker_enabled: false.reply OKturn per picker model onorigin/main(164210c): 27/29 ok.kimi-k3failed with HTTP 400unsupported_api_for_modelonopenai-responses.claude-haiku-4.5at--thinking lowwas refused locally (the listing gives it no efforts); it passes at default/off.kimi-k3200 onopenai-completions(low and medium). Regression set across transports and vendors:gpt-5-mini,grok-4.7,mai-code-1.1-flash(Responses),gemini-3.8-flash(Chat Completions),claude-haiku-5.5(Messages): all 200.gpt-5.6-terraandclaude-haiku-5.5from the bundled manifests, ID rules/aliases, the recommended list, and a local copy of catalog.openclaw.ai served throughmodels.catalogRefresh.url. Both still appeared after sign-in (29 rows). On main,gpt-5.6-terraworked (default/low) butclaude-haiku-5.5failed with HTTP 400 (thinking.type.enabled is not supported). With this branch applied, both returned 200 at default, low, max, and off.node scripts/run-vitest.mjs extensions/github-copilot: 17 files, 214 tests pass. The new Claude test fails without the fix (manual budget payload) and passes with it.