fix: restore fetchAvailableModels to fix provider lost as custom (#194)

* fix: restore fetchAvailableModels to fix provider lost as custom (#174)

#174 replaced fetchAvailableModels with fetchConfigModels, but
config/models response lacks default_provider, label, base_url and
api_key fields. This caused selectedProvider to always be empty,
making all models appear as "custom" in the model selector.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: bump version to 0.4.6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-24 23:30:34 +08:00
committed by GitHub
parent 70ed0e0dc2
commit 833fe06f92
2 changed files with 5 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hermes-web-ui",
"version": "0.4.5",
"version": "0.4.6",
"description": "Self-hosted AI chat dashboard for Hermes Agent — multi-model (Claude, GPT, Gemini, DeepSeek) web UI with Telegram, Discord, Slack, WhatsApp integration",
"repository": {
"type": "git",
+4 -10
View File
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { checkHealth, fetchConfigModels, updateDefaultModel, triggerUpdate, type AvailableModelGroup } from '@/api/hermes/system'
import { checkHealth, fetchAvailableModels, updateDefaultModel, triggerUpdate, type AvailableModelGroup } from '@/api/hermes/system'
const WEB_UI_VERSION = __APP_VERSION__
@@ -57,16 +57,10 @@ export const useAppStore = defineStore('app', () => {
async function loadModels() {
try {
const res = await fetchConfigModels()
modelGroups.value = res.groups.map(g => ({
provider: g.provider,
label: g.provider,
base_url: '',
models: g.models.map(m => typeof m === 'string' ? m : m.id),
api_key: '',
}))
const res = await fetchAvailableModels()
modelGroups.value = res.groups
selectedModel.value = res.default
selectedProvider.value = ''
selectedProvider.value = res.default_provider || ''
} catch {
// ignore
}