OpenCode
CLI name: opencode · Status: supported
Prerequisites
Section titled “Prerequisites”Install OpenCode so opencode is on PATH. Models use
provider/model syntax (for example anthropic/claude-sonnet-4-20250514 or a
free tier model for smoke tests).
Agent config
Section titled “Agent config”cli = "opencode"model = "anthropic/claude-sonnet-4-20250514"profile = "edit"What wteam runs
Section titled “What wteam runs”opencode run --format json [-m <model>] [-s <session_id>] … <prompt>- First turn: role text is prepended to the user message (OpenCode has no separate system slot in this adapter).
- Later turns:
-s <session_id>. - Output: JSONL on stdout.
sessionID,textparts,step_finishfor context (tokens.input + tokens.cache.read). - Truncated streams: if final
textevents are missing, wteam recovers frompart_delta(partType: text). errorevents fail the turn.
Permissions
Section titled “Permissions”Non-full profiles set OPENCODE_PERMISSION JSON from translated rules; full
adds --auto. Path rules are enforced similarly to Claude (catch-all deny outside
allowed paths).
wteam permissions --profile edit --cli opencodeMaintaining fixtures
Section titled “Maintaining fixtures”Golden JSONL for tests lives under tests/fixtures/adapters/opencode/. Refresh
from a live CLI:
tests/smoke/capture-adapter-fixtures.shOptional: WTEAM_OPENCODE_SMOKE_MODEL (default github-copilot/gemini-3.8-flash).