Skip to content

refactor(model): remove hand-maintained model injection now covered by models.dev - #171

Merged
cnjack merged 1 commit into
mainfrom
codex/remove-additional-models-injection
Jul 24, 2026
Merged

refactor(model): remove hand-maintained model injection now covered by models.dev#171
cnjack merged 1 commit into
mainfrom
codex/remove-additional-models-injection

Conversation

@cnjack

@cnjack cnjack commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Remove the additionalModels merge-injection mechanism from internal/model/registry.go. GLM-5.2 and Qwen3.8-Max-Preview are now published on models.dev, so the hand-maintained glm52Model(), qwen38MaxPreviewModel(), and applyAdditionalModels() 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

  • Delete glm52Model(), qwen38MaxPreviewModel() builder functions
  • Delete additionalModels map and applyAdditionalModels()
  • Delete alibaba-token-plan-cn / alibaba-token-plan static providers
  • Remove applyAdditionalModels() call from init()
  • Update GLM-5.2 comment (no longer "injected via additionalModels")

Net: −99 lines, no behavioral change for end users.

Verification

  • go build ./internal/model/
  • Full pre-push suite (build, vet, golangci-lint, go test ./...) ✅

Summary by CodeRabbit

  • Bug Fixes
    • Removed outdated model entries from the available provider and model listings.
    • Updated the recommended model configuration to reflect current availability.

…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.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Model registry cleanup

Layer / File(s) Summary
Remove additional model registration
internal/model/registry.go
Initialization no longer applies additional models, the additional model builders and merge function were removed, Alibaba token-plan providers were deleted, and the glm-5.2 comment was updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing hand-maintained model injection now supplied by models.dev.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-additional-models-injection

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Confirm generated registry contains the deleted static data.

registry_generated.go now contains no internal/model generated file, so removing applyAdditionalModels() and the Alibaba Token Plan static stubs removes zhipuai/zai glm-5.2 coverage and the qwen3.8-max-preview entries 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

📥 Commits

Reviewing files that changed from the base of the PR and between 35e4fbd and 2272179.

📒 Files selected for processing (1)
  • internal/model/registry.go

@cnjack
cnjack merged commit 6485bdc into main Jul 24, 2026
4 checks passed
@cnjack
cnjack deleted the codex/remove-additional-models-injection branch July 24, 2026 15:48
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