Foundry Toolkit: GPT-6 luna tool calls fail in VS Code Chat because Chat Completions is used with reasoning

Đang mở
#924 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, javascript, vscode
Lĩnh vực
api, tooling

Hướng nghiên cứu

The extension contains Responses API adapters, API capability checks, an in-memory preference cache, and a fallback from Chat Completions to Responses on OperationNotSupported. Locate the fallback handler that inspects 400 errors and the routing decision point for function tools. Done means Luna requests with tools route to /v1/responses (or reasoning_effort none) and the new 400 triggers retry, covered for streaming and non-streaming.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs attention

Product

Foundry Toolkit for VS Code

Environment

Foundry Toolkit: 1.6.18
OS: Windows
Host: VS Code Chat in Agent mode
Model: Microsoft Foundry deployment of gpt-6-luna

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-luna inference endpoint due to 400.
Function tools with reasoning_effort are not supported for gpt-6-luna 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-luna deployment in Foundry Toolkit 1.6.18.
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 Luna has reasoning enabled by default, the service rejects the combination of function tools and reasoning with HTTP 400.
Expected behavior

Tool-calling requests for Luna 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.

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.

Ngôn ngữ chính
JavaScript
Star
2.1k
Fork
262
Merge trung bình
51 phút
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/foundry-dev-tools

Tất cả issue của microsoft/foundry-dev-tools

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.