Skip to content

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

Description

@davidenzler

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions