microsoft / microsoft/foundry-dev-tools

"Reached max token limit" keeps appearing even though I'm using BYOK via Azure Foundry

Open
#568 4 comments 0 reactions 1 assignee View on GitHub

@a1exwang is already working on this.

Since Jul 28, 2026.

needs attention
Dominant language
JavaScript
Stars
2.1k
Forks
260
Avg merge
42m
Merged PRs (30d)
29

Description

Foundry Toolkit for VS Code keeps popping up with a message saying "You have reached max token limit. Increase the limit or start a new chat" whilst processing a rqeuest. Whilst it's popping up, it does look as though its able to retry and proceed but this pop-up seems to be slowing it down/disrupting the flow. I can see in the Azure output terminal that its reconnecting to the Azure subscription each time it bumps into this error.

Unclear what this is referring to or how I change the limit if I'm using Azure Foundry and Foundry Toolkit extension. There shouldn't be a max token limit if you're BYOK? I don't believe I'm maxxing out on the Azure Foundry limits as they're set to 10,000 per minute and 10,000,000 tokens per minute.

I have set the BYOK utility model to an Azure Foundry model as well.

VS Code:
Version: 1.129.1 (user setup)
Commit: 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8
Date: 2026-07-17T15:35:09Z
Electron: 42.6.0
ElectronBuildId: 14623276
Chromium: 148.0.7778.280
Node.js: 24.18.0
V8: 14.8.178.38-electron.0
OS: Windows_NT x64 10.0.26200

Foundry Toolkit version:
Identifier: ms-windows-ai-studio.windows-ai-studio
Version: 1.6.5

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.