the OpenCode orchestrator-worktree argv carries no --model, so worktree executors run on the session model #5260
Description
Activity
- addedneeds-triageNew issue awaiting maintainer reviewNew issue awaiting maintainer review
on Oct 8, 2026 This was generated by AI during triage.
Diagnosis
Reproduced: yes — runtime opencode,
model_overrides["gsd-executor"]="openai/gpt-5-mini",query dispatch-isolation --json --cwd-target /tmp/wt --prompt helloreturns exec.args["run","--dir","/tmp/wt","hello"]; no--model.opencode run --helpand opencode.ai/docs/cli confirm-m, --model(provider/model) is a supportedrunflag.
Root cause: the OpenCodeorchestratorExecdescriptor declares nomodelFlag, incapabilities/opencode/capability.json:111-118(generated intogsd-core/bin/lib/capability-registry.cjs:3002and:7278);gsd-core/bin/gsd-tools.cjs:2668(resolveDispatchIsolationDecision) skips model-pin resolution entirely when nomodelFlagis declared, andsrc/host-integration.cts:962(resolveOrchestratorExec) appends the flag only when the descriptor has one. Codex is the only descriptor withmodelFlag(capabilities/codex/capability.json:105, #3714). Secondary:resolveDispatchModelPin(gsd-tools.cjs:2546-2560) drops any value containing "claude" with a Codex-worded warning, which would still dropanthropic/claude-*pins on OpenCode after the descriptor fix.
Introduced by: long-standing (OpenCode orchestratorExec added 4a66d62, 2026-07-24, #2625; Codex modelFlag a3d5841, 2026-08-26)
Blast radius: Low-Medium — descriptor + generated registry + capability matrix doc; shared pin policy inresolveDispatchModelPinalso serves Codex.
Coupled (must not miss): #5259 (same OpenCode dispatch path);gsd-tools.cjsdeclaresModelFlaggate and its warning text; regenerate registry;tests/host-integration-descriptors.test.cjs,tests/model-resolver.test.cjs; changeset. CodeGraph/Memtrace/Cortex checks did not run this pass (bounded grep used); no recorded decision found in ADR-1239 or the capability matrix.
Regression test: with runtime opencode and agsd-executorpin,dispatch-isolation --json --cwd-target <wt> --prompt <p>exec.args contain--model <pin>with the prompt last; unpinned/inheritargv unchanged; leading-dash pin dropped without exec:null; ananthropic/claude-*pin is delivered on OpenCode but still dropped on Codex.Agent Brief
Category: bug
Summary: OpenCode worktree executors ignore thegsd-executormodel override because the dispatch argv never carries a model flag.
Current behavior: With amodel_overridesentry forgsd-executoron the OpenCode runtime, the orchestrator-worktree exec argv fromquery dispatch-isolationisrun --dir <wt> <prompt>; the spawned process runs on the session/config model. Aclaude-containing pin would additionally be discarded by the shared pin policy with a Codex-worded warning.
Desired behavior: When an explicit, validgsd-executorpin exists, the OpenCode argv carries--model <provider/model>(OpenCode's documentedrunflag) ahead of the prompt; with no pin,inherit, or an invalid value, the argv is unchanged and never fatal.
Key interfaces:query dispatch-isolation --json --cwd-target --prompt; the runtime descriptor'sorchestratorExecmodel-flag axis; the dispatch model-pin policy; the generated capability registry.
Acceptance criteria: pinned OpenCode run yields--model <pin>before the prompt, prompt last; unpinned/inherit/leading-dash pins leave argv as today; an Anthropic-flavored provider/model pin is honored on OpenCode and still dropped on Codex; Codex and kimi argv unchanged; registry regenerated; capability matrix doc updated.
Out of scope: profile/tier-derived models reaching argv; Codex passive-model posture;--agentselection; kimi/kimi-code.- addedbugSomething isn't workingSomething isn't workingconfirmed-bugVerified reproducible bugVerified reproducible bugand removedneeds-triageNew issue awaiting maintainer reviewNew issue awaiting maintainer review
on Oct 9, 2026
--opencode --global), OpenCode 1.18.35, LinuxSummary
capability-registry.cjsdescribes the OpenCode orchestrator-worktree executor as"command": "opencode", "args": ["run"](two blocks).opencode run --dir <wt> <prompt>without--modeluses the configmodel, the brain model, and--agentcannot select a subagent-modeagent such as
gsd-executor. Themodel_overridesentry forgsd-executoris baked into the agentfile, which the spawned process never loads as its agent. Parallel-wave executors therefore lose
their per-role model on OpenCode.
Minimal repro
{"model_overrides": {"gsd-executor": "<provider>/<cheap-model>"}}in~/.gsd/defaults.json,then
npx @opengsd/gsd-core@1.16.0 --opencode --global.gsd-tools query dispatch-isolation --jsonin a project: the exec argv is["run", "--dir", "<wt>", "<prompt>"], with no model.Expected
The orchestrator-worktree argv carries
--model <resolved gsd-executor model>whenever an overrideexists for the executor role.
Actual
No model flag; the process runs on the session model.
Suggested fix
Give the OpenCode runtime descriptor a model flag and resolve the executor's model into the argv at
dispatch time, the same way
Task()model parameters are resolved on Claude Code (#2256).Cowright workaround
scripts/patches/registry-model.cjsinserts"--model", "<hands>"after"run"in both blocks afterevery install; check C06 verifies the argv. Not exercised live yet, because no worktree dispatch
happened in the smoke (U-06).
Evidence
docs/smoke/runs/2026-10-07/mechanical-final.json(C06)scripts/patches/registry-model.cjsheader