Claude Code 第三方 API 环境下 WebFetch 失效的完整解决方案
问题描述
在使用 Claude Code 的过程中,如果你通过第三方 API(如阿里云 DashScope、DeepSeek、智谱 GLM 等国内大模型平台)接入而非 Anthropic 官方 API,你很可能会遇到以下两种 WebFetch 故障之一:
故障一:安全预检失败
Fetch(https://huggingface.co/microsoft/VibeVoice-Realtime-0.5B)
Error: Unable to verify if domain xxx is safe to fetch.
This may be due to network restrictions or enterprise security policies blocking claude.ai.
故障二:抓取成功但不返回结果
Fetch(https://example.com/article)
Received 53.3KB (200 OK)
Bash(curl -s "https://example.com/article" -H "User-Agent: ...")
...(Claude Code 默默回退到 curl 获取原始 HTML)
Claude Code 会自行降级到 curl + grep 的方式提取网页文本,虽然勉强能用,但丧失了对网页内容的结构化理解和摘要能力。
- 阅读剩余部分 -