microsoft / microsoft/foundry-dev-tools
Foundry Toolkit: GPT-6 Astra tool calls fail in VS Code Chat because Chat Completions is used with reasoning
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 260
- Avg merge
- 42m
- Merged PRs (30d)
- 29
Description
Product
Foundry Toolkit for VS Code
Environment
- Foundry Toolkit:
1.6.13 - OS: Windows
- Host: VS Code Chat in Agent mode
- Model: Microsoft Foundry deployment of
gpt-6-astra
Problem
The model works in the Foundry Toolkit chat/playground, but fails when selected as the model in VS Code Chat Agent mode. Requests without function tools are not the problematic case; the failure occurs when VS Code Chat supplies function tools.
Error
Unable to call the gpt-6-astra inference endpoint due to 400.
Function tools with reasoning_effort are not supported for gpt-6-astra in /v1/chat/completions.
To use function tools, use /v1/responses or set reasoning_effort to 'none'.
Project/resource identifiers and client request IDs have been omitted.
Steps to reproduce
- Connect a Microsoft Foundry project containing a
gpt-6-astradeployment in Foundry Toolkit 1.6.13. - Select that deployment as the model in VS Code Chat.
- Use Agent mode so VS Code sends function tools.
- Submit a request that allows tool use.
Actual behavior
Foundry Toolkit routes the request to /v1/chat/completions. Because Astra has reasoning enabled by default, the service rejects the combination of function tools and reasoning with HTTP 400.
Expected behavior
Tool-calling requests for Astra should use /v1/responses, preserving reasoning and tool-calling support. As a compatibility fallback, Chat Completions could explicitly set reasoning_effort: "none", but Responses API is the preferred path.
Investigation
The installed extension already contains:
- Responses API request/stream adapters;
- API capability checks;
- an in-memory API preference cache keyed by endpoint host and deployment;
- fallback from Chat Completions to Responses API when an error is recognized as
OperationNotSupported.
However, this newer HTTP 400 message is not recognized by the existing fallback condition, so no retry occurs.
Verified workaround
A local test expanded the existing unsupported-operation detection to also recognize:
Function tools with reasoning_effort are not supported
The existing caller then cached responses for the deployment and retried through the Responses API. The modified bundle passed JavaScript syntax validation and produced no VS Code diagnostics.
Recommended fix
Prefer proactive routing rather than relying only on error text:
- When the model advertises Responses API support and a request includes function tools plus non-
none/default reasoning, route directly to Responses API. - Also recognize this 400 as a fallback signal and retry through Responses API for forward compatibility.
- Add coverage for both streaming and non-streaming VS Code Language Model API requests.
Relevant Microsoft guidance: https://learn.microsoft.com/azure/foundry/openai/how-to/reasoning#tool-calling-with-reasoning-models
That guidance recommends Responses API when reasoning is combined with function/custom tools.
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.
Research direction
Start by tracing the existing unsupported-operation detection and fallback caller alongside the Responses API request/stream adapters and capability checks. Reproduce a tool-calling request in VS Code Chat Agent mode, then add coverage for streaming and non-streaming requests; done means Astra routes to Responses API or recognizes the 400 fallback while preserving reasoning and tool calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, javascript, vscode
- Domain
- api, testing, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100