Skip to content

[Go SDK] Port .harness() to Go SDK #207

@santoshkumarradha

Description

@santoshkumarradha

Overview

Port the .harness() feature to the Go SDK. All 4 providers use CLI subprocess (no native Go SDKs exist for any coding agent).

Design doc: docs/design/harness-v2-design.md (Sections 4, 8.3)

Scope

Go SDK (sdk/go/harness/)

  • HarnessConfig struct (in sdk/go/agent/harness.go)
  • result.goHarnessResult, RawResult, Metrics types
  • provider.goProvider interface
  • factory.goBuildProvider() function
  • runner.goRunner with retry + schema orchestration
  • schema.go — Schema handling (JSON Schema from struct tags)
  • cli.go — Shared CLI subprocess utilities
  • claudecode.go — Claude Code provider (CLI-based: claude -p)
  • codex.go — Codex provider (CLI-based: codex exec)
  • gemini.go — Gemini provider (CLI-based)
  • opencode.go — OpenCode provider (CLI-based)
  • Wire into Go Agent struct (Agent.Harness() / Agent.HarnessRunner())
  • Tests (runner_test.go, schema_test.go)

Remaining Work

  • Codex provider (codex.go) — not yet implemented
  • Gemini provider (gemini.go) — not yet implemented
  • BuildProvider() factory (factory.go) — not yet implemented

Notes

  • Go has no native SDKs for any coding agent → all providers are CLI subprocess
  • Schema validation via json.Unmarshal with struct tags
  • Follow patterns from Python/TS implementation

Dependencies

  • Depends on: Python + TS implementation being complete and merged (feat/harness-v2 PR)
  • Reference: Epic issue for full context

Acceptance Criteria

  • Feature parity with Python/TS implementation
  • All 4 providers work via CLI subprocess
  • Schema handling uses same file-write strategy
  • All tests pass
  • go test ./... clean

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions