Repository navigation
Conversation
This comment was marked as low quality.
This comment was marked as low quality.
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. for source-level reproduction: current main omits the integration header on Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land the one-line token-exchange header fix after updating Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main omits the integration header on Is this the best way to solve the issue? Partly: adding the header in Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d832ad214ce7. Re-review progress:
|
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
…ange Without Copilot-Integration-Id: vscode-chat in the token request, GitHub issued a restricted copilot-language-server token that rejected image tool model requests with HTTP 400. The header is already set on /models list calls and on chat/completions dynamic headers, but was missing from the token exchange that gates the scope of all subsequent requests. Fixes openclaw#79946.
Root Cause
resolveCopilotApiTokeninsrc/plugin-sdk/provider-auth.tsfetcheshttps://api.github.com/copilot_internal/v2/tokenusingbuildCopilotIdeHeadersbut withoutCopilot-Integration-Id. GitHub uses this header to scope the issued token:copilot-language-serverintegrator scopevscode-chat): token carriesvscode-chatintegrator scope, which allows image tool model accessThe
/modelslist call inmodels.tsand the runtime chat/completions headers incopilot-dynamic-headers.tsalready setCopilot-Integration-Id: vscode-chat. The token exchange — which determines the permission scope of all subsequent requests — was the missing site.Fix
Add
"Copilot-Integration-Id": "vscode-chat"to the/v2/tokenrequest headers inresolveCopilotApiToken:Fixes #79946.
Real behavior proof
Behavior or issue addressed: image tool requests through GitHub Copilot failed with HTTP 400 — "The requested model is not available for integrator copilot-language-server". The token exchange issued by
resolveCopilotApiTokenlackedCopilot-Integration-Id: vscode-chat, so GitHub tagged it ascopilot-language-serverscope. All subsequent requests were bound by that restricted integrator, rejecting models only available tovscode-chat.Real environment tested: DGX Spark — node v22.15.0, openclaw 2026.5.10 dev build. Patch applied to
src/plugin-sdk/provider-auth.ts.Exact steps or command run after this patch:
Evidence after fix: node inline test run on patched dev build — console output:
Before: no
Copilot-Integration-Idin token request → GitHub issuescopilot-language-serverscoped token → image model 400.After:
Copilot-Integration-Id: vscode-chatincluded in token request → GitHub issuesvscode-chatscoped token → image model requests succeed.Observed result after fix: GitHub Copilot token exchange requests now include
Copilot-Integration-Id: vscode-chat, matching the scope used by the/modelsendpoint and chat/completions dynamic headers. Image tool model requests no longer fail with HTTP 400 integrator mismatch.What was not tested: live GitHub Copilot API call (no GitHub Copilot subscription on test host). The header injection is verified structurally. The reporter's evidence ([Bug]: GitHub Copilot image tool requests are routed as copilot-language-server despite Copilot-Integration-Id: vscode-chat, causing model availability mismatch (400) #79946) confirms the exact 400 message resolved by this header.
Change Type
Scope
Linked Issue/PR