Skip to content

refactor: simplify providers, add OpenCode, migrate to YAML#60

Merged
robbycochran merged 7 commits into
mainfrom
rc/simplify-providers
Jun 11, 2026
Merged

refactor: simplify providers, add OpenCode, migrate to YAML#60
robbycochran merged 7 commits into
mainfrom
rc/simplify-providers

Conversation

@robbycochran

Copy link
Copy Markdown
Collaborator

Summary

  • Delete providers.toml, internal/preflight/ package, harness preflight and harness providers commands (-1,948 lines)
  • Both harness up and harness create now auto-register missing providers — no separate harness providers step needed
  • Add --provider-refresh flag to up (replaces providers --force)
  • Empty env values in agent YAML read from host environment (e.g., JIRA_URL: resolves via os.Getenv)
  • Task files passed to entrypoint via -p "$(cat task.md)" instead of file path
  • Add OpenCode as first-class agent alongside Claude Code (harness up --agent opencode)
  • Migrate all configs from TOML to YAML, remove BurntSushi/toml dependency
  • Fix ParseCLIVersion for version strings without v prefix

Commands removed

  • harness preflight — registration functions already validate inline
  • harness providers — folded into up and create

Commands updated

  • harness up --provider-refresh — replaces providers --force
  • harness create — now auto-registers missing providers

New

  • agents/opencode.yaml — OpenCode agent config
  • sandbox/opencode.json — MCP config for OpenCode
  • OpenCode installed in sandbox Dockerfile (npm install -g opencode-ai)
  • Network policy updated for OpenCode telemetry

Test plan

  • make test — unit tests pass
  • make test-local — 22/22 pass (sandbox create, providers, env vars, GWS, MCP, Claude)
  • make test-remote (OCP) — 15/15 pass (full deploy + sandbox lifecycle)
  • CI — Go vet + unit tests (bats removed)

🤖 Generated with Claude Code

…mand

The registration functions in cmd/providers.go already validate all
prerequisites inline (env vars, files, health checks) and show clear
skip messages. The TOML-based preflight system was a parallel validation
layer that duplicated this logic.

Deleted:
- providers.toml (provider catalog)
- internal/preflight/ (package: LoadProviders, CheckInput, CheckProvider)
- cmd/preflight.go (harness preflight command)
- test/preflight.bats (29 bats tests for the deleted system)

Updated:
- cmd/create.go: remove preflight check block for missing providers
- cmd/deploy.go: inline openshell.toml chart-version read (was preflight.LoadConfig)
- main.go: remove NewPreflightCmd registration
- Makefile: remove bats from test target
- .github/workflows/ci.yml: remove bats install and test step
…command

Both 'harness up' and 'harness create' now register missing providers
automatically. The standalone 'harness providers' command is removed.

- create: registers missing providers before sandbox creation instead
  of erroring with 'run: harness providers'
- up: add --provider-refresh flag (replaces providers --force) to
  delete and recreate all providers
- providers.go: remove NewProvidersCmd, keep registerProviders() as
  internal function called by up and create
Two agent config improvements:

- Empty env values in agent YAML now read from the host environment.
  JIRA_URL: '' in the YAML resolves to os.Getenv('JIRA_URL'). Vars
  that resolve to empty after host lookup are omitted from the env map.

- When task: is specified, the entrypoint receives the task content
  via -p flag: exec claude -p "$(cat task.md)" instead of passing
  the file path as a positional argument. The entrypoint field is now
  the base command only (e.g., 'claude' not 'claude -p').

- agents/demo.yaml: remove -p from entrypoint (harness adds it
  automatically when task is present)
OpenCode is an open-source AI coding agent that supports Anthropic/Vertex AI.
Same gateway, same providers, same credentials — just a different entrypoint.

Usage: harness up --agent opencode

Added:
- agents/opencode.yaml: OpenCode agent config with Vertex AI inference
- sandbox/opencode.json: MCP server config for OpenCode (atlassian)
- sandbox/Dockerfile: install opencode via npm, copy config
- sandbox/policy.yaml: rename claude_telemetry to agent_telemetry,
  add opencode.ai endpoint and /usr/local/bin/opencode binary
Convert gateway.toml to gateway.yaml in all three gateway directories
(local, ocp, kind) and openshell.toml to openshell.yaml. Update config
parsing to use gopkg.in/yaml.v3 instead of BurntSushi/toml.

- internal/gateway/config.go: TOML struct tags to YAML, read gateway.yaml
- cmd/deploy.go: read openshell.yaml for chart-version
- All gateway configs converted with identical structure
- Chart versions bumped to 0.0.59 in ocp and kind configs
- go.mod: BurntSushi/toml dependency removed (go mod tidy)
The installed CLI outputs 'openshell 0.0.59' (no v prefix) on some
platforms. ParseCLIVersion now falls back to splitting on the last
space when no 'v' is found.
openshell.yaml was a global config with three fields:
- providers: dead — agent YAML is the source of truth
- inference.model: dead — read from OPENSHELL_MODEL env or defaulted
- upstream.chart-version: redundant — already in each gateway.yaml

The only caller (deploy.go) now reads chart-version from the gateway
config or OPENSHELL_CHART_VERSION env var.
@robbycochran robbycochran merged commit 3d232be into main Jun 11, 2026
5 checks passed
@robbycochran robbycochran deleted the rc/simplify-providers branch June 13, 2026 14:03
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.

1 participant