fix: provider test FK error, model pull white screen, RECOMMENDED badge
Some checks failed
Auto Tag / auto-tag (push) Successful in 4s
Test / rust-fmt-check (push) Failing after 1m1s
Release / build-macos-arm64 (push) Successful in 3m2s
Test / rust-clippy (push) Successful in 7m16s
Test / frontend-typecheck (push) Has been cancelled
Test / frontend-tests (push) Has been cancelled
Test / rust-tests (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled

This commit is contained in:
Shaun Arman 2026-03-31 07:46:36 -05:00
parent 56e52ee09c
commit 652418017c
7 changed files with 24 additions and 7 deletions

View File

@ -259,6 +259,21 @@ pub async fn chat_message(
Ok(response) Ok(response)
} }
#[tauri::command]
pub async fn test_provider_connection(
provider_config: ProviderConfig,
) -> Result<ChatResponse, String> {
let provider = create_provider(&provider_config);
let messages = vec![Message {
role: "user".into(),
content: "Reply with exactly: TFTSR connection test successful.".into(),
}];
provider
.chat(messages, &provider_config)
.await
.map_err(|e| e.to_string())
}
#[tauri::command] #[tauri::command]
pub async fn list_providers() -> Result<Vec<ProviderInfo>, String> { pub async fn list_providers() -> Result<Vec<ProviderInfo>, String> {
Ok(vec![ Ok(vec![

View File

@ -70,6 +70,7 @@ pub fn run() {
// AI // AI
commands::ai::analyze_logs, commands::ai::analyze_logs,
commands::ai::chat_message, commands::ai::chat_message,
commands::ai::test_provider_connection,
commands::ai::list_providers, commands::ai::list_providers,
// Docs // Docs
commands::docs::generate_rca, commands::docs::generate_rca,

View File

@ -57,7 +57,7 @@ pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyho
"status": status, "status": status,
"total": total, "total": total,
"completed": completed, "completed": completed,
"percent": percent, "progress": percent,
}), }),
); );
} }

View File

@ -82,7 +82,7 @@ export function HardwareReport({ hardware, recommendations }: HardwareReportProp
> >
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
{rec.recommended && ( {rec.recommended && (
<Badge className="bg-green-600 text-white">RECOMMENDED</Badge> <Badge variant="success">RECOMMENDED</Badge>
)} )}
<div> <div>
<p className="text-sm font-medium">{rec.name}</p> <p className="text-sm font-medium">{rec.name}</p>

View File

@ -280,6 +280,7 @@ const badgeVariants = cva(
secondary: "border-transparent bg-secondary text-secondary-foreground", secondary: "border-transparent bg-secondary text-secondary-foreground",
destructive: "border-transparent bg-destructive text-destructive-foreground", destructive: "border-transparent bg-destructive text-destructive-foreground",
outline: "text-foreground", outline: "text-foreground",
success: "border-transparent bg-green-600 text-white",
}, },
}, },
defaultVariants: { defaultVariants: {

View File

@ -265,6 +265,9 @@ export const applyRedactionsCmd = (logFileId: string, approvedSpanIds: string[])
// ─── Issue CRUD ─────────────────────────────────────────────────────────────── // ─── Issue CRUD ───────────────────────────────────────────────────────────────
export const testProviderConnectionCmd = (providerConfig: ProviderConfig) =>
invoke<ChatResponse>("test_provider_connection", { providerConfig });
export const createIssueCmd = (newIssue: NewIssue) => export const createIssueCmd = (newIssue: NewIssue) =>
invoke<Issue>("create_issue", { invoke<Issue>("create_issue", {
title: newIssue.title, title: newIssue.title,

View File

@ -17,7 +17,7 @@ import {
Separator, Separator,
} from "@/components/ui"; } from "@/components/ui";
import { useSettingsStore } from "@/stores/settingsStore"; import { useSettingsStore } from "@/stores/settingsStore";
import { chatMessageCmd, type ProviderConfig, type Message } from "@/lib/tauriCommands"; import { testProviderConnectionCmd, type ProviderConfig } from "@/lib/tauriCommands";
const emptyProvider: ProviderConfig = { const emptyProvider: ProviderConfig = {
name: "", name: "",
@ -82,10 +82,7 @@ export default function AIProviders() {
setIsTesting(true); setIsTesting(true);
setTestResult(null); setTestResult(null);
try { try {
const testMessages: Message[] = [ const response = await testProviderConnectionCmd(form);
{ role: "user", content: "Reply with exactly: TFTSR connection test successful." },
];
const response = await chatMessageCmd("test-connection", "Test connection", form);
setTestResult({ success: true, message: `OK: ${response.content.slice(0, 100)}` }); setTestResult({ success: true, message: `OK: ${response.content.slice(0, 100)}` });
} catch (err) { } catch (err) {
setTestResult({ success: false, message: String(err) }); setTestResult({ success: false, message: String(err) });