happier icon indicating copy to clipboard operation
happier copied to clipboard

Happier 0.2.12, OpenCode 1.18.25, server mode. opencode models lists 374 models, 367 of them openrouter/<vendor>/<model>. The OpenCode model picker shows only the 7 opencode/* Zen models.

Open thomashillman opened this issue 2 months ago • 2 comments

Summary

Happier 0.2.12, OpenCode 1.18.25, server mode. opencode models lists 374 models, 367 of them openrouter//. The OpenCode model picker shows only the 7 opencode/* Zen models.

Cause: isOpenCodeVerboseModelIdLine in apps/cli/src/backends/opencode/preflight/openCodePreflightModelsProbeAdapter.ts uses /^[a-z0-9.:-]+/[a-z0-9.:-]+$/i, which allows only one / and no ~. Nested OpenRouter IDs are skipped silently, even when their verbose record is active with toolcall: true. The Zen models still parse, so probeModelsRaw is non-empty and the plain opencode models fallback (cliModelsCommandArgs) never runs. The partial list is cached as a successful dynamic probe.

Repro: run the adapter's parseOpenCodeModelsVerboseOutput on opencode models --verbose output with OpenRouter configured. It returns 0 openrouter/* entries.

Suggested fix: accept multi-segment IDs (check them against providerID + "/" + record.id), merge the plain and verbose inventories or detect partial parses, and add regression tests for openrouter/deepseek/deepseek-v4-flash-0731, openrouter/~anthropic/claude-opus-latest and a two-part Zen ID.

What happened (current behavior)

No response

Expected behavior

No response

Reproduction steps

No response

Severity

None

Frequency

None

Happier version

No response

Platform

No response

Server version

No response

Deployment type

None

What changed recently?

No response

Diagnostics ID

No response

Additional context

No response

thomashillman avatar Sep 12 '26 19:09 thomashillman

Thanks for the precise report. Confirmed: the verbose OpenCode model parser only accepted IDs containing exactly one slash, so nested OpenRouter IDs were silently omitted and the resulting Zen-only inventory could be cached as a successful dynamic probe.

The source fix has now landed on dev in 15bcaa176a. It reuses the canonical OpenCode model-ID parser, accepts nested IDs including openrouter/~anthropic/..., validates each verbose header against its record identity, and rejects malformed partial verbose output so the existing plain-output fallback can run. Regression coverage includes nested OpenRouter IDs, ~ IDs, identity mismatches, and cache behavior.

The same intent has also been applied to the 0.3 development line. This is currently a source-stage fix; it is not yet a released-version claim.

happier-bot avatar Sep 13 '26 07:09 happier-bot

Thanks for the nested model-ID examples. CLI 0.2.16 recognizes OpenCode model IDs containing multiple slashes or a leading tilde, so those OpenRouter models appear in the picker.

Please reply or reopen with your component versions if this still happens after updating.

Posted on behalf of @leeroybrun.

happier-bot avatar Oct 11 '26 12:10 happier-bot