用扩展把DeepSeek V4接入VS Code Copilot,结果费用暴涨?

新人一个,四月底才开始折腾AI写代码。选来选去用了DeepSeek V4,照着官方文档,装了个叫Vizards.deepseek-v4-for-copilot的扩展,成功在VS Code的GitHub Copilot里用上了DeepSeek V4 Pro,还开了思考模式。

我让它帮我改一个Node.js写的小画廊网站(这网站之前是各种在线AI拼凑出来的,就一个.js文件,HTML、CSS、JS全堆一块儿)。

结果没几个小时就出大事了。查了资料才搞懂,用Pro模型在长对话之后,输入(没命中缓存)会暴增,就算你后面问的问题贼简单:

当时一看控制台直接人麻了,“刚充的50块这么快就没了?”。问了群友,有人提到是缓存命中率异常。我马上跑去翻这个扩展的GitHub仓库,果然看到了这个Issue:

github.com/Vizards/deepseek-v4-for-copilot

Long-context prompt cache diagnostics and high miss-token cases 长对话 Prompt Cache 命中率异常日志收集

已打开 05:45AM - 03 May 26 UTC

Vizards

tracking

[!NOTE]
**2026-05-08 Update**: Root cause analysis published.
Read the f…ull write-up, solution brainstorming, join the discussion in **#56**.

This issue (#25) remains open for **reporting new cache miss patterns** and **sharing diagnostic logs**.

Background / 背景

Some users have reported unusually high cost in long Copilot Chat Agent conversations with DeepSeek V4 Pro. The common symptom is that prompt\_cache\_miss\_tokens grows unexpectedly, even when the follow-up prompt is very simple.
一些用户反馈在 Copilot Chat Agent 长会话中,即使后续只是问很简单的问题,DeepSeek V4 的 prompt\_cache\_miss\_tokens 也会异常增长,导致费用明显上升。

Symptoms / 典型现象

Please comment here if you observe one or more of the following:
如果你遇到以下任意一种情况,欢迎在本 issue 下补充日志:

  • A long Copilot Chat conversation becomes much more expensive over time.
    Copilot Chat 长会话随着轮次增加,费用明显变高。
  • A simple follow-up prompt still costs noticeably more than expected.
    只是问一个简单的后续问题,也比预期贵很多。
  • DeepSeek dashboard shows rapidly increasing prompt\_cache\_miss\_tokens.
    DeepSeek 控制台显示 prompt\_cache\_miss\_tokens 快速增长。
  • Creating a new Copilot Chat conversation significantly reduces cost.
    新建 Copilot Chat 对话后,费用明显下降。
  • Only a few prompts in an otherwise normal session become unusually expensive.
    整体会话大部分轮次正常,但其中少数几轮 prompt 费用异常高。

How to collect logs / 如何收集日志

Starting from v0.4.0, the normal extension build includes cache diagnostics. No special VSIX needed.
v0.4.0 开始,正式版插件已内置缓存诊断,不需要安装特殊版本。

  1. Install or update to the latest public version (v0.4.0 or newer). 安装或更新到最新正式版。
  2. Enable debug logging in VS Code settings: 在设置中开启 Debug:
{ "deepseek-copilot.debug": true }
  1. Reload Window or restart VS Code. Reload Window 或重启 VS Code。
  2. Reproduce the issue in the original long conversation if possible. 尽量在原本出现费用异常的长会话里复现。

Recommended reproduction steps / 推荐复现方式

Ask 1-3 lightweight follow-up questions in the original conversation. For example:
在原本的会话中问 1-3 个轻量问题,例如:

Please briefly summarize the latest conclusion based on the current conversation context. Do not read files and do not modify files.

中文:

请基于当前对话上下文,简单总结你刚才的结论。不要读取文件,不要修改文件。

To reduce noise, please try to keep these unchanged during the test:
为了减少干扰,请尽量保持:

  • Do not switch model / 不切换模型
  • Do not switch Thinking Effort / 不切换 Thinking Effort
  • Do not switch between Chat, Ask, and Agent modes / 不切换 Chat、Ask、Agent 模式
  • Do not attach new images or files / 不附加新图片或新文件
  • Do not ask the Agent to scan the whole project / 不让 Agent 扫描整个项目
  • Do not ask the Agent to modify files / 不让 Agent 修改文件

Uploading logs / 上传日志

Run DeepSeek: Show Logs from the Command Palette, then save and upload the full log as a file (preferred over pasting long text).
运行 Command Palette 中的 DeepSeek: Show Logs,将完整日志保存为文件上传。
If possible, please also mention: 如果方便,也请说明:

  • Model & mode used / 使用的模型和模式(Agent / Ask / Chat)
  • Whether the conversation included images or file attachments / 是否包含图片或文件附件
  • Whether VS Code was restarted or reloaded before the expensive turn / 费用异常前是否重启或 Reload

Privacy / 隐私说明

The diagnostic logs only include counts, lengths, hashes, model identifiers, cache statistics, and structural markers. Please still review the logs before posting and remove anything you consider sensitive.
诊断日志只包含计数、长度、hash、模型标识、缓存统计和结构化 marker。提交前仍建议自行检查,并删除任何你认为敏感的内容。

原来我不是一个人。

而且这扩展前几天还因为未知原因从商店下架了,现在还没回来。

我比较喜欢图形界面操作,所以挺爱用GitHub Copilot这种深度集成在VS Code里的方式,它能自动调用各种工具,默认就用Playwright MCP来测网页啥的。

所以想问问大伙儿:有没有其他类似的扩展,可以自己配置GitHub Copilot的API地址、API Key、模型列表这些?

相关链接:

api-docs.deepseek.com

接入 GitHub Copilot | DeepSeek API Docs

DeepSeek V4 for Copilot Chat 是一个 VS Code 插件,将 DeepSeek V4 Pro 和 Flash 直接添加到 GitHub Copilot 的模型选择器中。你仍可使用 Copilot 的 Agent 模式、工具调用、Skills 和 MCP — 全部由 DeepSeek 驱动。

github.com

GitHub - Vizards/deepseek-v4-for-copilot: Pick DeepSeek V4 from the Copilot Chat model…

Pick DeepSeek V4 from the Copilot Chat model picker — and keep everything else Copilot already gives you.

mark,先插个眼,等有空再研究

没用过别碰,这玩意儿就是坑。

啊?小白问一下,是不是所有用这种第三方扩展接模型的都有类似风险?我看官方Copilot用着还行,就是贵点。

别只mark啊,赶紧动手试一下不然过两天就过气了

我前段时间也遇到了!不过我用的不是DeepSeek,是接Claude的那个扩展。也是在改一个老项目,JS文件特别长,估计有上千行吧。跟它聊了十来轮,让它帮我重构和加注释,结果账单出来吓一跳,比平时多了好几倍。后来我只能切成按行聊,聊完一个函数就赶紧新开一个对话,麻烦是麻烦点,但费用可控多了。感觉这种长上下文缓存问题好多模型都有。

看帖子里提到那个issue #25,后面有更新说找到root cause了吗?具体是什么原因导致的?是扩展本身处理prompt的方式有问题,还是DeepSeek V4 Pro服务端的缓存机制有缺陷?

遇到这种情况,马上停用那个扩展,去后台API key管理页面把那个key的额度限制设低点,比如每天1美元。然后去扩展设置里找找有没有禁用“思考模式”或者限制上下文长度的选项。没有的话就换扩展或者直接用网页版。

上周刚因为这个踩坑,充了20测试,半小时不到就没了。气得我直接把扩展卸了。第三方的东西就是不稳定。

同问+1,刚打算试试这个扩展就看到这帖子了,看来还是再观望下吧。

哎,怎么说呢,感觉现在这些AI工具的宣传和实际使用体验差距太大了。官方文档只会告诉你怎么接上去用,但根本不提这些潜在的、能让你钱包瞬间空掉的坑。尤其对新人来说,一开始根本不懂什么token计算、缓存命中率这些概念,等懂了已经交完学费了。这不仅仅是DeepSeek的问题,是整个生态的问题,缺少透明的成本预估和有效的防护措施。我后来养成的习惯是,任何新模型或新扩展,先开个限额极低的key测试几天,看消费模式正常了再考虑正经用。

今天天气真不错,适合出去走走。哦对了,你们在讨论AI啊,我之前也试过用AI写Python,效果还行。

大部分第三方扩展只要走的是各自模型的key,倒不至于全都坑