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(clis): an install pane that says something from the first second
rubenluetke10-beep48b918341efa
diff --git a/jarvis/clis/installer.py b/jarvis/clis/installer.pyindex c6922755e0..5b91f184bb 100644--- a/jarvis/clis/installer.py+++ b/jarvis/clis/installer.py@@ -109,7 +109,16 @@ class CliInstaller:if method == "scoop" and i.scoop_package:return ["scoop", "install", i.scoop_package]if method == "npm" and i.npm_package:- return ["npm", "install", "-g", i.npm_package]+ # Verbose ON PURPOSE. At its default log level `npm install -g`+ # prints nothing at all for the first ten-odd seconds and then+ # redraws a ONE-CHARACTER spinner in column 1 — measured 2026-08-23+ # against @deepseek-ai/dsh in the workspace PTY. In a terminal the+ # user is watching that is indistinguishable from an installer that+ # never started, and it is the only thing they have to go on.+ # `http` prints a line per package fetched, so the pane moves from+ # the first second; `--no-fund` drops the donation footer, which is+ # the one part of the output nobody is waiting for.+ return ["npm", "install", "-g", i.npm_package, "--loglevel=http", "--no-fund"]if method == "pip" and i.pip_package:return ["pip", "install", "--upgrade", i.pip_package]if method == "cargo" and i.cargo_package:diff --git a/jarvis/ui/web/cli_routes.py b/jarvis/ui/web/cli_routes.pyindex edaa63b371..cde30125d8 100644--- a/jarvis/ui/web/cli_routes.py+++ b/jarvis/ui/web/cli_routes.py@@ -284,43 +284,33 @@ def _summary_for(spec: CliSpec, status: CliStatus | None, usage_count_7d: int) -def _install_methods_of(spec: CliSpec) -> tuple[list[InstallMethodInfo], str | None]:+ """Every way this CLI can be installed, worded exactly as it will run.++ The package-manager commands come from ``CliInstaller.build_command``, the+ same function that builds the argv actually executed. They used to be+ assembled here a second time, and the copy drifted the moment the npm line+ grew its verbosity flags: the page then showed one command and the terminal+ ran another. A script install still shows its URL rather than the download+ one-liner wrapped around it — that is the useful thing to read, and it is+ the URL a user would check before running it.+ """+ from jarvis.clis.installer import CliInstaller++ builder = CliInstaller()methods: list[InstallMethodInfo] = []i = spec.install- if i.winget_id:- methods.append(- InstallMethodInfo(- manager="winget",- command=f"winget install --id {i.winget_id} -e --silent",- )- )- if i.scoop_package:- methods.append(- InstallMethodInfo(- manager="scoop",- command=f"scoop install {i.scoop_package}",- )- )- if i.npm_package:- methods.append(- InstallMethodInfo(- manager="npm",- command=f"npm install -g {i.npm_package}",- )- )- if i.pip_package:- methods.append(- InstallMethodInfo(- manager="pip",- command=f"pip install --upgrade {i.pip_package}",- )- )- if i.cargo_package:- methods.append(- InstallMethodInfo(- manager="cargo",- command=f"cargo install {i.cargo_package}",- )- )+ for manager, declared in (+ ("winget", i.winget_id),+ ("scoop", i.scoop_package),+ ("npm", i.npm_package),+ ("pip", i.pip_package),+ ("cargo", i.cargo_package),+ ):+ if not declared:+ continue+ argv = builder.build_command(spec, manager) # type: ignore[arg-type]+ if argv:+ methods.append(InstallMethodInfo(manager=manager, command=" ".join(argv)))if i.script_url:methods.append(InstallMethodInfo(diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.test.tsxindex dfd259f49c..69b71fd44c 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.test.tsx@@ -23,8 +23,14 @@ import { AgentInstallDialog } from "./AgentInstallDialog";// installer prints is WorkspaceTerminal's own test; this file is about what// the dialog concludes from the probe.vi.mock("../workspace/WorkspaceTerminal", () => ({- WorkspaceTerminal: ({ installName }: { installName?: string }) => (- <div data-testid={`stub-install-pty-${installName}`} />+ WorkspaceTerminal: ({+ installName,+ banner,+ }: {+ installName?: string;+ banner?: string;+ }) => (+ <div data-testid={`stub-install-pty-${installName}`} data-banner={banner} />),}));@@ -75,6 +81,30 @@ describe("AgentInstallDialog", () => {expect(screen.getByText("npm install -g @deepseek-ai/dsh")).toBeTruthy();});+ it("prints the command into the pane so it is never an empty box", () => {+ // The bug this exists for: a package manager can be silent for ten seconds+ // or more, and a black rectangle is how a user reads "nothing happened".+ // The banner is written locally, before the socket has even connected.+ open();+ const pane = screen.getByTestId("stub-install-pty-deepseek-harness");+ expect(pane.getAttribute("data-banner")).toContain(+ "npm install -g @deepseek-ai/dsh",+ );+ });++ it("still says something when the entry has no command to show", () => {+ render(+ <AgentInstallDialog+ agent="mystery"+ displayName="Mystery CLI"+ onClose={vi.fn()}+ />,+ );+ expect(+ screen.getByTestId("stub-install-pty-mystery").getAttribute("data-banner"),+ ).toContain("Mystery CLI");+ });+it("stays honest while the probe keeps saying no", async () => {recheckAgent.mockResolvedValue({name: "deepseek-harness",diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.tsxindex 6865880b9e..b5405dcf84 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentInstallDialog.tsx@@ -173,6 +173,15 @@ export function AgentInstallDialog({paneKey={`install-${agent}`}installName={agent}title={`Installing ${displayName}`}+ /* The pane must never be an empty black rectangle. A package+ manager can take several seconds to say its first word, and in+ that gap the only honest thing on screen is what is about to+ run. Dim, because it is this app talking, not the installer. */+ banner={+ command+ ? `\x1b[2m$ ${command}\x1b[0m`+ : `\x1b[2mStarting the installer for ${displayName}…\x1b[0m`+ }/></div>diff --git a/jarvis/ui/web/frontend/src/components/workspace/WorkspaceTerminal.tsx b/jarvis/ui/web/frontend/src/components/workspace/WorkspaceTerminal.tsxindex c0e3ac0933..c7f8aded3b 100644--- a/jarvis/ui/web/frontend/src/components/workspace/WorkspaceTerminal.tsx+++ b/jarvis/ui/web/frontend/src/components/workspace/WorkspaceTerminal.tsx@@ -35,6 +35,16 @@ interface WorkspaceTerminalProps {agentName?: string;/** Run an agent's installer by name; mutually exclusive with agentName. */installName?: string;+ /**+ * A line to print before anything the process says.+ *+ * For a pane whose process is SLOW to speak: an installer can be silent for+ * ten seconds or more, and an empty black rectangle is how a user reads+ * "nothing is happening". Printed locally the moment the terminal exists, so+ * it is on screen before the socket has even connected. Newlines may be+ * plain `\n`. Absent for an agent pane, which draws its own UI at once.+ */+ banner?: string;/** Header label shown above the terminal. */title: string;}@@ -52,6 +62,7 @@ export function WorkspaceTerminal({agentName,installName,title,+ banner,}: WorkspaceTerminalProps) {const containerRef = useRef<HTMLDivElement | null>(null);const termRef = useRef<Terminal | null>(null);@@ -63,6 +74,11 @@ export function WorkspaceTerminal({// restart the agent. Recolouring happens in its own effect below.const appearanceRef = useRef(appearance);appearanceRef.current = appearance;+ // Read through a ref for the same reason as the theme above: the banner is+ // printed once during setup, and making it a dependency there would tear the+ // PTY down and restart the installer whenever the string changed identity.+ const bannerRef = useRef(banner);+ bannerRef.current = banner;useEffect(() => {const container = containerRef.current;@@ -94,6 +110,11 @@ export function WorkspaceTerminal({// the same kind of agent prompt on the other end (see// ../agentic/terminalNewline).const disposeNewlineBridge = installNewlineBridge(term);+ // Before the socket, deliberately: the gap this fills is the one at the+ // very start, and a banner that waited for `ready` would arrive after it.+ if (bannerRef.current) {+ term.write(`${bannerRef.current.replace(/\n/g, "\r\n")}\r\n`);+ }try {fit.fit();} catch {diff --git a/jarvis/ui/web/frontend/src/views/MakeItYoursView.tsx b/jarvis/ui/web/frontend/src/views/MakeItYoursView.tsxindex 3060adf3ff..acf9966584 100644--- a/jarvis/ui/web/frontend/src/views/MakeItYoursView.tsx+++ b/jarvis/ui/web/frontend/src/views/MakeItYoursView.tsx@@ -35,7 +35,7 @@ type Counts = Record<string, number>;type Step = 0 | 1 | 2;type Session =| { kind: "grid"; slots: Slot[]; cwd: string }- | { kind: "install"; name: string; display: string }+ | { kind: "install"; name: string; display: string; command?: string }| null;function gridCols(n: number): number {@@ -99,7 +99,14 @@ export function MakeItYoursView() {const onInstall = (name: string) => {const a = agentsByName[name];- setSession({ kind: "install", name, display: a?.display_name ?? name });+ setSession({+ kind: "install",+ name,+ display: a?.display_name ?? name,+ // Shown in the pane before the installer says anything — see the banner+ // on InstallPanel's terminal below.+ command: a?.install_command ?? undefined,+ });};const onLaunch = async () => {@@ -132,7 +139,13 @@ export function MakeItYoursView() {}if (session?.kind === "install") {return (- <InstallPanel t={t} name={session.name} display={session.display} onDone={endSession} />+ <InstallPanel+ t={t}+ name={session.name}+ display={session.display}+ command={session.command}+ onDone={endSession}+ />);}@@ -285,11 +298,14 @@ function InstallPanel({t,name,display,+ command,onDone,}: {t: (k: string) => string;name: string;display: string;+ /** The command about to run, printed before the installer speaks. */+ command?: string;onDone: () => void;}) {return (@@ -307,7 +323,19 @@ function InstallPanel({</button></div><div className="flex-1 overflow-hidden p-3">- <WorkspaceTerminal paneKey={`install-${name}`} installName={name} title={`install ${name}`} />+ <WorkspaceTerminal+ paneKey={`install-${name}`}+ installName={name}+ title={`install ${name}`}+ /* A package manager can be silent for several seconds, and an+ empty black pane is how that reads. Dim, because it is this+ app talking rather than the installer. */+ banner={+ command+ ? `\x1b[2m$ ${command}\x1b[0m`+ : `\x1b[2mStarting the installer for ${display}…\x1b[0m`+ }+ /></div></div>);diff --git a/tests/unit/clis/test_install_command_parity.py b/tests/unit/clis/test_install_command_parity.pynew file mode 100644index 0000000000..82f9a70d16--- /dev/null+++ b/tests/unit/clis/test_install_command_parity.py@@ -0,0 +1,80 @@+"""The command a surface SHOWS must be the command that runs.++Two places used to word an install: ``CliInstaller.build_command``, which+builds the argv actually executed, and ``cli_routes._install_methods_of``,+which hand-assembled the same line again for the CLIs page. The copy drifted+the first time the npm line changed, and a page that shows one command while+the terminal runs another is worse than one that shows nothing.+"""++from __future__ import annotations++from jarvis.clis.installer import CliInstaller+from jarvis.clis.spec import AuthConfig, CliSpec, InstallMethods, RiskConfig+from jarvis.ui.web.cli_routes import _install_methods_of+++def _spec(**install: object) -> CliSpec:+ return CliSpec(+ name="acme",+ display_name="Acme",+ description="",+ homepage="",+ binary_name="acme",+ check_command=("acme", "--version"),+ version_parse_regex=r"(\d+\.\d+\.\d+)",+ install=InstallMethods(**install), # type: ignore[arg-type]+ auth=AuthConfig(type="none"),+ risk=RiskConfig(default_tier="monitor"),+ category="agent",+ )+++def test_every_package_manager_shows_exactly_what_it_runs() -> None:+ spec = _spec(+ winget_id="Acme.Cli",+ scoop_package="acme",+ npm_package="@acme/cli",+ pip_package="acme-cli",+ cargo_package="acme-cli",+ )+ builder = CliInstaller()+ methods, _ = _install_methods_of(spec)++ shown = {m.manager: m.command for m in methods}+ assert set(shown) == {"winget", "scoop", "npm", "pip", "cargo"}+ for manager, command in shown.items():+ argv = builder.build_command(spec, manager) # type: ignore[arg-type]+ assert argv is not None, manager+ assert command == " ".join(argv), manager+++def test_the_npm_line_stays_verbose_where_the_user_reads_it() -> None:+ """The flags are the fix for a pane that looked dead; they must be visible.++ At its default log level ``npm install -g`` says nothing for the first+ ten-odd seconds and then redraws a one-character spinner. Someone watching+ the install terminal has only that to go on, so the flags are not a+ preference — and a page that hid them would be describing a quieter command+ than the one it starts.+ """+ methods, _ = _install_methods_of(_spec(npm_package="@acme/cli"))+ npm = next(m for m in methods if m.manager == "npm")+ assert npm.command == "npm install -g @acme/cli --loglevel=http --no-fund"+++def test_a_script_install_still_shows_its_url_rather_than_the_wrapper() -> None:+ """Deliberately NOT the built argv: the URL is the thing worth reading.++ ``build_command`` wraps it in a platform download one-liner, which is what+ has to run and not what a person checks before agreeing to run it.+ """+ methods, recommended = _install_methods_of(_spec(script_url="https://acme.dev/install.sh"))+ assert [m.command for m in methods] == ["https://acme.dev/install.sh"]+ assert recommended == "script"+++def test_an_entry_with_nothing_but_a_manual_page_says_so() -> None:+ methods, recommended = _install_methods_of(_spec(manual_url="https://acme.dev/download"))+ assert [(m.manager, m.command) for m in methods] == [("manual", "https://acme.dev/download")]+ assert recommended == "manual"diff --git a/tests/unit/workspace/test_agents.py b/tests/unit/workspace/test_agents.pyindex 0885082184..3122655ee3 100644--- a/tests/unit/workspace/test_agents.py+++ b/tests/unit/workspace/test_agents.py@@ -86,12 +86,25 @@ def test_install_commands_are_runnable_or_honestly_absent() -> None:assert command is None or command.strip()# The built-ins keep their exact commands: these are what the user is shown# and what gets run in a terminal, so a silent change is a real change.- assert install_command("claude") == "npm install -g @anthropic-ai/claude-code"- assert install_command("codex") == "npm install -g @openai/codex"- assert install_command("opencode") == "npm install -g opencode-ai"- assert install_command("kimi") == "npm install -g @moonshot-ai/kimi-code"+ #+ # The npm flags are load-bearing, not decoration. At its default log level+ # `npm install -g` prints nothing for the first ten-odd seconds and then+ # redraws a one-character spinner, which in a terminal the user is watching+ # is indistinguishable from an installer that never started.+ assert (+ install_command("claude")+ == "npm install -g @anthropic-ai/claude-code --loglevel=http --no-fund"+ )+ assert install_command("codex") == "npm install -g @openai/codex --loglevel=http --no-fund"+ assert install_command("opencode") == "npm install -g opencode-ai --loglevel=http --no-fund"+ assert (+ install_command("kimi") == "npm install -g @moonshot-ai/kimi-code --loglevel=http --no-fund"+ )# A launch profile installs the binary it borrows.- assert install_command("glm") == "npm install -g @anthropic-ai/claude-code"+ assert (+ install_command("glm")+ == "npm install -g @anthropic-ai/claude-code --loglevel=http --no-fund"+ )grok_install = install_command("grok-build")assert grok_install is not Noneif sys.platform == "win32":@@ -183,7 +196,9 @@ async def test_detect_reports_installed_and_version() -> None:assert infos["claude"].installed is Trueassert infos["claude"].version == "2.1.195"assert infos["codex"].installed is False- assert infos["codex"].install_command == "npm install -g @openai/codex"+ assert (+ infos["codex"].install_command == "npm install -g @openai/codex --loglevel=http --no-fund"+ )@pytest.mark.asyncio@@ -221,7 +236,7 @@ async def test_a_registered_cli_is_detected_and_launchable_like_the_built_ins()assert isinstance(entry, WorkspaceAgent)assert "acme" in agent_names()assert "acme" in coding_agent_names()- assert install_command("acme") == "npm install -g @acme/agent"+ assert install_command("acme") == "npm install -g @acme/agent --loglevel=http --no-fund"argv = build_agent_argv("acme")assert argv is not None and any("acme" in part for part in argv)