fix: resolve 1M context for opencode-free and muse-spark family - #101905
Steve-prog001 wants to merge 1 commit into
Conversation
- Map opencode-free to the opencode-go models.dev catalog: opencode /models omits context metadata for all 66 models and opencode-free had no models.dev alias, so every model on that route survived only via the hardcoded catalog and muse-spark fell to the 256K fallback. - Add muse-spark=1048576 to DEFAULT_CONTEXT_LENGTHS (Meta docs: Standard and Contributor tiers share the 1,048,576 window; missing from models.dev under every provider id). - Route commandcode/commandcode-anthropic through the live /models endpoint, which reports authoritative context_length (e.g. 1048576) but was skipped as a known provider.
…in Muse Spark 1M invariant opencode-free had no PROVIDER_TO_MODELS_DEV entry, so every models.dev lookup on the free tier missed and Muse Spark fell to the 256K default. The free tier is served by the Zen relay (hermes_cli/models.py: "opencode-free is Zen-hosted"), and models.dev's "opencode" provider is the catalog that lists muse-spark-1.2 / -1.2-contributor-free / -1.3-contributor-free at 1,048,576 — so the alias is "opencode", not "opencode-go" (Go's catalog carries only the paid -contributor SKUs). Missing alias identified by @Steve-prog001 in #101905. Tests: one parametrized offline invariant (models.dev + live /models mocked away) asserting 1,048,576 on opencode-free / opencode-go / meta-ai / commandcode — fails on main, passes here — plus the alias pin.
|
Closing in favor of #101949 (commit 0b96eaf), which landed the same |
|
Hi @teknium1 — thanks for salvaging this into #101949 and for the clear explanation of why Same small follow-up as on #101588: since the merge was a rebase-merge, my commits don't surface in the repo's contributor aggregation (known GitHub gap for rebased commits). Could you add my mapping under
That would complete the attribution in the repo's own records. Thanks again! |
…in Muse Spark 1M invariant opencode-free had no PROVIDER_TO_MODELS_DEV entry, so every models.dev lookup on the free tier missed and Muse Spark fell to the 256K default. The free tier is served by the Zen relay (hermes_cli/models.py: "opencode-free is Zen-hosted"), and models.dev's "opencode" provider is the catalog that lists muse-spark-1.2 / -1.2-contributor-free / -1.3-contributor-free at 1,048,576 — so the alias is "opencode", not "opencode-go" (Go's catalog carries only the paid -contributor SKUs). Missing alias identified by @Steve-prog001 in NousResearch#101905. Tests: one parametrized offline invariant (models.dev + live /models mocked away) asserting 1,048,576 on opencode-free / opencode-go / meta-ai / commandcode — fails on main, passes here — plus the alias pin.
Summary
opencode-freeto theopencode-gomodels.dev catalog. The opencode/modelsendpoint omits context metadata for all 66 models andopencode-freehad no models.dev alias, so every model on that route survived only via the hardcoded catalog and muse-spark fell through to the 256K fallback.muse-spark=1048576toDEFAULT_CONTEXT_LENGTHS(Meta docs: Standard and Contributor tiers share the 1,048,576-token window; verified 2026-09-03; missing from models.dev under every provider id and opencode exposes no metadata to probe).commandcode/commandcode-anthropicthrough the live/modelsendpoint, which reports authoritativecontext_length(e.g. 1048576) but was skipped as a known provider.Test plan
get_model_context_lengthnow returns 1048576 formuse-spark-1.3-contributor-free/muse-spark-1.2onopencode-freeandmeta/muse-spark-1.3-contributoron commandcode (was 256000); spot-checked qwen/deepseek/claude/gpt on opencode-free unchanged (provider-catalog values).tests/agent/test_model_metadata.py,test_models_dev.py,test_models_dev_meta_mapping.py: 185 passed.tests/agent/test_opencode_free_mapping.py: 3 passed (with meta-mapping test file).Note
qwen3.6-pluson opencode-free now resolves via the provider catalog (1000000) instead of the DashScope hardcoded value (1048576); provider-specific catalog wins by design (safe direction).