Skip to content

fix: pin and verify OpenCode worker models - #8

Closed
kesslerio wants to merge 9 commits into
mainfrom
fm/opencode-launcher-fix
Closed

kesslerio wants to merge 9 commits into
mainfrom
fm/opencode-launcher-fix

Conversation

@kesslerio

@kesslerio kesslerio commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

What Changed

  • Detect OpenCode’s advertised model-selection mechanism and use either its top-level --model flag or a task-owned worktree config pin; refuse model-pinned launches when selection cannot be verified or a project-owned config conflicts.
  • Verify the model from the worker’s first assistant message and retire task-owned pins during cleanup; document model and effort selection behavior.

Risk Assessment

⚠️ Medium: No new actionable defects were substantiated, but version-dependent OpenCode integration retains uncertainty from the previously accepted inconclusive live validation.

Testing

The focused OpenCode model tests exercised model pinning, effort selection, refusal paths, and cleanup behavior, but did not establish live product results. Dispatch-profile validation stopped when its restricted worker PATH could not find sed. The live guard found OpenCode 1.19.4 but could not select a model because this installed build rejects the guard’s models --standalone invocation; no live model launch or visual evidence was produced.

  • Live validation: ⚠️ inconclusive - 0 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Request a supported OpenCode model and effort; the launcher selects and verifies the requested model ⏸️ untested no The prior payload records only a focused test command, not a run against the live product. Live validation requires a compatible installed OpenCode build and a successful real model launch; the payloa…
Request an unsupported inline model variant; the launcher refuses it instead of overriding --effort ⏸️ untested no The prior payload records only a focused test command, not a run against the live product. Live validation requires driving the real launcher with the unsupported model variant; the payload provides n…
Launch OpenCode against the installed build and confirm the observed session model matches the pin ⏸️ untested no The live guard resolved OpenCode 1.19.4, but its opencode models --standalone catalog query is unsupported by this installed CLI, so it found no selectable model and did not launch. The direct CLI c…
Run OpenCode dispatch through the worker environment and observe the expected dispatch behavior ⏸️ untested no The targeted test stopped in an inherited worker-environment case because its restricted PATH did not include sed; dispatch scenarios were not reached. Making sed available in the fixture’s worker…
  • Outcome: ⚠️ 1 warning across 1 run (3m9s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (0 of 4 scenarios were driven live against the product); untested: Request a supported OpenCode model and effort; the launcher selects and verifies the requested model, Request an unsupported inline model variant; the launcher refuses it instead of overriding --effort, Launch OpenCode against the installed build and confirm the observed session model matches the pin, Run OpenCode dispatch through the worker environment and observe the expected dispatch behavior
  • Live validation: ⚠️ inconclusive - 0 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Request a supported OpenCode model and effort; the launcher selects and verifies the requested model ⏸️ untested no The prior payload records only a focused test command, not a run against the live product. Live validation requires a compatible installed OpenCode build and a successful real model launch; the payloa…
Request an unsupported inline model variant; the launcher refuses it instead of overriding --effort ⏸️ untested no The prior payload records only a focused test command, not a run against the live product. Live validation requires driving the real launcher with the unsupported model variant; the payload provides n…
Launch OpenCode against the installed build and confirm the observed session model matches the pin ⏸️ untested no The live guard resolved OpenCode 1.19.4, but its opencode models --standalone catalog query is unsupported by this installed CLI, so it found no selectable model and did not launch. The direct CLI c…
Run OpenCode dispatch through the worker environment and observe the expected dispatch behavior ⏸️ untested no The targeted test stopped in an inherited worker-environment case because its restricted PATH did not include sed; dispatch scenarios were not reached. Making sed available in the fixture’s worker…
  • bash tests/fm-spawn-opencode-model.test.sh
  • bash tests/fm-spawn-dispatch-profile.test.sh
  • opencode --version and opencode models --standalone
  • FM_OPENCODE_MODEL_LIVE=1 bash tests/fm-opencode-model-live-e2e.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kesslerio
kesslerio force-pushed the fm/opencode-launcher-fix branch from 063afc4 to 3133924 Compare October 25, 2026 14:55
@kesslerio
kesslerio force-pushed the fm/opencode-launcher-fix branch from 3133924 to 4ee8ddb Compare October 25, 2026 15:00
@kesslerio kesslerio changed the title fix(spawn): select the OpenCode model the installed build actually accepts fix(opencode): pin and verify requested worker models Oct 25, 2026
The two-second checkpoint budget INT-kills the watcher before its first
poll completes fm-herdr-groups.sh sync under load, producing intermittent
serial-shard failures. Validated 2/2 loaded runs at 12s.
@kesslerio kesslerio changed the title fix(opencode): pin and verify requested worker models fix: pin and verify OpenCode worker models Oct 29, 2026
@kesslerio

Copy link
Copy Markdown
Owner Author

Closing as pre-upstream holding PR: the work (OpenCode model-selection detection, pin+verify for worker models) is preserved on branch fm/opencode-launcher-fix pending an upstream carve-out. Tracked in the fork carve-out tracker issue.

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.

1 participant