Skip to content

Conversation

@Davidyz
Copy link
Contributor

@Davidyz Davidyz commented Nov 30, 2025

Description

Handle the special case where models is a list of strings in get_models_list.

  1. vim.iter treats tables and lists differently. When the parameter is a list, the signature of map would be fun(item) instead of fun(key, value).
  2. When model.choices is a list of strings (happened when I was using openai_compatible adapter), the existing code essentially convert everything to nil because value here would be nil.
  3. This caused the model list in the vim.ui.select picker to only contain the default model.

Related Issue(s)

git bisect pointed me to #2427

Screenshot

I have a few (~10) LLMs on this endpoint, but without this PR, I can only see one.
image

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've added test coverage for this fix/feature
  • I've run make all to ensure docs are generated, tests pass and my formatting is applied
  • (optional) I've updated CodeCompanion.has in the init.lua file for my new feature
  • (optional) I've updated the README and/or relevant docs pages

@olimorris olimorris added the P2 Moderate impact, moderate urgency label Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Moderate impact, moderate urgency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants