OpenCode review peers treat the prompt as an attachment and exit before review

Author: metalingusmanCreated Sep 16, 2026Updated Sep 16, 2026

With OpenCode 1.18.30, the OpenCode routes in ce-code-review and ce-doc-review fail before the model reviews anything:

Error: File not found: Follow the attached brief. Return only schema-shaped JSON.

Reproduced on macOS with plugin 3.26.3 and upstream main at 082c83e0537c803ac1d927daafc2e6eb6962dedf.

Reproduction

Create a text file named brief.txt, then run the same argument ordering emitted by the adapters:

bash
opencode run --format json --file brief.txt "Follow the attached brief. Return only schema-shaped JSON."

OpenCode declares --file as an array option. It consumes the following positional message as a second attachment and fails when that filename does not exist. Selecting an OpenRouter model and reasoning variant does not prevent the failure.

Expected: attach the brief, submit the message, and return a review. Actual: the CLI reports the missing filename; the plugin logs that the peer produced no usable schema-shaped output and produces no normalized review artifact.

Proposed fix

Put the positional message before --file in both review adapters:

bash
opencode run --format json "Follow the attached brief. Return only schema-shaped JSON." --file brief.txt

The change preserves model/variant flags, workspace selection, JSON output, and existing read-only restrictions.

Verification

  • The original launcher reproduced the exact filename error on a synthetic code fixture.
  • Six regression cases fail before the patch and pass after it: default, pinned model, and pinned model plus effort for both adapters.
  • All 182 tests in the two review-route suites pass.
  • Live patched code and document reviews through OpenCode/OpenRouter produced normalized JSON artifacts and detected the planted pagination error and contradictory document requirements.
  • Full suite: 4,140 passed, 1 skipped, 0 failed with the catalog fixture commit fetched and synthetic Git configuration isolated from personal signing settings.
  • Release metadata and strict marketplace/plugin validation pass using CI's pinned Claude Code 2.1.220.

The OpenCode route still reports actual serving model and effort as unverified; this patch does not change identity receipts or permissions.

Source: EveryInc/compound-engineering-plugin