Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(chat): the composer sorts providers by CLIs, API keys and local servers, lists only the connected ones, and says when Jarvis needs a restart

rubenluetke10-beep09d5ef7d2aa4
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx b/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx
index d77aef9782..1b4da9fe68 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx
@@ -40,6 +40,14 @@ import { cn } from "@/lib/utils";
* permission ladder's `plan` entry drawn as a switch, shown only when the
* runner has one.
*
+ * The provider list is grouped the way the Agents tab groups its cards — by
+ * what stands behind a row, never by whether it is connected: a coding CLI
+ * signed in with a subscription, a provider's own API behind a key, or a
+ * server on this machine with no account at all (maintainer, 2026-08-23: a
+ * person must SEE which rows are the CLIs and which are API keys), and it
+ * lists only the providers the Agents tab has connected — a fresh install
+ * with nothing connected sees every row greyed with a "connect" hint instead.
+ *
* A pick applies to the open session at once (the backend patches it and
* the next turn runs on it); with no session open it seeds the next one.
*/
@@ -53,9 +61,12 @@ export function AgentComposer({ autoFocus = false }: { autoFocus?: boolean }) {
const connected = useEventStore((s) => s.connected);
const wsWarming = useEventStore((s) => s.wsWarming);
const setActiveSection = useEventStore((s) => s.setActiveSection);
+ const pushToast = useEventStore((s) => s.pushToast);
+ const [restarting, setRestarting] = useState(false);
const catalog = useAgentChatStore((s) => s.catalog);
const catalogError = useAgentChatStore((s) => s.catalogError);
+ const backendOutdated = useAgentChatStore((s) => s.backendOutdated);
const connections = useAgentChatStore((s) => s.connections);
const liveModels = useAgentChatStore((s) => s.liveModels);
const draft = useAgentChatStore((s) => s.draft);
@@ -111,28 +122,60 @@ export function AgentComposer({ autoFocus = false }: { autoFocus?: boolean }) {
}
}
+ // The same relauncher the top bar's Restart uses. A 409 means live
+ // missions would die — say so and leave the override to the top bar.
+ async function onRestart() {
+ if (restarting) return;
+ setRestarting(true);
+ try {
+ const res = await fetch("/api/settings/restart-app", { method: "POST" });
+ if (res.status === 409) {
+ pushToast("warning", t("topbar.restart_missions_running"));
+ setRestarting(false);
+ return;
+ }
+ if (!res.ok) throw new Error(`restart-failed:${res.status}`);
+ // Success schedules the shutdown; the button stays busy until the
+ // window goes away.
+ } catch {
+ pushToast("error", t("permissions.restart_failed"));
+ setRestarting(false);
+ }
+ }
+
// ---- option lists -------------------------------------------------
+ // Only what the Agents tab has set up is offered (maintainer, 2026-08-23:
+ // the picker lists the providers configured there, nothing else). The one
+ // exception is an install with nothing connected yet: then every row shows
+ // greyed with its "connect" hint, so the list is a map and not a void. No
+ // "active" marker either — that word is the voice sub-agent's, and the
+ // pick here is its own thing: what you choose here is what the chat runs.
const providerGroups = useMemo<ComboboxGroup[]>(() => {
+ const anyConnected = providers.some((p) => p.connected);
+ const shown = anyConnected ? providers.filter((p) => p.connected) : providers;
const toOption = (p: ProviderOption): ComboboxOption => ({
value: p.id,
label: p.label,
- hint: !p.connected
- ? p.cli_installed === false
+ hint: p.connected
+ ? undefined
+ : p.cli_installed === false
? t("agent_chat.provider_not_installed")
- : t("agent_chat.provider_connect")
- : p.active
- ? t("agent_chat.provider_active")
- : undefined,
+ : t("agent_chat.provider_connect"),
disabled: !p.connected,
icon: <ProviderLogo providerId={p.id} label={p.label} size="sm" />,
searchText: `${p.family} ${p.runner}`,
});
- const ready = providers.filter((p) => p.connected).map(toOption);
- const rest = providers.filter((p) => !p.connected).map(toOption);
+ const labels: Record<ProviderKind, string> = {
+ cli: t("agent_chat.group_clis"),
+ api: t("agent_chat.group_api_keys"),
+ local: t("agent_chat.group_local"),
+ };
const groups: ComboboxGroup[] = [];
- if (ready.length) groups.push({ id: "ready", label: t("agent_chat.group_connected"), options: ready });
- if (rest.length) groups.push({ id: "rest", label: t("agent_chat.group_not_connected"), options: rest });
+ for (const kind of PROVIDER_KINDS) {
+ const rows = shown.filter((p) => providerKind(p) === kind);
+ if (rows.length) groups.push({ id: kind, label: labels[kind], options: rows.map(toOption) });
+ }
return groups;
}, [providers, t]);
@@ -381,6 +424,23 @@ export function AgentComposer({ autoFocus = false }: { autoFocus?: boolean }) {
</button>
)}
</div>
+ {backendOutdated && (
+ <div
+ className="flex items-center gap-2 px-1 text-xs text-muted-foreground"
+ data-testid="composer-backend-outdated"
+ role="status"
+ >
+ <span>{t("agent_chat.backend_outdated")}</span>
+ <button
+ type="button"
+ onClick={() => void onRestart()}
+ disabled={restarting}
+ className="font-medium text-primary hover:underline disabled:opacity-60"
+ >
+ {t("agent_chat.restart_now")}
+ </button>
+ </div>
+ )}
{provider && !provider.connected && (
<div
className="flex items-center gap-2 px-1 text-xs text-muted-foreground"
@@ -412,6 +472,21 @@ export function AgentComposer({ autoFocus = false }: { autoFocus?: boolean }) {
);
}
+/**
+ * What stands behind a provider row: a coding CLI (a subscription login, no
+ * key), a provider's own API behind a key, or a server on this machine with
+ * no account. Decided from the catalog's own facts (runner, keyless) — the
+ * same split the Agents tab draws, so the two never disagree. Claude's dual
+ * row lands where its resolved runner says: the CLI group when Claude Code
+ * answers, the API-key group when only an Anthropic key is saved.
+ */
+export type ProviderKind = "cli" | "api" | "local";
+export const PROVIDER_KINDS: readonly ProviderKind[] = ["cli", "api", "local"];
+export function providerKind(p: { runner: string; keyless: boolean }): ProviderKind {
+ if (p.keyless) return "local";
+ return p.runner === "api" ? "api" : "cli";
+}
+
/** One compact pick on the composer's bottom row — a pill-sized Combobox. */
function Pick({
testId,
diff --git a/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx b/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
index def86b5d9d..99268a8a14 100644
--- a/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
@@ -93,6 +93,7 @@ describe("ChatStage (agent chat)", () => {
{ jarvis: "openai-codex", key_set: true, is_active_brain: false },
],
catalogError: null,
+ backendOutdated: false,
liveModels: {},
sessions: [],
activeSessionId: null,
@@ -136,6 +137,78 @@ describe("ChatStage (agent chat)", () => {
expect(screen.queryByTestId("composer-plan")).toBeNull();
});
+ it("groups the provider list by what stands behind a row: coding CLIs, API keys, local servers", async () => {
+ const apiRow = {
+ ...CATALOG.providers[0],
+ id: "openai",
+ label: "OpenAI",
+ family: "openai",
+ runner: "api",
+ models_source: "live" as const,
+ curated_models: [],
+ cli_installed: null,
+ };
+ const localRow = { ...apiRow, id: "ollama", label: "Ollama", family: "ollama", keyless: true };
+ useAgentChatStore.setState({
+ catalog: { ...CATALOG, providers: [...CATALOG.providers, apiRow, localRow] },
+ connections: [
+ { jarvis: "claude-api", key_set: true, is_active_brain: false },
+ { jarvis: "openai-codex", key_set: false, is_active_brain: false },
+ { jarvis: "openai", key_set: true, is_active_brain: true },
+ ],
+ });
+ render(<ChatStage />);
+ fireEvent.click(screen.getByTestId("composer-provider"));
+ const panel = await screen.findByTestId("composer-provider-panel");
+ // The headings, in catalog order — never "connected / not connected".
+ const headings = Array.from(panel.querySelectorAll("div.uppercase")).map((el) => el.textContent);
+ expect(headings).toEqual(["Coding CLIs", "API keys", "On your own hardware"]);
+ expect(within(panel).queryByText("Connected")).toBeNull();
+ // Only what the Agents tab has set up is listed: Codex (no login) is not
+ // there at all, and the voice sub-agent's "active" word is not shown.
+ const options = within(panel).getAllByRole("option").map((el) => el.textContent ?? "");
+ expect(options.map((o) => o.replace(/\s+/g, " ").trim())).toEqual(["Anthropic Claude", "OpenAI", "Ollama"]);
+ expect(within(panel).queryByText("active")).toBeNull();
+ });
+
+ it("with nothing connected yet, lists every provider greyed with its connect hint", async () => {
+ useAgentChatStore.setState({
+ connections: [
+ { jarvis: "claude-api", key_set: false, is_active_brain: false },
+ { jarvis: "openai-codex", key_set: false, is_active_brain: false },
+ ],
+ });
+ render(<ChatStage />);
+ fireEvent.click(screen.getByTestId("composer-provider"));
+ const panel = await screen.findByTestId("composer-provider-panel");
+ const options = within(panel).getAllByRole("option");
+ expect(options).toHaveLength(2);
+ expect(options[0].textContent).toContain("connect");
+ // Codex is not installed on this box: the hint says so instead of "connect".
+ expect(options[1].textContent).toContain("not installed");
+ });
+
+ it("says when the backend is older than this window and offers the restart", async () => {
+ const fetchMock = vi.fn(async () => new Response(null, { status: 200 }));
+ vi.stubGlobal("fetch", fetchMock);
+ try {
+ useAgentChatStore.setState({ backendOutdated: true });
+ render(<ChatStage />);
+ const notice = screen.getByTestId("composer-backend-outdated");
+ expect(notice.textContent).toContain("older version");
+ fireEvent.click(within(notice).getByRole("button"));
+ await act(async () => {});
+ expect(fetchMock).toHaveBeenCalledWith("/api/settings/restart-app", { method: "POST" });
+ } finally {
+ vi.unstubAllGlobals();
+ }
+ });
+
+ it("shows no restart notice when the catalog carries the permission ladders", () => {
+ render(<ChatStage />);
+ expect(screen.queryByTestId("composer-backend-outdated")).toBeNull();
+ });
+
it("greys out a provider that is not connected and says how to fix it", () => {
useAgentChatStore.setState({
connections: [{ jarvis: "claude-api", key_set: false, is_active_brain: true }],
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 3cf1da73a3..0b657c09f8 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -572,11 +572,11 @@
"search_providers": "Anbieter suchen …",
"search_models": "Modelle suchen …",
"catalog_unavailable": "Agent-Chat nicht verfügbar",
- "group_connected": "Verbunden",
- "group_not_connected": "Nicht verbunden",
+ "group_clis": "Coding-CLIs",
+ "group_api_keys": "API-Keys",
+ "group_local": "Auf deiner eigenen Hardware",
"provider_connect": "verbinden",
"provider_not_installed": "nicht installiert",
- "provider_active": "aktiv",
"model_default": "Standardmodell",
"effort_default": "Standard-Aufwand",
"effort_none": "Kein Nachdenken",
@@ -597,6 +597,8 @@
"hint_connect": "{provider} ist noch nicht verbunden.",
"hint_not_installed": "{provider} ist auf diesem Rechner nicht installiert.",
"open_api_keys": "API-Keys öffnen",
+ "backend_outdated": "Jarvis läuft noch mit einer älteren Version als dieses Fenster — starte ihn neu, um das Update abzuschließen.",
+ "restart_now": "Jarvis neu starten",
"working": "Arbeitet …",
"working_for": "Arbeitet seit {duration}",
"thinking": "Denkt nach …",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 3a17f02602..08c8883d7e 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -572,11 +572,11 @@
"search_providers": "Search providers…",
"search_models": "Search models…",
"catalog_unavailable": "Agent chat unavailable",
- "group_connected": "Connected",
- "group_not_connected": "Not connected",
+ "group_clis": "Coding CLIs",
+ "group_api_keys": "API keys",
+ "group_local": "On your own hardware",
"provider_connect": "connect",
"provider_not_installed": "not installed",
- "provider_active": "active",
"model_default": "Default model",
"effort_default": "Default effort",
"effort_none": "No reasoning",
@@ -597,6 +597,8 @@
"hint_connect": "{provider} is not connected yet.",
"hint_not_installed": "{provider} is not installed on this machine.",
"open_api_keys": "Open API Keys",
+ "backend_outdated": "Jarvis is still running an older version than this window — restart it to finish the update.",
+ "restart_now": "Restart Jarvis",
"working": "Working…",
"working_for": "Working for {duration}",
"thinking": "Thinking…",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 19871ab2bb..1b1d71f9b0 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -572,11 +572,11 @@
"search_providers": "Buscar proveedores…",
"search_models": "Buscar modelos…",
"catalog_unavailable": "Chat de agente no disponible",
- "group_connected": "Conectados",
- "group_not_connected": "Sin conectar",
+ "group_clis": "CLIs de programación",
+ "group_api_keys": "Claves de API",
+ "group_local": "En tu propio hardware",
"provider_connect": "conectar",
"provider_not_installed": "no instalado",
- "provider_active": "activo",
"model_default": "Modelo predeterminado",
"effort_default": "Esfuerzo predeterminado",
"effort_none": "Sin razonamiento",
@@ -597,6 +597,8 @@
"hint_connect": "{provider} aún no está conectado.",
"hint_not_installed": "{provider} no está instalado en este equipo.",
"open_api_keys": "Abrir API Keys",
+ "backend_outdated": "Jarvis sigue ejecutando una versión anterior a la de esta ventana: reinícialo para terminar la actualización.",
+ "restart_now": "Reiniciar Jarvis",
"working": "Trabajando…",
"working_for": "Trabajando desde hace {duration}",
"thinking": "Pensando…",
diff --git a/jarvis/ui/web/frontend/src/store/agentChat.ts b/jarvis/ui/web/frontend/src/store/agentChat.ts
index 10e13e72be..333ca31b50 100644
--- a/jarvis/ui/web/frontend/src/store/agentChat.ts
+++ b/jarvis/ui/web/frontend/src/store/agentChat.ts
@@ -65,6 +65,13 @@ interface AgentChatStore {
catalog: AgentChatCatalog | null;
connections: AgentConnectionRow[];
catalogError: string | null;
+ /**
+ * The catalog answered without the fields this bundle reads (no permission
+ * ladders): the backend process predates the app on disk — an update that
+ * was reloaded but not yet restarted. The composer says so instead of
+ * silently showing fewer picks.
+ */
+ backendOutdated: boolean;
/** Live model lists per provider id (the API-backed rows). */
liveModels: Record<string, CuratedModel[]>;
sessions: AgentChatSession[];
@@ -229,6 +236,7 @@ export const useAgentChatStore = create<AgentChatStore>((set, get) => {
catalog: null,
connections: [],
catalogError: null,
+ backendOutdated: false,
liveModels: {},
sessions: [],
activeSessionId: null,
@@ -247,10 +255,15 @@ export const useAgentChatStore = create<AgentChatStore>((set, get) => {
]);
// A backend older than this bundle (the app not yet restarted after
// an update) may lack the newer arrays; an empty ladder is honest,
- // a crash is not.
+ // a crash is not — and the composer tells the person to restart.
+ // `permission_modes` is the tell: every row of the current route
+ // carries the array (possibly empty); only the older route omits it.
+ const providersRaw = raw.providers ?? [];
+ const backendOutdated =
+ providersRaw.length > 0 && providersRaw.some((p) => !Array.isArray(p.permission_modes));
const catalog: AgentChatCatalog = {
...raw,
- providers: (raw.providers ?? []).map((p) => ({
+ providers: providersRaw.map((p) => ({
...p,
curated_models: Array.isArray(p.curated_models) ? p.curated_models : [],
effort_levels: Array.isArray(p.effort_levels) ? p.effort_levels : [],
@@ -260,7 +273,7 @@ export const useAgentChatStore = create<AgentChatStore>((set, get) => {
default_model: p.default_model ?? "",
})),
};
- set({ catalog, connections, catalogError: null });
+ set({ catalog, connections, catalogError: null, backendOutdated });
// Settle the draft: an empty or unknown provider becomes the active
// sub-agent (else the first connected one); blank picks take the
// provider's defaults.