microsoft / microsoft/foundry-dev-tools
Anthropic model selected via Foundry AI Toolkit in Copilot fails with 400 (max_tokens: Field required)
@a1exwang is already working on this.
Since Jun 23, 2026.
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 260
- Avg merge
- 42m
- Merged PRs (30d)
- 29
Description
I’m seeing a reproducible failure when using a Foundry-deployed Anthropic model through VS Code Copilot model selection. (Works with non-Anthropic model in same setup).
Environment
- VS Code: macOS
- Extension: ms-windows-ai-studio.windows-ai-studio (Foundry AI Toolkit) v: 1.4.3
- Copilot Chat enabled
Steps to Reproduce
- Install Foundry AI Toolkit in VS Code.
- Sign in and connect to a Foundry project.
- Open Copilot model manager and select a deployed Anthropic model from the connected Foundry project.
- Send a normal chat prompt. (I sent 'test').
Actual Result
Copilot request fails with a 400 error from the inference path.
Error shown:
2026-06-16 14:53:11.923 [error] Unable to call the (<PROJECT>)claude-opus-4-7 inference endpoint due to 400. Please check if the input or configuration is correct. 400 {"type":"error","error":{"type":"invalid_request_error","message":"max_tokens: Field required"},"request_id":"<REQUEST_ID>"}
- invalid_request_error
- max_tokens: Field required
(Observed in extension stack trace under ms-windows-ai-studio.windows-ai-studio.)
Expected Result
Request should succeed, or the extension should correctly map/send required Anthropic fields (including max_tokens) when invoking chat.
Notes
- Authentication and project connection are valid.
- The issue appears specific to Anthropic invocation through this extension flow.
- Works with OpenAI Models in same setup
- Works with other providers and models provided by CoPilot. Issues only stems from accessing models through foundry extension.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.