Skip to content

feat(opencode): dispatch recipes + model flag#157

Open
slowdini wants to merge 1 commit into
devfrom
feat/opencode-dispatch-recipes
Open

feat(opencode): dispatch recipes + model flag#157
slowdini wants to merge 1 commit into
devfrom
feat/opencode-dispatch-recipes

Conversation

@slowdini

Copy link
Copy Markdown
Owner

User-facing change

run --harness opencode now generates copy-pasteable dispatch recipes everywhere the codex/claude harnesses already did: RUNBOOK.md, dispatch-manifest.md, the post-run next steps, and the post-ingest judge handoff all carry opencode run --dir <eval-root> --format json --auto commands (including the shared jq/xargs parallel and judge variants). --agent-model / --judge-model now actually select models via -m instead of being recorded as provenance only.

Before:

Next: iterate the tasks[] array in dispatch.json and dispatch each task with `opencode run --format json`, saving stdout as the task's outputs/opencode-events.jsonl (copy-pasteable recipes are not yet wired). Model selection was recorded as provenance, but the OpenCode adapter has no CLI model flag wired yet. Then run `ingest …`.

After:

Next: iterate the tasks[] array in dispatch.json and dispatch each task with:
opencode run --dir <eval-root> --format json --auto -m opencode/claude-haiku-4-5 \
  "Read the file at <dispatch_prompt_path> and follow its instructions exactly. When you finish, make your final response your closing summary." \
  </dev/null \
  > <outputs_dir>/opencode-events.jsonl \
  2> <outputs_dir>/opencode-stderr.log
Then run `ingest …`.

What changed

  • harnesses/opencode.toml: full [dispatch] block (exec_template, parallel_command_template, judge_command_template, next_steps_template, manifest_template, capture_prefix = "opencode") plus [model] flag = "-m" — landed together because descriptor validation ties the judge template's $model_arg to a declared model flag. No schema changes (all fields pre-existing). No {guard_args} references — the guard stays with feat(opencode): write guard via project plugin (opencode-plugin engine) #155.
  • Golden fixtures: re-blessed runbook/manifest/next-steps; new opencode/judge-recipe.golden.md (opencode added to the judge golden sweep).
  • Tests: flipped the has_dispatch_recipes pin; the dispatchless and modelflag-less preflight-warning pins moved from opencode to a BYOH user descriptor (every built-in now wires both); new unit pin for the exec recipe's --dir/--auto/-m splicing; new run_writes_headless_runbook_for_opencode integration test; deleted opencode_run_warns_missing_dispatch_recipe.
  • Docs: README support table flips Dispatch recipes and Model flag to ✅ and footnote ¹ is removed; docs/opencode-notes.md records the verified CLI facts (v1.18.3) including the --auto/explicit-deny interaction; src/cli/help.rs drops the stale "assemble records manually" OpenCode example (leftover from before feat(opencode): transcript ingest via the opencode-events parser #156).

Verification

  • cargo test — 479 lib + 99 cli + 81 run, 0 failures
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • eval-magic harness lint opencode — all checks passed
  • Live (opencode v1.18.3, scratch env): one opencode run per the recipe exited 0; the events file shows the staged skill discovered and invoked under its staged slug via the native skill tool; eval-magic ingest assembled run.json (3 invocations) + timing.json (tokens/duration from the transcript) and the __skill_invoked meta-check passed via transcript_check; -m definitely/bogus-model exits 1 (flag plumbed). An operator-level edit: deny rule stayed enforced under --auto and blocked final-message.md — record-runs fell back to the transcript's final text, as designed (noted in opencode-notes.md).

Closes #153

Wire the two #153 enhancements together (descriptor validation ties the
judge template's $model_arg to a declared model flag): a [dispatch] block
(exec/parallel/judge/next-steps/manifest templates,
capture_prefix = "opencode") plus [model] flag = "-m", so RUNBOOK.md,
dispatch-manifest.md, and the post-run/post-ingest handoffs carry
copy-pasteable opencode run recipes and --agent-model/--judge-model
actually select models instead of recording provenance only.

- Recipes run `opencode run --dir <eval-root> --format json --auto` with
  stdin detached (piped stdin is appended to the message) and JSONL/stderr
  captures; there is no --output-last-message, so the final message comes
  from the text events via transcript ingest. CLI facts verified against
  opencode v1.18.3.
- Golden fixtures re-blessed (runbook/manifest/next-steps) plus a new
  opencode judge-recipe golden; the dispatchless and modelflag-less
  preflight-warning pins move from opencode to a BYOH user descriptor
  (every built-in now wires both).
- README support table flips Dispatch recipes and Model flag to ✅
  (footnote ¹ removed); opencode-notes.md records the verified CLI facts;
  help.rs drops the stale "assemble records manually" OpenCode example.
- Live-verified: one opencode run per the recipe discovers and invokes the
  staged skill (skill tool event under the staged slug), the events file
  ingests to a full run record, and a bogus -m fails (the flag is
  plumbed). Operator edit:deny rules stay enforced under --auto;
  record-runs then falls back to the transcript's final text.

Closes #153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(opencode): dispatch recipes + model flag

1 participant