Skip to content

max_tokens not being set for Opus 4.7 and Opus 4.8 models when using Azure Foundry with Github Copilot #449

@ot513

Description

@ot513

When adding models deployed to Azure Foundry to be used as the model for Github Copilot coding, I get this error when using Opus 4.7 or 4.8 models:

2026-06-09 14:25:29.414 [error] Unable to call the (redacted)claude-opus-4-8 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":"req_011Cbsm6PDRYKidbivY8T2vP"}

Github Copilot for Azure extension:
Identifier
ms-azuretools.vscode-azure-github-copilot
Version
1.0.209

Foundry Toolkit for VS Code extension:
Identifier
ms-windows-ai-studio.windows-ai-studio
Version
1.4.2

VS Code:
Version: 1.123.0 (user setup)
Commit: 6a44c352bd24569c417e530095901b649960f9f8
Date: 2026-06-03T11:29:03+02:00
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Windows_NT x64 10.0.26200

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs attentionThe issue needs contributor's attention

    Type

    No type
    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