microsoft / microsoft/foundry-dev-tools

Anthropic model selected via Foundry AI Toolkit in Copilot fails with 400 (max_tokens: Field required)

Open
#465 2 comments 0 reactions 1 assignee View on GitHub

@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

  1. Install Foundry AI Toolkit in VS Code.
  2. Sign in and connect to a Foundry project.
  3. Open Copilot model manager and select a deployed Anthropic model from the connected Foundry project.
  4. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.