opencode-ci-harnesslisted
Install: claude install-skill air-gapped/skills
# opencode-ci-harness
Targets opencode **v2** (`opencode --version` → `v2.x`). On v1 the runner
fails: v1 has no `--standalone`. Read the version before diagnosing: rows
marked "before v2.2.x" apply only below that release.
## Rules
| Never | Instead |
|---|---|
| Call `opencode run` directly for a test | `scripts/isolated-run.sh` — sets the whole envelope |
| Run without `--standalone` | The default connects to the operator's background service, which uses the operator's config, credentials and MCP servers |
| Share a data dir with any other opencode process | Fresh scratch `XDG_DATA_HOME` per run (runner does it). The background service resumes unfinished sessions it finds in its data dir, without the run's permissions or step limit |
| Pass/fail on `$?` | Assert on NDJSON events (`scripts/assert-tool-sequence.sh`) |
| Print, log or copy a credential value | `--credential` pipes it into the scratch DB; it never touches disk outside it |
| Copy an OAuth refresh token | `inject-credential.py` withholds it and refuses tokens expiring within `--timeout` + 10 min |
| Use `--pure`, `--dir`, `OPENCODE_PURE`, `OPENCODE_AUTH_CONTENT`, `OPENCODE_DISABLE_DEFAULT_PLUGINS` | Removed in v2 — see `references/isolation.md` |
## Run against an endpoint
```bash
bash ${CLAUDE_SKILL_DIR}/scripts/isolated-run.sh \
--model "eng/MODEL_NAME" \
--base-url "BASE_URL/v1" \
--api-key "$API_KEY" \
--workdir "$W" --max-turns 12 --timeout 600 \
--prompt "$SCENARIO" > t.ndjson 2> t.stderr
`