diff --git a/frontend/src/shell/PiManagement.test.tsx b/frontend/src/shell/PiManagement.test.tsx index b525261b..0f9b012c 100644 --- a/frontend/src/shell/PiManagement.test.tsx +++ b/frontend/src/shell/PiManagement.test.tsx @@ -23,7 +23,10 @@ function renderManagement() { } beforeEach(() => { - server.use(http.get("/api/pi-management/status", () => HttpResponse.json(readyStatus))); + server.use( + http.get("/api/pi-management/status", () => HttpResponse.json(readyStatus)), + http.get("/api/models", () => HttpResponse.json({ models: [] })), + ); }); test("shows the catalog default as read-only installation state", async () => { @@ -49,6 +52,22 @@ test("shows the catalog default as read-only installation state", async () => { expect(document.querySelector('input[type="password"]')).toBeNull(); }); +test("shows every session model exposed by Core", async () => { + server.use(http.get("/api/models", () => HttpResponse.json({ models: [ + { provider: "zai", id: "glm-5.3", name: "GLM 5.3", reasoning: true }, + { provider: "deepseek", id: "deepseek-v4-pro", name: "DeepSeek V4 Pro", reasoning: true }, + { provider: "deepseek", id: "deepseek-v4-flash", name: "DeepSeek V4 Flash", reasoning: true }, + { provider: "local-qwen", id: "qwen3.6-35b-a3b", name: "Local Qwen 3.6 35B A3B", reasoning: false }, + ] }))); + renderManagement(); + + const catalog = await screen.findByRole("region", { name: "Session models" }); + expect(catalog).toHaveTextContent("GLM 5.3"); + expect(catalog).toHaveTextContent("DeepSeek V4 Pro"); + expect(catalog).toHaveTextContent("DeepSeek V4 Flash"); + expect(catalog).toHaveTextContent("Local Qwen 3.6 35B A3B"); +}); + test("tests the catalog default without mutating credential presence", async () => { const user = userEvent.setup(); let tests = 0; diff --git a/frontend/src/shell/PiManagement.tsx b/frontend/src/shell/PiManagement.tsx index f2d58968..73503773 100644 --- a/frontend/src/shell/PiManagement.tsx +++ b/frontend/src/shell/PiManagement.tsx @@ -7,6 +7,7 @@ import { getPiManagementStatus, runPiManagementTest, } from "../api/pi-management"; +import { listModels } from "../api/models"; import { Button } from "../components/ui/button"; import { WorkAreaPanel } from "./WorkAreaPanel"; @@ -280,6 +281,7 @@ export function PiManagement({ open, onClose }: { open: boolean; onClose: () => const [smokeState, setSmokeState] = useState(); const [logsRequested, setLogsRequested] = useState(false); const statusQuery = useQuery({ queryKey: ["pi-management", "status"], queryFn: getPiManagementStatus, enabled: open }); + const modelsQuery = useQuery({ queryKey: ["models"], queryFn: listModels, enabled: open }); const logsQuery = useQuery({ queryKey: ["pi-management", "logs"], queryFn: getPiManagementLogs, enabled: open && logsRequested }); const catalogReady = Boolean( statusQuery.data?.config.provider @@ -402,6 +404,44 @@ export function PiManagement({ open, onClose }: { open: boolean; onClose: () => )} +
+
+
+

Session models

+

Models currently available for interactive sessions in this installation.

+
+ {modelsQuery.data && ( + {modelsQuery.data.models.length} available + )} +
+ {modelsQuery.isLoading ? ( +

Loading session models…

+ ) : modelsQuery.isError ? ( +
+

Could not load the session model catalog.

+ +
+ ) : modelsQuery.data?.models.length ? ( + + ) : ( +

No session models are configured for this installation.

+ )} +
+

Sanitized diagnostics

Shows at most 200 recent lines with declared secret values removed.