Bump version to v1.0.5 with Ollama models fetch fix

This commit is contained in:
Jay
2026-04-11 23:28:52 +09:00
parent 4f27798fe5
commit 53cc06f34c
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -236,8 +236,13 @@ class SidebarChatProvider implements vscode.WebviewViewProvider {
if (!this._view) { return; }
const { ollamaBase, defaultModel } = getConfig();
try {
const res = await axios.get(`${ollamaBase}/api/tags`);
const models: string[] = res.data.models.map((m: any) => m.name);
const res = await axios.get(`${ollamaBase}/api/tags`, { timeout: 3000 });
let models: string[] = res.data.models.map((m: any) => m.name);
if (models.length === 0) {
models = [defaultModel];
} else if (!models.includes(defaultModel)) {
models.unshift(defaultModel);
}
this._view.webview.postMessage({ type: 'modelsList', value: models });
} catch {
this._view.webview.postMessage({ type: 'modelsList', value: [defaultModel] });