refactor(providers): dedupe identical opencode-zen/opencode-go model entries - #11051
Conversation
…entries kimi-k2.7-code, qwen3.5-plus and qwen3.6-plus were declared byte-identical in both registries. Extract them into OPENCODE_ZEN_GO_SHARED_MODELS (mirrors the existing GLM_SHARED_MODELS pattern in glmProvider.ts) so a future metadata fix only has to land in one file instead of drifting out of sync across the two registries, as happened with the muse-spark targetFormat bug (diegosouzapw#10874/diegosouzapw#11048).
|
Nice, clean refactor — this matches the GLM_SHARED_MODELS pattern exactly and the regression test is a good guard. I verified locally that no model is lost: the model-id set for both providers is identical before/after, check:provider-consistency still passes (267/0), and the existing #8353 effort-alias test still passes 38/38. Two optional notes (non-blocking):
No blocking changes — happy to merge as-is. |
c977536
into
diegosouzapw:release/v3.8.50
|
Thanks — addressed in follow-up PR #11133. Default-model nit: confirmed on Golden-list nit: instead of freezing the full model-id catalog (which Also folded in the #11049 overlay comment (zen |
…erlay (#11051/#11049) (#11133) Validated on the combined batch board over release/v3.8.50 tip d91238b: static gates clean, typecheck:core clean, focused tests green. Restores the models[0] dashboard default silently changed by #11051, with narrow guards instead of a brittle full snapshot. Thank you @maxmad64bis!
…entries (diegosouzapw#11051) ⭐5 — Dedupe dos 3 entries byte-idênticos (kimi-k2.7-code, qwen3.5-plus, qwen3.6-plus) entre opencode-zen e opencode-go via OPENCODE_ZEN_GO_SHARED_MODELS (padrão GLM_SHARED_MODELS), frozen e testado por deep-equal. Pure move, sem mudança de comportamento; check:provider-consistency OK (267 entries, 348 providers). TDD 3/3. Follow-up de diegosouzapw#11049/diegosouzapw#11048. Base-red diegosouzapw#9985 inherited.
…erlay (diegosouzapw#11051/diegosouzapw#11049) (diegosouzapw#11133) Validated on the combined batch board over release/v3.8.50 tip 0f43f0f: static gates clean, typecheck:core clean, focused tests green. Restores the models[0] dashboard default silently changed by diegosouzapw#11051, with narrow guards instead of a brittle full snapshot. Thank you @maxmad64bis!
Summary
opencode-zenandopencode-goare two separate registry entries for the same upstream family (opencode.ai/zen/*), and three models were declared byte-for-byte identically in both:kimi-k2.7-code,qwen3.5-plus,qwen3.6-plus. Copy-pasted metadata like this is exactly how #10874 missedopencode-zen/opencode-gowhen it fixed Muse Spark'stargetFormatonly on the baseopencodeprovider.Extracted the three identical entries into
OPENCODE_ZEN_GO_SHARED_MODELS, following the same pattern already used forGLM_SHARED_MODELSinopen-sse/config/glmProvider.ts(shared across theglm/glm-t/glm-cnregistries). Bothopencode-zenandopencode-gonow spread this array instead of repeating the entries inline. A future metadata fix (routing, reasoning flags, etc.) for any of these three models only needs to land in one file.Scope is intentionally narrow: only entries that were already byte-identical across both files were moved. Models with tier-specific flags (e.g.
opencode-go's effort-tier variants, or fields only one side declares) were left untouched — merging those would be a silent behavior change, not a dedupe.command-codeandfreebuffalso list similarly-named models but are different upstream/executor pairs entirely — not touched here.Related Issues
Validation
open-sse/config/providers/registry/opencode/{zen,go}/index.ts,open-sse/config/opencodeZenGoSharedModels.ts)node --import tsx/esm --test tests/unit/opencode-zen-go-shared-models.test.ts— 3/3npm run typecheck:core— cleannpm run check:cycles— no cyclesnpm run check:provider-consistency— OK, 267 registry entries, 348 canonical providers, 0 exceptionsrelease/v3.8.50tipTests Added Or Updated
tests/unit/opencode-zen-go-shared-models.test.ts:OPENCODE_ZEN_GO_SHARED_MODELSentry is present exactly once, unmodified, inopencode-zenOPENCODE_ZEN_GO_SHARED_MODELSentry is present exactly once, unmodified, inopencode-goCoverage Notes
Registry data only — no logic changes. Covered by the new test plus the full existing suites for both registries and
check:provider-consistency.Reviewer Notes
Pure move, no behavior change: same 3 model ids, same field values, same position in each registry's live catalog. The
check:provider-consistencygate (267 registry entries, 348 canonical providers, 0 exceptions) and the deep-equal assertions in the new test are what actually prove nothing drifted during the extraction.