Skip to content

feat(opencode): sub-agent dispatch parity via agents and the task tool #322

Description

@thewrz

This was written agentically; verify its assertions:

Why

parallel-issues and review-remote-pr dispatch implementation workers through a harness-specific spawn path (Codex spawn_agent, Claude subagents). OpenCode's verified dispatch surface is different: markdown-defined agents (mode: subagent) invoked via the task tool, with per-agent model: provider/model-id and permission scoping. Without a mapped path, an OpenCode session can only take the worker=self (spawn unavailable) degradation for every issue.

What

  • Ship an agentkit-worker agent definition (.opencode/agents/, mode: subagent) whose model resolves from the repo's .agent/config.env worker declarations through the S2 spawn-contract mapping; document how the composed issue-lead prompt (from compose-worker-prompt.sh) is delivered through a task-tool invocation.
  • Extend spawn-contract.md's dispatch section with the OpenCode path: task tool = spawn; context isolation semantics (verify at implementation whether a task-tool subagent inherits conversation context — the fork_context:false equivalent must be proven, not assumed); nesting behavior (can a subagent invoke the task tool? verify and pin, mirroring the existing "nesting is blocked" finding on Codex).
  • Concurrency: verify whether OpenCode advertises a session concurrency cap; if none is discoverable, the skills' cap probe must return the documented no-cap path rather than stalling.
  • Completion-report parity: worker returns branch/SHA/diffstat/log-path exactly as other harnesses; worktree-commit.sh (post-fix(scripts): worktree-commit.sh owns commit attribution instead of trusting callers #313) derives the trailer when the worker omits it.

Acceptance

  • One end-to-end dispatched worker on OpenCode: composed prompt in, pushed branch + completion report out (transcript evidence in PR)
  • Context-isolation and nesting behavior verified and pinned in spawn-contract.md with evidence, not assumption
  • Cap probe behavior on OpenCode documented and tested
  • Completion table records the actual provider/model-id that ran
  • Unit tests pass; CI green

Blocked by the harness-identity (S2) and skills/commands (S4) slices.

🤖 Co-authored by Claude Fable 5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/skillsThe three skills and their proceduresenhancementNew feature or requestp2Wanted before public release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions