Skip to content

feat: add OpenCode V2 host support - #1

Closed
sudomarcma wants to merge 1 commit into
didi:mainfrom
sudomarcma:feat/opencode-host
Closed

sudomarcma wants to merge 1 commit into
didi:mainfrom
sudomarcma:feat/opencode-host

Conversation

@sudomarcma

@sudomarcma sudomarcma commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds OpenCode V2 as a first-class HelixHarness host while keeping the canonical commands/, skills/, and agents/ files as the only business sources.

  • Adds hosts/opencode/ with the manifest, command projection, runtime, subagent, UT, lifecycle, project config, project hooks, and installer resources.
  • Adds a native OpenCode plugin package (helixharness/package.json + helixharness/opencode/) that registers helix:<command>, helix-<skill>, and helix-<agent> from the canonical files instead of copying Markdown into .opencode/.
  • Injects a pre-bound Host Context, substitutes $ARGUMENTS / plugin and repo paths, forwards command attachments, and submits through session.prompt without recursive command execution.
  • Maps logical actions to native OpenCode tools (read, edit, shell, question, skill, subagent) and binds method-skill repo_root to the requesting session.
  • Adds a host-only helix-worker role for generic may_delegate Workspace Apply RepoJobs; canonical roles get a subagent deny rule for default leaf semantics.
  • Declares OpenCode telemetry and plugin update as unsupported; existing scripts already return unsupported_host / continue_silently.
  • Uses AGENTS.md with settings_file=null, and declares project hooks unsupported rather than inventing a settings contract.
  • Updates English and Chinese installation, user guide, architecture, and support references.

Closes #2

Testing

  • python3 scripts/run_tests.py — 372 tests pass on Python 3.12.
  • bun test opencode/tests — 15 pass, 4 gated E2E tests skipped.
  • bun run typecheck — passes.
  • HELIXHARNESS_OPENCODE_E2E=1 bun test opencode/tests/e2e.test.ts — 2 tests pass against a real OpenCode 2.2.2 server, covering command/skill/agent registration and command prompt admission with Host Context.
  • Local plugin loading was also verified without node_modules; the runtime plugin has no npm runtime dependencies.

Deployment notes

  • Workspace Apply RepoJobs need experimental.subagent_depth >= 2 in opencode.json(c); single-repo flows are unaffected. Documented in the OpenCode installer and subagent adapter.
  • The Claude d-d2c skill-scoped Stop / PreToolUse guards are not active on OpenCode; the adapter documents the no-hook/--bare semantics.
  • OpenCode /helix:update returns continue_silently; users update through opencode plugin update.

Add a first-class OpenCode V2 Host Kit and plugin package that registers
HelixHarness commands, method skills and subagent roles from the canonical
resources instead of copying Markdown into .opencode/.

- add hosts/opencode manifest, runtime, subagent, UT, lifecycle, project
  config and installer resources
- add opencode/index.ts + core.ts with Host Context injection, argument
  substitution, native subagent mappings and repo_root binding for skills
- add Bun unit, registration and real-server E2E tests
- add Python Host Kit, detector, telemetry/update and feedback coverage
- document OpenCode installation, verification and Workspace depth setup
@ayochao

ayochao commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

感谢提交适配,有三点想请你再确认一下:

  1. 文档里对子任务能不能继续派发任务的说法不一致,麻烦统一一下。
  2. 获取项目目录失败时,会使用默认目录。这里能否保证不会操作错仓库?请补充修改或测试。
  3. 请再跑一个完整需求,确认从初始化到开发、评审、归档都能走通,多仓场景也验证一下。
    安装说明里也请标明目前是预览支持,以及暂不支持的功能。补充后我们再继续评审,感谢

@Zeratucl

Copy link
Copy Markdown
Collaborator

已通过 #29 ,合并入主干分支:本次完成 OpenCode 宿主适配,支持 9 个 /helix:* 命令、核心工作流、任务管理、编辑后巡检及阶段统计,请更新主干代码后重试。如仍遇到问题,请补充环境信息和报错

@Zeratucl Zeratucl closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OpenCode V2 as a HelixHarness host

3 participants