refactor(model): remove hand-maintained model injection now covered by models.dev - #171
Conversation
…y models.dev GLM-5.2 and Qwen3.8-Max-Preview are now published on models.dev, so the additionalModels merge-injection (glm52Model, qwen38MaxPreviewModel, applyAdditionalModels) is no longer needed. The Alibaba Token Plan static providers are likewise removed since models.dev now carries them via registry_generated.go.
📝 WalkthroughWalkthroughThe model registry no longer creates or merges hand-maintained additional models during initialization. Alibaba token-plan provider entries were removed, and the related recommended-model comment was updated. ChangesModel registry cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/model/registry.go (1)
507-517: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winConfirm generated registry contains the deleted static data.
registry_generated.gonow contains nointernal/modelgenerated file, so removingapplyAdditionalModels()and the Alibaba Token Plan static stubs removeszhipuai/zaiglm-5.2coverage and theqwen3.8-max-previewentries entirely. Add the equivalent generated registry data or restore the static override before merging.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/model/registry.go` around lines 507 - 517, Update the registry initialization around init and staticProviders to preserve the deleted Alibaba Token Plan coverage: ensure the generated registry includes zhipuai and zai glm-5.2 entries plus the qwen3.8-max-preview entries, or restore the corresponding static override logic. Verify these models remain available through the same generated provider and model registries after removing applyAdditionalModels().Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@internal/model/registry.go`:
- Around line 507-517: Update the registry initialization around init and
staticProviders to preserve the deleted Alibaba Token Plan coverage: ensure the
generated registry includes zhipuai and zai glm-5.2 entries plus the
qwen3.8-max-preview entries, or restore the corresponding static override logic.
Verify these models remain available through the same generated provider and
model registries after removing applyAdditionalModels().
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: afebd50b-3552-4bb7-b6cc-37fe27adf6d7
📒 Files selected for processing (1)
internal/model/registry.go
Summary
Remove the
additionalModelsmerge-injection mechanism frominternal/model/registry.go. GLM-5.2 and Qwen3.8-Max-Preview are now published on models.dev, so the hand-maintainedglm52Model(),qwen38MaxPreviewModel(), andapplyAdditionalModels()are no longer needed — the generated registry (registry_generated.go) transparently took over.Also removes the Alibaba Token Plan static providers (
alibaba-token-plan-cn/alibaba-token-plan), which models.dev now carries via the generate script.Changes
glm52Model(),qwen38MaxPreviewModel()builder functionsadditionalModelsmap andapplyAdditionalModels()alibaba-token-plan-cn/alibaba-token-planstatic providersapplyAdditionalModels()call frominit()Net: −99 lines, no behavioral change for end users.
Verification
go build ./internal/model/✅go test ./...) ✅Summary by CodeRabbit