opencode-yg
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 17 GitHub stars
Code Pass
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
This tool is a fork of the opencode project designed to optimize LLMs (specifically DeepSeek) for consistent Chinese "language anchoring." It acts as an agent to make AI models think and reason in a specific language while fixing bugs related to Windows compatibility and API providers.
Security Assessment
Overall Risk: Low. The automated code scan checked 12 files and found no dangerous patterns. It does not request any dangerous system permissions, nor did the scan detect hardcoded secrets. As an LLM agent interface, it inherently processes user prompts and makes API network requests to external AI models (like DeepSeek or OpenRouter). Users should be aware that any code or data shared in prompts will be sent to these third-party AI providers.
Quality Assessment
Quality is somewhat mixed but actively managed. The project is licensed under the permissive MIT license, ensuring clear legal terms for use and modification. It has a small but existent community footprint with 17 GitHub stars. The repository is highly active, with the last push occurring today. However, the developer explicitly notes that the codebase is undergoing a major refactoring. They advise against using it as a primary production tool until the rewrite is completed around May 2026. Additionally, the vast majority of the codebase is AI-generated under human supervision.
Verdict
Use with caution — it is safe from a security standpoint, but it is currently an experimental, AI-generated project undergoing heavy refactoring and is not recommended for daily production use.
A research fork of opencode demonstrating Language Anchoring — making LLMs think consistently in your language. Verified: 95%+ Chinese thinking compliance.
fkyah3/opencode-fkyah3
DeepSeek 优化 · Windows 适配 · AI 实现
🧠 语言锚定 —— LLM 多语言适配的系统方法
核心发现:LLM 会话的第一个主动输出语言,决定了整场对话的思维惯性。读中文 ≠ 用中文思考。
| 阶段 | 效果 | 干预措施 |
|---|---|---|
| 纯 prompt 约束(4 条语言规则) | ~70% | 仅修改 prompt 文本 |
| + 翻译 16 个工具描述 | ~85% | 工具层中文对齐 |
| + 翻译 50+ 文件注释(新对话验证) | ~95%+ | 代码层加固 |
| + 锚定指令(7 行) | 接近全程中文 | 自回归惯性利用 |
锚定指令只有 7 行:
## 语言锚定(硬性要求)
收到用户的第一条消息后,在执行任何操作或开始推理之前,
你必须先用中文写一段简短总结:
1. 用户要你做什么
2. 你计划用什么步骤完成
3. 你还缺什么信息
这段中文是你的第一个输出。完成这段输出后才能开始执行具体任务。
学术对照:Contextual Inertia(arXiv 2603.04783)、Cognitive Inertia(arXiv 2503.01307)——这些研究的是"如何打破有害惯性"。我们的贡献是正面利用同一机制。
📖 Discussion #1 — 语言锚定 RFC
💬 Discussion #2 — 我对AI的看法(中文)
🌐 Discussion #3 — How I Work with AI (English)
V2 对照实验(2026-04-27)
我们在纯英文环境(关闭 OMO 插件,禁用所有中文提示词)中做了三组对照实验,验证锚定理论的独立性:
| 测试 | 环境 | 指令 | 思考语言 | 漂移 |
|---|---|---|---|---|
| 2 | 纯英文 | 无 | 英文(全程稳定) | 无——符合预期 |
| 3 | 纯英文 | 锚定指令(7行) | 中文 → 约1600行后漂回英文 | ✅ 显著漂移 |
| 5 | 纯英文 | "请用中文语言思维"(一句话) | 中文(全程稳定) | 无——零漂移 |
核心结论:
- 环境对齐提供了基线效果(约70-90%),不是锚定指令
- 锚定指令(输出约束)在长对话中会衰减——尤其是在处理大量英文代码/工具结果时
- 直接指定思维模式的指令("用中文语言思维")远比锚定稳定,零衰减
- 思维语言 ≠ 输出语言——锚定约束的是输出格式,思维指令直接作用于认知方式
完整实验报告:specs/实验/语言对齐实验报告-v2.md
这不推翻 v1 发现,而是将其拆分为三层:
环境对齐(中文上下文) → 约 70-90% 效果
输出锚定(首个输出约束) → 约 30-50%,短期有效,会衰减
思维模式指令(直接指定框架) → 约 90%+,长对话稳定
原始主张("锚定指令单独驱动中文输出")过于粗粒度。细化的认识更实用:最有效的方法是环境对齐 + 思维模式指令,按此顺序组合。
⚠️ 正在重构
这个 fork 正在进行一次大幅度的提示词体系重构,预计 2026 年 5 月 5 日左右完成。
我的做法和主流不一样。现在多数方案是给 AI 加一堆硬约束——"不许用英文"、"必须按格式输出"、"否则扣分"。我感觉这条路走不远。
我的想法是:DeepSeek 的中文语料占比很高,它对"中国的思维方式"应该已经有了足够深的理解。问题不是它做不到,而是我们有没有用对方式去调动它。
所以这次重构我会把硬约束全部去掉,换成基于问题框架和行为准则的指引——更多是"定义你是谁、你要解决什么问题",而不是"你不能做什么"。这里面会融入一些我对中国文化中处理问题方式的理解。
现阶段版本可以自己折腾,但不推荐作为主力工具。等我完成重构后再看效果。
具体进度会在 specs/ 更新,感兴趣可以关注。
关于本项目
这是 anomalyco/opencode 的个人 Fork。所有修复、优化、功能均由 AI 完成——DeepSeek V4 Flash (thinking mode) / Sisyphus——在人类监督下执行。
上游是优秀项目。Windows 和 DeepSeek 并非他们的优先方向。我们自行处理。
代码实现:DeepSeek V4 Flash (thinking mode) / Sisyphus(AI)
人工审核与方向把控:fkyah3
This fork is a live demonstration of what AI-built software looks like.
详见specs/。
修复列表
| 修复项 | 领域 |
|---|---|
reasoning_content 丢失导致 API 400 —— DeepSeek 思考模式根因修复 |
核心 |
OpenRouter @openrouter/ai-sdk-provider providerOptions key 不匹配 |
Provider |
| 多窗口崩溃级联 —— OMO tool-pair-validator 增加熔断器 | 稳定性 |
| 每会话独立日志(重启不再截断 dev.log) | 开发体验 |
| Windows CJK 编码 —— 子进程管道三层 GBK/UTF-8 修复 | Win32 |
| TUI 插件加载 —— Magic Context 侧边栏空白(Zod strict 模式) | TUI |
MC 工具输出截断 —— [truncated] → [tool: N lines, MKB | preview] 压缩展示 |
MC |
| DeepSeek V4 架构研究 → 配置对齐:400K 上下文、90% MC 阈值、CSA 对齐压缩 | V4 |
| 全局 Session 池 —— 任意目录下查看所有对话(2.0) | Session |
| 全中文系统提示:Sisyphus、keyword-detector、系统消息、环境信息 | i18n |
| 语言锚定 —— LLM 多语言适配的系统方法(含剂量关系验证数据) | i18n |
快速启动
cd packages/opencode
bun run --conditions=browser src/index.ts
模型配置参考
Flash(日常驱动——全部 Agent)
"deepseek-v4-flash": {
"limit": { "context": 400000, "output": 393216 },
"options": {
"reasoningEffort": "max",
"thinking": { "type": "enabled" }
},
"interleaved": { "field": "reasoning_content" }
}
reasoningEffort:high(默认)或max。Agent 工具会自动设为max。interleaved: DeepSeek 思考模式通过@ai-sdk/openai-compatible时必须配置,否则reasoning_content不会转发。thinking: 推理模型必须配置{ type: "enabled" }。
了解更多
| 链接 | 内容 |
|---|---|
specs/ |
修复详情、分析文档、问题跟踪 |
specs/internal/COMPLETION.md |
完成清单与当前状态 |
| 上游 Issue #24104 | reasoning_content 根因讨论 |
Upstream
基于 anomalyco/opencode(Apache 2.0)。定期合并上游变更。
Crafted by AI. Curated by human. Built for the real world.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found