You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
commands: unresolvable model in frontmatter silently drops the command #52065
A command .md whose frontmatter carries a model: value that doesn't resolve — e.g. a bare name like opus instead of provider/model — is silently dropped. It never appears in / autocomplete and nothing is logged (no warning at INFO or DEBUG in opencode.log). This bites anyone porting commands from tools that use bare model shorthand: 17 ported commands here, zero appeared, zero feedback. For contrast, other unrecognized frontmatter keys (e.g. effort: high) are silently ignored — only model kills the whole command.
Suggestion: fall back to the session/default model and log a warning naming the file and the rejected value.
Plugins — none
OpenCode version — v2.0.19 (latest channel)
Steps to reproduce
mkdir -p .opencode/commands
Create .opencode/commands/hello.md:
---description: says hellomodel: opus---
Say hello: $ARGUMENTS
Type / in the TUI (or GET /api/command?location[directory]=<project>) — hello is absent.
Change model: opus to a valid ref (or delete the line) — the command appears immediately, no restart.
Expected: the command loads (ignoring the bad model), or at least a logged warning.
Actual: silent drop; 100% reproducible. (Verified along the way: symlinked command files load fine — the drop is purely the model validation.)
This issue: commands on the native path — a bare unresolvable model: value (opus, not provider/model) drops the whole command from autocomplete, with nothing logged at INFO or DEBUG. No legacy keys involved; the repro frontmatter is just description + model.
Different artifact, different code path, different blast radius — keeping this open for the command case.
Thanks for the clear report. I could reproduce this on v2.0.19, and it still happens on the latest dev (86ce19d).
Setup: two otherwise identical project commands in .opencode/commands/. hello-bad.md has model: opus in its frontmatter and hello-ok.md has no model line. Typing /hello in the TUI lists only /hello-ok. The recording and screenshots below show this, and the script below reproduces it.
The cause seems to be that the command loader checks all the frontmatter at once. When the model value isn't a provider/model reference, the whole file fails and is skipped without a log message. Until this is changed, using a full provider/model value or removing the model: line works around it.
// Repro for #52065: a command whose frontmatter `model:` is not provider/model// (e.g. `model: opus`) is silently missing from `/` autocomplete.import{Effect}from"effect"import{OpenCodeDriver}from"opencode-drive"exportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),tui: {recording: true,keypressOverlay: true},project: {git: true,files: {// Same command, but with a bare model name: expected to load, is dropped.".opencode/commands/hello-bad.md":
"---\ndescription: says hello (model: opus)\nmodel: opus\n---\n\nSay hello: $ARGUMENTS\n",// Control: identical command without the model line: loads fine.".opencode/commands/hello-ok.md":
"---\ndescription: says hello (no model)\n---\n\nSay hello: $ARGUMENTS\n",},},},({ ui })=>Effect.gen(function*(){yield*Effect.sleep(1500)yield*ui.type("/hello")yield*ui.waitFor("says hello (no model)")yield*Effect.sleep(1500)constframe=yield*ui.capture()consttext=JSON.stringify(frame)yield*ui.screenshot("autocomplete")constbad=text.includes("hello-bad")yield*Effect.log(`hello-ok listed: ${text.includes("hello-ok")}; hello-bad listed: ${bad}`)if(!bad)yield*Effect.log("REPRODUCED: command with `model: opus` is missing from / autocomplete")}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
Activity
github-actions commentedon Sep 29, 2026
This issue might be a duplicate of existing issues. Please check:
51smith commentedon Sep 29, 2026
Checked #50849 — same symptom family (silent model-frontmatter drop), but a distinct failure mode:
permission:) route through the migration path, where a validprovider/model#variantref is discarded — the agent still loads, it just inherits the parent's model (fix in fix(core): parse embedded "#variant" in model selections #50853).model:value (opus, notprovider/model) drops the whole command from autocomplete, with nothing logged at INFO or DEBUG. No legacy keys involved; the repro frontmatter is justdescription+model.Different artifact, different code path, different blast radius — keeping this open for the command case.
opencodejr commentedon Oct 28, 2026
Thanks for the clear report. I could reproduce this on v2.0.19, and it still happens on the latest
dev(86ce19d).Setup: two otherwise identical project commands in
.opencode/commands/.hello-bad.mdhasmodel: opusin its frontmatter andhello-ok.mdhas nomodelline. Typing/helloin the TUI lists only/hello-ok. The recording and screenshots below show this, and the script below reproduces it.The cause seems to be that the command loader checks all the frontmatter at once. When the
modelvalue isn't aprovider/modelreference, the whole file fails and is skipped without a log message. Until this is changed, using a fullprovider/modelvalue or removing themodel:line works around it.Related:
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.