Repository navigation
fix(copilot): keep tool-free Claude requests on Auto - #9998
Merged
Merged
Conversation
allenxu09
marked this pull request as ready for review
November 26, 2026 01:47
funkpopo
reviewed
Nov 26, 2026
funkpopo
left a comment
Collaborator
There was a problem hiding this comment.
感谢跟进修复和真机验证!把 is_warmup_request 收紧到 Claude Code 的单 token 探针形态(max_tokens == 1 + "." 或带 ephemeral 的 "Hi"),并在空 messages 时直接返回 is_warmup: false,避免了常规无工具请求带 anthropic-beta 时被误降级;即使后续上游探针形态变化也能安全退化回正常路径。forwarder/tests.rs 同步覆盖了探针与无工具常规请求两种场景,三平台后端 CI 也已通过。
顺带记一个非阻塞的边界点(属于 #9564 既有策略,不需在本 PR 处理):在仅支持 Auto、直接调用 gpt-5-mini 会返回 400 的账号上(见 #8197),如果客户端在 copilot-fusion-auto 下发出真实单 token 探针,forwarder.rs 仍会跳过 /auto 走 warmup_model。后续如果收到 Free / 学生账号在真实探针上 400 的反馈,再单独开 follow-up 评估即可。
没有阻塞项,LGTM。
funkpopo
previously approved these changes
Nov 26, 2026
Collaborator
Author
|
cc @SaladDay |
allenxu09
force-pushed
the
codex/copilot-auto-warmup
branch
from
November 29, 2026 13:16
fdc5a63 to
ecb9b17
Compare
Owner
|
感谢 @allenxu09 的修复和 Copilot Pro 真机验证!把预热判定收紧到 Claude Code 的单 token 探针以后,不带工具的普通请求就不会再被悄悄换成 gpt-5-mini 了;你也及时 rebase 解掉了和 #10080 的测试冲突。我已在最新 main 上本机跑过 fmt / clippy / 全量测试,全部通过,这就合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Note / 本人说明
修复 Copilot 供应商在 Claude Code 下无工具时报错的问题,在本机用 Copilot Pro + Claude Code 实测后无误。
Summary / 概述
Claude Code sends
anthropic-betaon regular requests even when started with--tools ''. CC Switch classified those requests as warmup, skipped Copilot Auto, and sent them togpt-5-mini. A real Copilot account returned HTTP 400 for that request.Require the one-token request shape used by Claude Code's startup and model-validation probes before applying the warmup downgrade. The forwarding regression test covers both a probe and a regular request with an empty tool list.
Related Issue / 关联 Issue
Follow-up to #9564. Related to #8197.
Verification / 验证
cargo fmt --all --checkpassed.CCS_AUTO_OKfromclaude --bare --print --model copilot-fusion-auto --tools '' --no-session-persistence 'Reply with exactly CCS_AUTO_OK.'. The proxy log showed Auto selectedmai-code-2-flashand used/responses.