anthropics / anthropics/claude-code

[BUG] Claude Desktop gateway health check probes paid Haiku instead of configured free model

未关闭
#89,794 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:providers bug platform:windows
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

I use OpenRouter as a third-party inference gateway in Claude Desktop/Claude
Code with the free model `stealth/ox-alpha`.

The gateway connection and API key are valid. However, Claude Desktop's gateway
health check ignores the configured model and sends its test request using
`anthropic/claude-3-haiku`.

Because my OpenRouter account uses only free models and has never purchased
credits, OpenRouter correctly rejects the paid Haiku request with HTTP 402.
Claude Desktop consequently considers the gateway configuration unhealthy,
even though the configured free model does not require credits.

The third-party inference configuration provides no way to choose or override
the model used by this health check.

### What Should Happen?

Claude Desktop should test the model selected in the third-party inference
configuration. In this case, the health check should use
`stealth/ox-alpha`, not `anthropic/claude-3-haiku`.

Alternatively, Desktop should validate connectivity and credentials through a
model-independent endpoint such as `/v1/models`, or provide a configurable
health-check model.

A paid-model billing failure should not prevent use of a different configured
model that is available without paid credits.

### Error Messages/Logs

```shell
Your connection works, but the provider rejected a test request. Often a
model-access or quota issue.

message: Gateway returned HTTP 402
httpStatus: 402
requestUrl: https://openrouter.ai/api/v1/messages
probedModel: anthropic/claude-3-haiku
responseBody: {
"type": "error",
"error": {
"type": "billing_error",
"message": "Insufficient credits. This account never purchased credits. Make sure your key is on the correct account or org, and if so, purchase more at https://openrouter.ai/settings/credits",
"error_type": "payment_required"
},
"request_id": "gen-1787743412-gz2m9RgZKhcyz0LZGrPa",
"metadata": {
"limit_source": "openrouter_credits",
"remedy_hint": "Add credits at https://openrouter.ai/settings/credits, or lower max_tokens / prompt size to fit your remaining balance."
}
}
endpoint: https://openrouter.ai/
checkedAt: 2026-08-26T11:23:29.872Z
```

### Steps to Reproduce

1. Use the latest Claude Desktop version on Windows.
2. Enable Developer Mode through Help → Troubleshooting.
3. Open Developer → Configure Third-Party Inference.
4. Select a Gateway connection.
5. Configure:
- Endpoint: https://openrouter.ai/
- A valid OpenRouter API key from an account that uses free models and has
never purchased credits
- Intended model: stealth/ox-alpha
6. Apply or test the configuration.
7. Observe that the connection and credentials are accepted initially.
8. Observe that the health check sends a request to:
https://openrouter.ai/api/v1/messages
9. Observe that the diagnostic identifies the test model as:
probedModel: anthropic/claude-3-haiku
10. OpenRouter returns HTTP 402 because Haiku is paid.
11. Claude Desktop marks the gateway unhealthy even though the configured
`stealth/ox-alpha` model is free.

### Claude Model

Other

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

Claude 1.37937.1 (edbd3c) 2026-08-25T22:55:59.000Z

### Platform

Other

### Operating System

Windows

### Terminal/Shell

Other

### Additional Information

This is not an invalid-credential error. Claude Desktop explicitly reports that
the connection works. The failure occurs because its health check selects a
different model from the configured inference model.

No OpenRouter API key is included in this report. The OpenRouter request ID is
included so the provider-side request can be correlated if necessary.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reproducing the gateway configuration on Windows with OpenRouter and the free model `stealth/ox-alpha`, then trace the health-check request that reports `probedModel: anthropic/claude-3-haiku`. Determine where the configured model is ignored and verify that the completed change tests the configured model or uses a model-independent validation path without incorrectly marking the gateway unhealthy.

由索引模型根据 Issue 内容生成。

评估

领域
api
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。