Skip to content

fix(cli): add nano-gpt to router models mapping#4981

Merged
marius-kilocode merged 3 commits intomainfrom
4689-kilo-code-cli-model-list-returns
Jan 13, 2026
Merged

fix(cli): add nano-gpt to router models mapping#4981
marius-kilocode merged 3 commits intomainfrom
4689-kilo-code-cli-model-list-returns

Conversation

@marius-kilocode
Copy link
Collaborator

Summary

Fixes #4689 - CLI /model list returns "No models available for this provider" for nano-gpt provider.

Problem

When using the Kilo Code CLI TUI with the nano-gpt provider, the command /model list incorrectly reports "No models available for this provider" even though the VS Code extension successfully sends the provider's model list (502 models).

Root Cause

The nano-gpt provider was missing from the router models mapping:

  1. PROVIDER_TO_ROUTER_NAME["nano-gpt"] was null instead of "nano-gpt"
  2. nano-gpt was not included in the needsRouterModels list in ensureRouterModels()
  3. getModelIdKey() was missing a case for nano-gpt

Changes

cli/src/constants/providers/models.ts

  • Added "nano-gpt" to the RouterName type union
  • Changed "nano-gpt": null to "nano-gpt": "nano-gpt" in PROVIDER_TO_ROUTER_NAME
  • Added case "nano-gpt": return "nanoGptModelId" to getModelIdKey() function

cli/src/commands/model.ts

  • Added "nano-gpt" to the needsRouterModels array in ensureRouterModels() function

cli/src/constants/providers/__tests__/models.test.ts

  • Added nano-gpt to mock router models with sample models
  • Added test suite for nano-gpt provider in router-based providers section
  • Added tests for PROVIDER_TO_ROUTER_NAME["nano-gpt"] mapping
  • Added tests for providerSupportsModelList("nano-gpt") returning true
  • Added tests for getRouterNameForProvider("nano-gpt") returning "nano-gpt"
  • Added tests for getModelFieldForProvider("nano-gpt") returning "nanoGptModelId"

Testing

All 1613 tests pass.

Note

There is a deeper architectural issue where commandContext.routerModels captures a snapshot at render time instead of reactively reading the latest atom value. This will be addressed in a seperate change.

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: 80caa71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kilocode/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marius-kilocode marius-kilocode requested a review from a team January 13, 2026 12:26
@marius-kilocode marius-kilocode enabled auto-merge (squash) January 13, 2026 12:26
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Jan 13, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR adds proper router model support for the nano-gpt provider in the CLI. The changes are straightforward and well-implemented:

  1. cli/src/commands/model.ts - Added nano-gpt to the list of providers that need router models in ensureRouterModels()
  2. cli/src/constants/providers/models.ts - Three changes:
    • Added nano-gpt to the RouterName type union
    • Changed PROVIDER_TO_ROUTER_NAME["nano-gpt"] from null to "nano-gpt"
    • Added case for nano-gpt in getModelIdKey() returning "nanoGptModelId"
  3. cli/src/constants/providers/__tests__/models.test.ts - Comprehensive test coverage for the new functionality

The implementation follows the existing patterns for other router-based providers (openrouter, ollama, litellm, etc.) and the test coverage is thorough.

Files Reviewed (4 files)
  • .changeset/cli-nano-gpt-router-models.md - Changeset with correct package scope
  • cli/src/commands/model.ts - Added nano-gpt to router providers list
  • cli/src/constants/providers/models.ts - Type and mapping updates
  • cli/src/constants/providers/__tests__/models.test.ts - Test coverage

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.

Kilo Code CLI /model list returns "No models available for this provider" for nano‑gpt provider

2 participants

Comments