OpenCode 2.x review peers fail: `opencode run` no longer accepts --dir (or --variant)

Author: RedmegaCreated Sep 28, 2026Updated Sep 28, 2026

With OpenCode 2.0.18, the OpenCode cross-model route in ce-doc-review fails before the model sees anything, because opencode run no longer accepts --dir:

ERROR   Unrecognized flag: --dir in command opencode run

The worker then logs provider opencode produced no usable schema-shaped output; skipping fold-in, so the pass silently degrades to "no artifact" for every trio lens and the whole-doc sweep.

Reproduced on macOS with plugin 3.29.0 (latest release). Upstream main at 5e3aee1a29d2 has the same invocation in both adapters:

  • skills/ce-doc-review/scripts/cross-model-doc-review.sh line 289
  • skills/ce-code-review/scripts/cross-model-adversarial-review.sh line 290

What changed in OpenCode 2.x

opencode run --help on 2.0.18 lists only these run flags: --standalone, --server, --continue, --session, --fork, --model ("in the format provider/model#variant"), --agent, --format, --file, --title, --thinking, --auto.

Two flags the adapters emit are gone:

  • --dir "$PEER_WORKDIR": always emitted, so every OpenCode run fails on 2.x.
  • --variant "$_oc_effort": emitted when cross_model_effort is set. The variant now appears to go in the model string as provider/model#variant.

Repro

bash
opencode --version   # 2.0.18
opencode run --dir /tmp --format json "hello"
# ERROR   Unrecognized flag: --dir in command opencode run

Config that triggered it (.compound-engineering/config.local.yaml):

yaml
cross_model_peer: opencode
cross_model_model: openrouter/openrouter/auto

Possible fix (untested)

Have the adapter cd into $PEER_WORKDIR before opencode run instead of passing --dir, and for 2.x fold the effort into --model as #<variant> instead of --variant. A version probe (opencode --version) could keep 1.x working.

Source: EveryInc/compound-engineering-plugin