Skip to content

OpenCode V2 Verification ​

Audience: Developers — Maintainers reproducing the V2 acceptance checks and reviewing evidence.

Status — 2026-11-10 ​

The recorded Linux setup passed the OpenCode V2 execution, model, permissions, lifecycle, accounting, and standalone history checks below.

Historical evidence identifies a tested CLI, not a runtime pin: Linux, OpenCode v2.2.6. The latest real-provider smoke used provider opencode, model opencode/glm-5.3-flash-free#low. Its native completed-turn estimate was explicitly USD 0 for this advertised free model; cancelled-turn cost was unavailable, not zero. Session ses_e3a3afcadffexYHH531A0wyokR was listed and exported with actual assistant history after server shutdown, before the dedicated temporary store was removed. This identifier is evidence, not a promise that the disposable store still exists.

Acceptance areaObserved resultEvidence boundary
Capability/authenticationPass: V2 identity/operations, missing/wrong Basic auth rejected; HTML/auth/incompatible fixtures fail before workActual installed CLI plus deterministic unit fixtures; no exact version check
Execution/model/effortPass: native edit, yieldshell, explicit and effort-only variant, invalid model/variant rejection, unchanged config bytesReal provider and isolated native protocol probes
PermissionsPass: native and MCP protected writes rejected, permitted writes allowed, inherited asks normalized before denies, shell/question/disallowed tools denied, policy conflicts explicitActual V2 tool-call probes plus policy/config fixtures; no arbitrary-shell security claim
Continuation/recoveryPass: block-once verifier uses one session, kept-alive retry, cold native reattachment, forced SSE EOF without prompt replayNative CLI with controlled provider; real-provider continuation/restart also passed
Explicit CLI resumePass: foreground fixture interrupted through its recorded terminal handle (exit 130), then run --start-from Probe --resume confirmed the same persisted sessionDedicated temporary Git workspace/config/data/state and loopback provider; runtime mismatch and missing-native-session fresh fallbacks separately checked
CancellationPass: actual 60-second MCP tool interrupted before its completion marker, owned server and observed detached descendants stopped, unrelated process unaffectedReal-provider smoke, controlled runner, and ordinary-process regression; no PID-name scan
AccountingPass: cache/reasoning/USD units, cumulative parent/child baselines and turn deltas, missing fields remain unavailableNative synthetic usage intentionally supplies known counters/cost; not provider billing validation
Native restart discoveryPass with default and custom XDG stores: standalone list/export and assistant-history marker after owned server stopsOpenCode-owned SQLite; metadata/title-only matches do not pass

The manual CLI probe exposed a shared reporting defect: an explicit native fresh fallback was not logged by the pipeline and overwrote the original resume target. Production fallback logging and metadata preservation were corrected, unit-regressed (including interruption and replacement-session retries), and the isolated missing-session CLI scenario was rerun successfully. An earlier weak cancellation check also missed a detached MCP child; the stronger blocking-tool smoke exposed it, and verified descendant tracking now survives retries and parent exit.

Reproduce local checks ​

From the hpilot/ source checkout:

bash
uv sync
uv run pytest tests/unit/test_opencode*.py tests/unit/test_runtime_config_opencode_resume.py tests/unit/test_usage_normalize_timerange.py
uv run ruff check src/
uv run mypy --strict src/
uv build

The implementation-stage owning Python package suite (uv run pytest --tb=short) passed 3,190 tests with 194 explicit opt-in integration/E2E skips. The separate installed-CLI/native-helper/controlled-runner selection passed seven tests (one real-provider test deliberately deselected); the real-provider script independently passed. Ruff, strict MyPy (195 source files), and wheel/sdist build passed. Skips are not passes. This is not a workspace-wide verify or Docker-services invocation. Detailed current command counts are recorded in the implementation checklist and local .tmp/opencode-v2-*.log artifacts.

Installed-CLI protocol tests use a credential-free loopback model with real native APIs. They do not prove real-provider behavior:

bash
uv run python scripts/smoke-opencode-v2.py --protocol
HPILOT_OPENCODE_V2_PROTOCOL_SMOKE=1 uv run pytest tests/integration/test_opencode_v2_smoke.py --run-integration -k 'not live_v2_provider'

The real-provider runner requires explicit opt-in, a configured provider, and a variant-capable model. Replace placeholders with your native catalog values; live calls can incur charges:

bash
uv run python scripts/smoke-opencode-v2.py --live --model provider/model --effort advertised-variant --timeout 90 --max-cost .25
# Or the explicit pytest gate:
HPILOT_OPENCODE_V2_LIVE_SMOKE=1 HPILOT_OPENCODE_SMOKE_MODEL=provider/model HPILOT_OPENCODE_SMOKE_EFFORT=advertised-variant uv run pytest tests/integration/test_opencode_v2_smoke.py --run-integration -k live_v2_provider

The runner isolates Git workspace/config/data/state, bounds each stage, checks native estimated USD while observing events, uses a deterministic verifier, and cleans its owned tree before deleting temporary files. The estimate cap is not a provider billing guarantee. Invalid or unavailable prerequisites leave evidence unverified/failed, never passed.

Evidence and privacy ​

  • tests/fixtures/opencode_v2/ holds sanitized actual-wire excerpts and synthetic execution data; its README records disproven planning spellings. The runtime validates the installed server's actual OpenAPI, not this fixture.
  • Local ignored artifacts include opencode-v2-{permission,lifecycle,usage,live,cli}-evidence.json and package/protocol test logs. These artifacts are not required to read the tracked status above.
  • Native visibility evidence contains identifiers/booleans and sanitized diagnostics only. Do not publish prompts, transcript exports, provider headers/passwords, or authentication stores.
  • A missing listing/export, missing variant, failed deadline, unavailable host, skipped integration test, or metadata declaration is not passing evidence. Do not emit an implementation-complete contract while a required gate is unverified.