feat: add OpenCode as alternative batch review runner#504
feat: add OpenCode as alternative batch review runner#504milimat0810 wants to merge 1 commit intopeteromallet:mainfrom
Conversation
Add --runner opencode support to desloppify review --run-batches, enabling OpenCode subprocess execution as an alternative to Codex. - Add runner_process.py with run_opencode_batch implementation - Wire runner dispatch in orchestrator.py based on args.runner - Add opencode CLI argument parsing and validation - Update runner failures and IO handling for opencode format - Add OPENCODE.md documentation - Update test cases for opencode runner
|
Hey @milimat0810 — thanks for putting this together! OpenCode as an alternative runner is a feature we genuinely want, and you clearly put real work into this (the NDJSON stream parser, retry/stall handling, warm-server attach, and 1500 lines of new tests are all solid). The core logic is sound. That said, the implementation needs some rework before we can merge it. Here's what we'd need changed: 1. Remove the re-export wrapper shim in runner_process.pyThe ~50 lines of codex function delegation ( 2. Fix the dead
|
Problem
The batch review pipeline (
desloppify review --run-batches) only supports Codex as a runner. There is no way to use OpenCode as the execution engine, even though the infrastructure (NDJSON stream parsing, subprocess management, retry/stall detection) is largely runner-agnostic.Fix
Add
--runner opencodesupport to the batch review pipeline. When selected, batches are executed viaopencode run --format jsonsubprocesses instead of Codex, with results extracted from the NDJSON stream and merged through the same trusted-import pipeline.Changes
runner_process.py(new):run_opencode_batchimplementation — builds OpenCode CLI invocations, supports warm-server attach viaDESLOPPIFY_OPENCODE_ATTACH, handles NDJSON result extractionorchestrator.py: wire runner dispatch —_build_batch_run_depsnow selectsrun_opencode_batchorrun_codex_batchbased onargs.runner--runnerargument withcodex/opencodechoicesscope.py:validate_runner()accepts both runner names,SUPPORTED_BLIND_REVIEW_RUNNERSupdatedrunner_process_impl/io.py: add_extract_text_from_opencode_json_stream()for NDJSON parsingrunner_process_impl/attempts.py,types.py,attempt_success.py: extend subprocess handling to support OpenCode process lifecyclerunner_failures.py: classify OpenCode-specific failure modesimporting/policy.py: allow OpenCode runner in blind review import policypacket/build.py,prepare.py,helpers.py: minor adjustments for runner-agnostic packet preparationdocs/OPENCODE.md: usage documentation covering basic and warm-server modesreview_commands_cases.py,test_runner_internals.py,review_commands_runner_cases.py, and batch split/guard testsUsage
Optional warm-server mode to avoid MCP cold-start overhead:
Verification
pytest desloppify/tests/review/test_runner_internals.py -qpytest desloppify/tests/review/review_commands_cases.py -qpytest desloppify/tests/review/review_commands_runner_cases.py -qpytest desloppify/tests/commands/review/test_review_process_guards_direct.py -qpytest desloppify/tests/commands/review/test_review_runner_batch_split_direct.py -q