llm: auto-load active config from arcadia on app boot

Adds <LlmConfigBootstrap /> in root.tsx that, when localStorage has no
active LLM settings, fetches enabled configurations from arcadia and
seeds the active settings (provider/model/baseURL/secretName + reasoning
effort) from the preferred row. Idempotent and silent on auth failure;
retries on session change.

Selection: prefer metadata.default === true, otherwise first enabled row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jules
2026-05-04 19:41:48 +10:00
parent d1469059d8
commit 5b0281574e
2 changed files with 93 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import "./app.css"
import { ToastProvider, Toaster } from "@crema/notification-ui"
import { CommandBusProvider } from "@crema/action-bus"
import { ArcadiaProvider } from "@crema/arcadia-client"
import { LlmConfigBootstrap } from "~/lib/llm-config-bootstrap"
// CREMA:PROVIDERS-IMPORTS
const ARCADIA_URL = import.meta.env.VITE_ARCADIA_URL ?? "http://localhost:4000"
@@ -61,6 +62,7 @@ export default function App() {
}}
>
<CommandBusProvider>
<LlmConfigBootstrap />
<Outlet />
<Toaster />
</CommandBusProvider>