AICodeWorker v1.6.1: 修复免费模型模式下误用宿主付费 key#372
Merged
Merged
Conversation
问题:当不路由到 VCP(模式A,期望用 opencode 自带免费模型)时, runner.js 的 childEnv 没有清空上游 key。若宿主 VCP 进程环境里带有 OPENAI_API_KEY(很常见),会被 opencode 子进程继承,导致本想用免费模型 却误走了付费 OpenAI 通道,违背本插件"用免费模型省 token"的初衷。 修复: - runner.js:useVCPRouting=false 分支显式清空 OPENAI/ANTHROPIC 的 KEY/BASE_URL - AICodeWorker.js:opencodeApiKey 去掉 process.env.ANTHROPIC_API_KEY 回退, 留空就是留空,不无意注入宿主 key - config.env.example:纠正"留空用 Anthropic 免费额度"的错误说明(实际会回退付费 默认模型);补充 opencode/ 免费模型清单与选择建议;模式B示例去掉真实值占位; ALLOWED_PROJECT_ROOTS 改为通用示例 - README.md:补充免费模型清单与"OPENCODE_MODEL 别留空"提示 - 版本 1.6.0 → 1.6.1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QcWBnuUEn5bxXhvi8qpB5m
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.
问题
当不路由到 VCP(模式A,期望用 opencode 自带免费模型)时,
runner.js的 childEnv 没有清空上游 key。若宿主 VCP 进程环境里带有OPENAI_API_KEY(很常见),会被 opencode 子进程继承,导致本想用免费模型却误走了付费 OpenAI 通道,违背本插件"用免费模型省 token"的初衷。修复
useVCPRouting=false分支显式清空OPENAI_API_KEY/OPENAI_BASE_URL/ANTHROPIC_API_KEY/ANTHROPIC_BASE_URLopencodeApiKey去掉process.env.ANTHROPIC_API_KEY回退,留空就是留空opencode/免费模型清单;模式B示例去掉真实值;ALLOWED_PROJECT_ROOTS改为通用示例OPENCODE_MODEL别留空"提示版本 1.6.0 → 1.6.1,仅改动 AICodeWorker 插件目录,已自查无私人信息。
🤖 Generated with Claude Code