makecindy / makecindy/cindy

自定义供应商「测试连接」必现误报超时:curl/Node/浏览器均可正常连通该供应商

Open
#3,577 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: 匿名
**客户端版本**: 0.1.66

---

## 现象

「设置 → 模型供应商 → 编辑自定义供应商」中配置一个 OpenAI/Anthropic 兼容的中转站供应商(Runtime 选 Claude Code,鉴权方式为 API 密钥,基础 URL 格式 `https:///v1`),点击「测试连接」始终报红字「连接超时,请检查网络与基础 URL」。

## 复现步骤

1. 打开 设置 → 模型供应商,编辑一个自定义供应商;
2. Runtime 选择 Claude Code,填入基础 URL 与 API 密钥并保存;
3. 点击「测试连接」;
4. 必现红字「连接超时,请检查网络与基础 URL」。

## 期望行为

网络与供应商均正常时,测试连接应成功。

## 实际行为

测试连接始终超时。但同一台机器、同一时间点,用多种网络栈实测该供应商全部秒级成功:

- curl 直连 `GET {baseURL}/models`:401(未带 Key,正常响应)
- curl 带 `Authorization: Bearer` 请求 `/models`:200,返回完整模型清单
- curl 带 `x-api-key`(可加 anthropic-version 头)请求 `/models`:200
- curl 以 Anthropic 协议 `POST {baseURL}/messages`:200,模型正常回复
- Node https 模块请求:正常响应
- Chromium 浏览器直接访问:200
- DNS 解析正常(仅 IPv4 记录),直连无需代理;日志中 outbound-proxy 解析为 `proxy: direct`

供应商模型清单中 Claude 系模型标注 `supported_endpoint_types: ["anthropic", "openai"]`,协议兼容性确认无问题。

## 复现频率

必现。完全退出 Cindy(托盘退出)并重启后依旧。

## 已尝试

- 核对基础 URL 拼写、协议(https)、结尾 /v1,确认无空格/隐形字符
- 重新粘贴 API 密钥
- 完全退出并重启 Cindy
- 用 curl / Node / Chromium 分别验证网络连通性(均正常)

## 诊断结论

所有外部网络栈均能秒连该供应商,唯独 Cindy 的「测试连接」报超时,问题应在测试连接功能自身实现(如请求未正确发出、超时判定过严或主进程网络栈状态异常)。另外事发当天主日志有一条 `[lifecycle] beginShutdown reason=uncaughtException` 记录,重启后问题仍复现,未必相关,仅供参考。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.22631)
**Harness**: Claude Code
**Model ID**: ` k3 `
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by locating the custom-provider “Test connection” implementation and tracing the request and timeout handling for Claude Code providers. Compare its behavior with the reported successful requests to `/models` and `/messages`; the issue does not name source files or tests. Done means a healthy compatible provider passes the test-connection check instead of showing a timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.