背景
OpenCode 的 opencode.json 配置文件支持为 agent 配置 reasoningEffort 和 thinking 参数,例如:
{
"$schema": "https://opencode.ai/config.json",
"agent": {
"build": {
"mode": "primary",
"model": "deepseek/deepseek-v4-flash",
"options": {
"reasoningEffort": "max",
"thinking": {
"type": "enabled"
}
}
}
}
}
但对于 CI 场景(github-run-opencode、review、feature-missing),用户只能通过 model 和 prompt 等 action input 控制基本参数,没有办法配置模型的思考强度。
期望用法
- name: Run OpenCode review (high reasoning effort)
uses: Svtter/opencode-actions/review@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
zhipu-api-key: ${{ secrets.ZHIPU_API_KEY }}
model: deepseek/deepseek-v4-flash
reasoning-effort: max # 新增:控制思考强度
enable-thinking: true # 新增:启用 thinking 模式
实现思路
-
在 github-run-opencode/action.yml、review/action.yml、feature-missing/action.yml 中新增 inputs:
reasoning-effort:可选值 low、medium、high、max,默认空(不设置)
enable-thinking:布尔值,默认 false,设为 true 时在 opencode.json 中启用 thinking
-
在 run-github-opencode.sh 中,根据这两个参数动态生成或修改 opencode.json:
- 如果 runner 上已有
opencode.json,合并新配置而非覆盖
- 如果不存在,生成一个只包含必要配置的
opencode.json
-
run-opencode 也应支持类似参数,以便用户在自定义场景下也能配置思考强度
影响范围
github-run-opencode/action.yml + run-github-opencode.sh
review/action.yml
feature-missing/action.yml
run-opencode/action.yml + run-opencode.sh
README.md 文档更新
examples/ 示例更新
背景
OpenCode 的
opencode.json配置文件支持为 agent 配置reasoningEffort和thinking参数,例如:{ "$schema": "https://opencode.ai/config.json", "agent": { "build": { "mode": "primary", "model": "deepseek/deepseek-v4-flash", "options": { "reasoningEffort": "max", "thinking": { "type": "enabled" } } } } }但对于 CI 场景(
github-run-opencode、review、feature-missing),用户只能通过model和prompt等 action input 控制基本参数,没有办法配置模型的思考强度。期望用法
实现思路
在
github-run-opencode/action.yml、review/action.yml、feature-missing/action.yml中新增 inputs:reasoning-effort:可选值low、medium、high、max,默认空(不设置)enable-thinking:布尔值,默认false,设为true时在 opencode.json 中启用 thinking在
run-github-opencode.sh中,根据这两个参数动态生成或修改opencode.json:opencode.json,合并新配置而非覆盖opencode.jsonrun-opencode也应支持类似参数,以便用户在自定义场景下也能配置思考强度影响范围
github-run-opencode/action.yml+run-github-opencode.shreview/action.ymlfeature-missing/action.ymlrun-opencode/action.yml+run-opencode.shREADME.md文档更新examples/示例更新