Skip to content

Refresh model registry routing - #1

Merged
austin-thesing merged 1 commit into
mainfrom
release/model-registry-refresh
Jun 16, 2026
Merged

Refresh model registry routing#1
austin-thesing merged 1 commit into
mainfrom
release/model-registry-refresh

Conversation

@austin-thesing

@austin-thesing austin-thesing commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Move built-in model catalogs into a dedicated model registry module.
  • Refresh OpenCode Zen and OpenRouter model lists with current release-prep entries.
  • Add explicit Zen API routing metadata so transport selection no longer relies on model ID prefixes.

Test plan

  • bun run typecheck

Summary by CodeRabbit

  • Bug Fixes

    • Updated default model selection to improve performance and compatibility.
  • Refactor

    • Reorganized model catalog and provider management infrastructure for better maintainability.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8cd36741-6723-44bf-aac6-0c973e94a223

📥 Commits

Reviewing files that changed from the base of the PR and between f45f9c8 and 6147d26.

📒 Files selected for processing (4)
  • src/lib/api.ts
  • src/lib/config.ts
  • src/lib/models.ts
  • src/lib/types.ts

📝 Walkthrough

Walkthrough

ZenApiType is added to the Model interface in types.ts. All provider model catalog arrays and helper functions are extracted from types.ts into a new src/lib/models.ts file, with types.ts re-exporting them. api.ts switches Zen API routing from string-prefix inference to reading model.zenApiType directly. The default model in config.ts changes from minimax-m2.5-free to deepseek-v4-flash-free.

Changes

Zen API Metadata Routing and Model Catalog Refactor

Layer / File(s) Summary
ZenApiType type and Model interface extension
src/lib/types.ts
Adds the ZenApiType union ("openai-responses" | "anthropic" | "openai-compatible" | "google") and an optional zenApiType field to the Model interface.
Model catalog extraction and re-exports
src/lib/models.ts, src/lib/types.ts
New models.ts defines all provider model arrays (OPENROUTER_MODELS, VERCEL_AI_GATEWAY_MODELS, CLOUDFLARE_AI_GATEWAY_MODELS, WORKERS_AI_MODELS, OPENCODE_ZEN_MODELS), the ALL_MODELS aggregate, and getProviderModels/getProviderDisplayName helpers with exhaustive switch statements. types.ts removes its 499-line inline definitions and re-exports the same identifiers from ./models.
Zen API metadata routing and default model update
src/lib/api.ts, src/lib/config.ts
getZenApiType now accepts a Model and returns model.zenApiType, throwing on absence instead of inferring from model.id string prefixes. translateToCommand passes the full model object. Default model changed to deepseek-v4-flash-free.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Refresh model registry routing' accurately captures the main objective: refactoring the model registry structure and updating API routing to use explicit metadata instead of ID-based inference.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 release/model-registry-refresh

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

@austin-thesing
austin-thesing merged commit 38c9869 into main Jun 16, 2026
6 checks passed
@austin-thesing
austin-thesing deleted the release/model-registry-refresh branch June 23, 2026 07:06
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