fix(settings): 모델 dropdown 에 보유 모델 전부 표시 (v2.2.209)

설정 패널 dropdown 이 LM Studio 에서 모델 1개만 보이고, 변경하면 원복되던
회귀 수정. 원인: settings 패널의 discoverModels 가 REST /v1/models 만 사용 →
JIT 로딩 환경에서 '현재 로드된' 모델만 반환. (사이드바는 SDK 로 전체를 가져옴)

- discoverModels: LM Studio SDK listDownloadedModels(전체 다운로드) 우선,
  실패/0개면 REST 폴백. 사이드바 ModelDiscovery 와 동일 정책으로 통일 →
  두 경로가 갈라져 다시 회귀하지 않도록 가이드라인 주석 명시.
- SettingsPanelDeps/SettingsSetupDeps 에 lmStudioDownloaded 콜백 추가,
  extension.ts 에서 lmStudioClient.listDownloadedCached 연결.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 10:35:23 +09:00
parent b733864375
commit b4ddd4f79a
6 changed files with 46 additions and 8 deletions
@@ -44,6 +44,12 @@ export interface SettingsPanelDeps {
telegramClient: ITelegramClient;
/** Returns the live bot instance for enrollNextChat. */
telegramBot: TelegramBot;
/**
* LM Studio SDK 의 '다운로드된 모든 LLM' 목록 콜백 (보통 lmStudioClient.listDownloadedCached).
* 모델 dropdown 이 보유 모델 전부를 보여주도록 discoverModels 에 전달한다.
* 없으면 REST `/v1/models` 만 사용 → JIT 환경에서 로드된 1개만 나오는 회귀 발생.
*/
lmStudioDownloaded?: () => Promise<string[]>;
}
interface SettingsState {
@@ -434,7 +440,7 @@ export class SettingsPanelProvider implements vscode.WebviewViewProvider {
this._modelsLoading = true;
await this._refreshState();
try {
const models = await discoverModels(url);
const models = await discoverModels(url, { lmStudioDownloaded: this._deps.lmStudioDownloaded });
this._modelsCache = {
url,
models,