Skip to content

Conversation

@YuriNachos
Copy link

Fixes #4790

Summary

Previously, LiteLLM models were fetched through the generic requestRouterModels handler, which only flushed the cache when API credentials changed. This meant that clicking "Refresh Models" without changing credentials would return cached models instead of fetching fresh ones from the server.

Changes

  • Added requestLiteLLMModels message type to WebviewMessage.ts
  • Added litellmModels response type to ExtensionMessage.ts
  • Added dedicated handler in webviewMessageHandler.ts that:
    • Always flushes the cache before fetching (consistent with Ollama and LM Studio handlers)
    • Fetches fresh models from the LiteLLM server
    • Sends the updated model list to the webview
  • Added tests for the new handler

Test Plan

  • Added 2 new tests for requestLiteLLMModels handler
  • All existing tests pass (7390 passed)
  • Verified the implementation follows the same pattern as Ollama and LM Studio handlers

Co-Authored-By: Claude [email protected]

Fixes Kilo-Org#4790

Previously, LiteLLM models were fetched through the generic
`requestRouterModels` handler, which only flushed the cache when
API credentials changed. This meant that clicking "Refresh Models"
without changing credentials would return cached models instead
of fetching fresh ones from the server.

This fix adds a dedicated `requestLiteLLMModels` handler that:
- Always flushes the cache before fetching (consistent with Ollama
  and LM Studio handlers)
- Fetches fresh models from the LiteLLM server
- Sends the updated model list to the webview

Changes:
- Add `requestLiteLLMModels` message type to WebviewMessage.ts
- Add `litellmModels` response type to ExtensionMessage.ts
- Add new handler in webviewMessageHandler.ts
- Add tests for the new handler

Co-Authored-By: Claude <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2026

⚠️ No Changeset found

Latest commit: 0493988

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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.

LiteLLM models not refreshed after initial fetch

2 participants