Skip to content

fix(opencode): Accept nested provider model paths - #90

Merged
4ndreello merged 1 commit into
mainfrom
fix/opencode-nested-model-path
Sep 19, 2026
Merged

4ndreello merged 1 commit into
mainfrom
fix/opencode-nested-model-path

Conversation

@4ndreello

Copy link
Copy Markdown
Owner

Opening a session on a provider model with more than two path segments failed before spawn. Three sessions died on this yesterday with the same error:

Model "openrouter/meta/muse-spark-1.3-contributor" must be provider/model for opencode (e.g. anthropic/claude-sonnet-4-6).

MODEL_SHAPE in buildArgs only accepted provider/model, and it is the only gate in src/ producing that message. It now accepts extra slash-separated segments, while still rejecting empty segments (a//b, a/b/, /a), whitespace, and names with no slash at all.

The opencode catalog preflight is not part of this. It warns and continues instead of gating the launch, so it never blocked these sessions.

On coverage: the existing rejection list already pinned the bare name, whitespace, leading slash and trailing slash cases. The empty middle segment was missing, and so was anything that pinned the end anchor once nesting is allowed. Both gaps are closed here, and both were confirmed by injecting the corresponding regression and watching a named test fail.

buildArgs rejected any model carrying more than two segments, so opening a
session on openrouter/meta/muse-spark-1.3-contributor died before spawn
with "must be provider/model". Allow extra slash-separated segments, and
keep rejecting empty segments, whitespace and names with no slash at all.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@4ndreello
4ndreello merged commit 35ed435 into main Sep 19, 2026
4 checks passed
@4ndreello
4ndreello deleted the fix/opencode-nested-model-path branch September 19, 2026 16:03
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