Fix/model name display (#26)

* fix(channels): start outbound dispatcher before channel check

StartAll() returned early when no channels existed at boot,
skipping the dispatchOutbound goroutine. Channels loaded later
via Reload() assumed the dispatcher was running, causing outbound
messages (agent responses) to never reach Telegram.

Move dispatcher startup before the empty-channel early return so
dynamically loaded channels always have a running consumer.

* feat(ui): add LLM provider warning on overview page and ignore plans dir

Show alert when no providers configured or all disabled, linking to provider settings. Add plans/ to .gitignore.

* fix: use model ID as display name in OpenAI-compatible provider list

The `owned_by` field (e.g. "system") was incorrectly used as the model
display name, causing all models to show as "system" in the UI dropdown
for providers like AliCloud DashScope.

---------

Co-authored-by: ntduc <ntduc@cpp.ai.vn>
This commit is contained in:
Duc Nguyenandntduc authored and GitHub committed 2026-03-01 14:38:28 +07:00
1 parent 0e75c21e55
commit 27f73cde6a
3 files changed
+29 -3

No files matched your search

+2 -1
View File
@@ -35,4 +35,5 @@ tmp
deploy-*.sh
docs/technical-diaries
docs/technical-diaries
plans
+1 -1
View File
@@ -194,7 +194,7 @@ func fetchOpenAIModels(ctx context.Context, apiBase, apiKey string) ([]ModelInfo
models := make([]ModelInfo, 0, len(result.Data))
for _, m := range result.Data {
models = append(models, ModelInfo{ID: m.ID, Name: m.OwnedBy})
models = append(models, ModelInfo{ID: m.ID, Name: m.ID})
}
return models, nil
}
+26 -1
View File
@@ -1,11 +1,15 @@
import { useEffect, useState, useCallback } from "react";
import { Activity, Bot, History, Zap } from "lucide-react";
import { Activity, Bot, History, Zap, AlertTriangle } from "lucide-react";
import { Link } from "react-router";
import { PageHeader } from "@/components/shared/page-header";
import { StatusBadge } from "@/components/shared/status-badge";
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
import { useAuthStore } from "@/stores/use-auth-store";
import { useWsCall } from "@/hooks/use-ws-call";
import { useWsEvent } from "@/hooks/use-ws-event";
import { useProviders } from "@/pages/providers/hooks/use-providers";
import { Methods, Events } from "@/api/protocol";
import { ROUTES } from "@/lib/constants";
interface HealthPayload {
status?: string;
@@ -52,8 +56,12 @@ export function OverviewPage() {
const connected = useAuthStore((s) => s.connected);
const { call: fetchHealth, data: health } = useWsCall<HealthPayload>(Methods.HEALTH);
const { call: fetchStatus, data: status } = useWsCall<StatusPayload>(Methods.STATUS);
const { providers, loading: providersLoading } = useProviders();
const [, setLastUpdate] = useState(0);
const hasNoProviders = !providersLoading && providers.length === 0;
const hasNoEnabledProviders = !providersLoading && providers.length > 0 && !providers.some((p) => p.enabled);
useEffect(() => {
if (connected) {
fetchHealth();
@@ -82,6 +90,23 @@ export function OverviewPage() {
}
/>
{(hasNoProviders || hasNoEnabledProviders) && (
<Alert>
<AlertTriangle className="h-4 w-4" />
<AlertTitle>
{hasNoProviders ? "No LLM providers configured" : "No LLM providers enabled"}
</AlertTitle>
<AlertDescription>
{hasNoProviders
? "You need to add at least one LLM provider before agents can work. "
: "All providers are currently disabled. Enable at least one to start using agents. "}
<Link to={ROUTES.PROVIDERS} className="font-medium underline underline-offset-4 hover:text-foreground">
Go to Provider Settings
</Link>
</AlertDescription>
</Alert>
)}
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
<StatCard
icon={Activity}