feat: add bilingual (zh/en) language support#74
Conversation
Add a `language` input (default: `zh`) to all actions that controls the
agent's response language. When set to `en`, the Python script appends
an English language override instruction to the prompt.
Changes:
- `run-github-opencode.py`: read `GITHUB_RUN_OPENCODE_LANGUAGE` env var,
append English instruction to prompt when language is `en`
- `github-run-opencode/action.yml`: add `language` input
- `review/action.yml`: add `language` input, update prompt with bilingual
verdict keywords (可合并/CAN MERGE, etc.)
- `feature-missing/action.yml`: add `language` input, update prompt with
bilingual verdict keywords (无遗漏/NO GAPS, etc.)
- `spec-coverage/action.yml`: add `language` input, update prompt with
bilingual verdict keywords (无需审计/SKIP, etc.)
- `README.md`: add complete Chinese documentation section
Users can configure language via input or from repository variables:
language: ${{ vars.OPENCODE_LANGUAGE }}
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
无遗漏 PR 的 4 项需求均已完整实现:
所有文件变更与 PR 自述范围一致,无遗漏项。 |
|
经过对全部 6 个变更文件的全面审查,结论如下: 可合并 本 PR 设计清晰,功能完整地实现了所有 action 的中英文双语支持。结构合理:YAML 层新增 阻塞项:无 建议项:
|
Prevents runtime crash when user passes non-object JSON (e.g. 'true', '42', '[1,2]') as GITHUB_RUN_OPENCODE_PERMISSION. Now prints a clear error message and exits instead of failing with AttributeError in _deep_merge.
|
发现遗漏 摘要PR 的 4 项需求基本实现,但存在 1 个严重的设计问题。 CRITICALPython 语言覆盖机制在 English 模式下与 prompt 模板内的硬编码中文指令冲突
|
|
可合并 本 PR 设计清晰,完整实现了所有 action 的中英文双语支持。YAML 层新增 阻塞项:无 建议项:
|
Move language-specific response instructions to Python layer where they are dynamically appended based on the language input parameter. This eliminates the conflict when language: en is set but prompt templates contained hardcoded 'Please respond in Chinese.' - Remove 'Please respond in Chinese.' from review, feature-missing, and spec-coverage action.yml prompt templates - Add explicit zh language instruction in Python (append Chinese response directive when language != 'en')
|
无遗漏 PR 的 4 项需求均已完整实现:
|
|
有条件合并 总结PR 实现了所有 action 的 阻塞项prompt 模板硬编码语言指令与 三个 wrapper action 的 prompt 模板中均硬编码了 应移除模板中的语言指令,统一由 建议项
|
… set_env() consistently
|
可合并 PR 实现清晰:YAML 层定义 阻塞项:无 建议项:
|
|
无遗漏 PR 的 4 项需求均已完整实现:
|
|
可合并 本 PR 的 5 次提交已完整实现了双语支持:YAML 层定义 阻塞项:无 建议项:
|
|
无遗漏 PR 的 4 项需求均已完整实现:
|
|
无遗漏 PR 陈述的 4 项需求均已完整实现:
|
|
可合并 PR 实现了所有 action 的中英文双语支持。此前 review 中提出的阻塞性问题(prompt 模板中的硬编码中文指令、非法语言值缺少 warning、 阻塞项:无 建议项:
|
…ature-missing - Replace os.environ["MODEL"] = ... with set_env() for consistency - Add extra-env input to feature-missing/action.yml, matching review and spec-coverage
|
可合并 PR 功能完整、设计清晰:YAML 层定义 阻塞项:无 建议项:
|
|
无遗漏 PR 陈述的 4 项需求均已完整实现:
|
…g for extra-env - Define SUPPORTED_LANGUAGES set for easier language support extension - Add warning when extra-env key starts with GITHUB_RUN_OPENCODE_ prefix - Addresses review suggestions from AI code review
|
PR 无关联 issue,从 PR 标题和正文提取需求共 4 项,逐项对照实现如下: 需求 1:All actions 新增
需求 2:
需求 3:prompt 判定关键词更新为双语格式
需求 4:README 新增中文文档
无遗漏 |
|
可合并 本 PR 设计清晰:4 个 action 的 YAML 层定义 阻塞项:无 建议项:
|
…nv warnings, language branch comment
|
PR 无关联 issue,从 PR 正文提取需求共 4 项,逐项对照: 无遗漏 需求 1:All actions 新增
需求 2: 需求 3:prompt 判定关键词更新为双语格式
prompt 模板中无硬编码语言指令,由 Python 层统一控制。 需求 4:README 中文文档 |
|
无遗漏 PR 陈述的 4 项需求均已完整实现:
|
|
可合并 本 PR 功能完整、设计清晰,所有 action 的 阻塞项:无 建议项:
|
|
可合并 PR 功能完整、设计清晰,此前 review 提出的所有问题(硬编码中文指令、非法语言值缺少 warning、 阻塞项:无 建议项:
|
…ndling - Split 'zh' into explicit branch so future languages hit debug warning - Add comment explaining intentional os.environ use in extra-env - Add maintenance comment to SENSITIVE_ENV_KEYS
|
无遗漏 PR 声明的 4 项需求均已完整实现:
|
|
可合并 本 PR 设计清晰,中英文双语支持功能完整实现:4 个 action 的 YAML 层新增 阻塞项:无 建议项:
|






















Summary
language输入参数(默认zh),支持zh(中文)和en(英文)language: en时,Python 脚本自动在 prompt 末尾追加英文回复指令无需审计 / SKIP、可合并 / CAN MERGE)使用方式
直接设置:
从仓库变量读取:
改动文件
github-run-opencode/run-github-opencode.py— 读取GITHUB_RUN_OPENCODE_LANGUAGE环境变量,追加语言指令github-run-opencode/action.yml— 新增language输入review/action.yml— 新增language输入,prompt 增加双语判定关键词feature-missing/action.yml— 同上spec-coverage/action.yml— 同上README.md— 新增中文文档部分Test plan
language: zh(或不设置),验证 agent 以中文回复language: en,验证 agent 以英文回复,使用英文判定关键词vars.OPENCODE_LANGUAGE配置语言,验证能正确读取🤖 Generated with Claude Code