Skip to content

[SDK] OpenCode provider for .harness() #206

@santoshkumarradha

Description

@santoshkumarradha

Overview

Implement the OpenCode CLI provider using subprocess. No native SDK — CLI-only for both Python and TypeScript.

Branch: feat/harness-v2
Design doc: docs/design/harness-v2-design.md (Section 4)

Scope

Python (sdk/python/agentfield/harness/providers/)

  • opencode.pyOpenCodeProvider implementing HarnessProvider:
    • CLI subprocess invocation
    • Parse output from stdout
    • Extract result, messages, metrics
    • Binary path via opencode_bin
  • Register in _factory.py for "opencode"
  • Tests with mocked subprocess

TypeScript (sdk/typescript/src/harness/providers/)

  • opencode.tsOpenCodeProvider
    • Uses shared CLI utilities
  • Register in factory.ts
  • Tests

Key Details

  • OpenCode CLI interface and output format
  • No native schema support — relies entirely on file-write strategy
  • Binary path configurable via HarnessConfig.opencode_bin
  • Reuses shared CLI subprocess utilities

Acceptance Criteria

  • CLI command constructed correctly
  • Output parsing works
  • Handles binary not found and non-zero exit codes
  • All tests pass

Dependencies

Metadata

Metadata

Labels

ai-friendlyWell-documented task suitable for AI-assisted developmentarea:harnessCoding agent harness integrationenhancementNew feature or requestsdk:pythonPython SDK relatedsdk:typescriptTypeScript SDK related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions