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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(chat): the front page's draft starts clean, and a stored mode snaps to the ladder
rubenluetke10-beepf829ae4fe338
diff --git a/jarvis/ui/web/frontend/src/store/agentChat.test.ts b/jarvis/ui/web/frontend/src/store/agentChat.test.tsindex b718a5886b..5c14501e6f 100644--- a/jarvis/ui/web/frontend/src/store/agentChat.test.ts+++ b/jarvis/ui/web/frontend/src/store/agentChat.test.ts@@ -68,6 +68,65 @@ class FakeSocket {}describe("agent-chat store surfaces", () => {++ it("snaps a stored mode the row's ladder does not know onto the row's default", async () => {+ // The v1 draft was shared with the IDE and could carry a vendor word+ // ("skip-permissions"); on the Jarvis ladder that must become "ask", not+ // an unlabelled pill.+ window.localStorage.setItem(+ draftKey("jarvis"),+ JSON.stringify({+ provider: "antigravity",+ model: "",+ effort: "high",+ permissionMode: "skip-permissions",+ buildMode: "skip-permissions",+ cwd: "C:\\ide",+ }),+ );+ const modes = ["ask", "accept-edits", "plan", "bypass"].map((id) => ({ id, label: id, description: "" }));+ vi.stubGlobal(+ "fetch",+ vi.fn(async (input: string) => {+ const url = String(input);+ const reply = (data: unknown) => new Response(JSON.stringify(data), { status: 200 });+ if (url.startsWith("/api/agent-chat/catalog")) {+ return reply({+ providers: [+ {+ id: "antigravity",+ label: "Antigravity",+ family: "antigravity",+ runner: "agy-cli",+ models_source: "curated",+ curated_models: [],+ default_model: "",+ keyless: false,+ native_resume: true,+ effort_levels: ["low", "medium", "high"],+ default_effort: "medium",+ cli_installed: true,+ permission_modes: modes,+ default_permission_mode: "ask",+ },+ ],+ default_cwd: "C:\\home",+ shell: "pwsh",+ });+ }+ if (url.startsWith("/api/jarvis-agent/status")) return reply({ mapping: [] });+ if (url.startsWith("/api/providers/")) return reply({ models: [] });+ return new Response(null, { status: 404 });+ }),+ );+ const store = createAgentChatStore("jarvis");+ await store.getState().loadCatalog();+ const draft = store.getState().draft;+ expect(draft.provider).toBe("antigravity");+ expect(draft.permissionMode).toBe("ask");+ expect(draft.buildMode).toBe("ask");+ expect(draft.effort).toBe("high");+ });beforeEach(() => {window.localStorage.clear();vi.stubGlobal("WebSocket", FakeSocket);@@ -77,7 +136,7 @@ describe("agent-chat store surfaces", () => {});it("names the front page's draft key as it always was, and gives the IDE its own", () => {- expect(draftKey("jarvis")).toBe("jarvis.agentChat.draft.v1");+ expect(draftKey("jarvis")).toBe("jarvis.agentChat.draft.v2");expect(draftKey("agent")).toBe("jarvis.agentChat.draft.agent.v1");});diff --git a/jarvis/ui/web/frontend/src/store/agentChat.ts b/jarvis/ui/web/frontend/src/store/agentChat.tsindex 5a228295d1..d126397400 100644--- a/jarvis/ui/web/frontend/src/store/agentChat.ts+++ b/jarvis/ui/web/frontend/src/store/agentChat.ts@@ -55,7 +55,12 @@ import { EMPTY_TIMELINE, reduceEvent, reduceEvents, type Timeline } from "@/comp* IDE store gets its own so the two never overwrite each other's picks.*/export function draftKey(surface: AgentChatSurface): string {- return surface === "jarvis" ? "jarvis.agentChat.draft.v1" : `jarvis.agentChat.draft.${surface}.v1`;+ // v2 for the front page (2026-08-25): the v1 draft was written while the+ // IDE's chat and the front page shared one store, so it carried the IDE's+ // last folder and a vendor permission mode the Jarvis ladder does not know.+ // A new key starts the Jarvis chat clean — the active brain, the home+ // folder, the ladder's default — instead of on a coding session's picks.+ return surface === "jarvis" ? "jarvis.agentChat.draft.v2" : `jarvis.agentChat.draft.${surface}.v1`;}const RECONNECT_MS = 1500;/** How many sessions the list holds — the "All chats" archive shows them all. */@@ -177,6 +182,13 @@ function draftFromSession(session: AgentChatSession, prev: ComposerDraft): Compo* its own session list, so the front page's chat and an IDE's coding* sessions can be open at the same time without sharing a connection.*/+/** `value` when the ladder offers it (or the ladder is unknown), else `fallback`. */+function onLadder(value: string, ladder: readonly string[], fallback: string): string {+ if (!value) return fallback;+ if (ladder.length === 0) return value;+ return ladder.includes(value) ? value : fallback;+}+export function createAgentChatStore(surface: AgentChatSurface) {const DRAFT_KEY = draftKey(surface);@@ -324,9 +336,21 @@ export function createAgentChatStore(surface: AgentChatSurface) {} else {draft = {...draft,- effort: draft.effort || known.default_effort,- permissionMode: draft.permissionMode || known.default_permission_mode,- buildMode: draft.buildMode || known.default_permission_mode,+ effort: onLadder(draft.effort, known.effort_levels, known.default_effort),+ // A stored mode the row's ladder does not offer (a vendor word+ // from before the unified ladder, a pick made on another+ // surface) snaps to the row's default rather than showing a+ // label the person cannot choose.+ permissionMode: onLadder(+ draft.permissionMode,+ known.permission_modes.map((m) => m.id),+ known.default_permission_mode,+ ),+ buildMode: onLadder(+ draft.buildMode,+ known.permission_modes.map((m) => m.id),+ known.default_permission_mode,+ ),cwd: draft.cwd || catalog.default_cwd,};}