diff --git a/bin/omarchy-default-agent b/bin/omarchy-default-agent index 8c14a4f2..eb2ef7fb 100755 --- a/bin/omarchy-default-agent +++ b/bin/omarchy-default-agent @@ -86,9 +86,8 @@ if ! agent_install; then exit 1 fi -if [[ $agent == "claude" ]] && ! omarchy-install-chromium-claude; then - echo "Could not install the Claude browser extension" >&2 - exit 1 +if [[ $agent == "claude" ]]; then + omarchy-install-chromium-claude 2>/dev/null || true fi mkdir -p "$(dirname "$agent_file")" diff --git a/manual/17-ai.md b/manual/17-ai.md index 24ade4f4..0d62622d 100644 --- a/manual/17-ai.md +++ b/manual/17-ai.md @@ -26,7 +26,7 @@ To wrap an additional CLI the same way, run `omarchy-mise-install [com Pick your default agent with `omarchy default agent ` or under _Setup > Defaults > Agent_ in the Omarchy Menu (`Super + Space`). If the agent isn't installed yet, picking it installs it first. A fresh Omarchy will invite you to make this choice with a one-time notification. -Choosing Claude also sets up its browser extension for Chromium, Chrome, Brave, Brave Origin, and Edge. The extension setup applies to all users and may ask for your system password; cancelling leaves your previous default agent selected. Restart your browser, enable the extension if prompted, and sign in to Claude to finish connecting it. Run `/chrome` in Claude to check the connection. Firefox and Zen do not support this extension. If Claude was already your default before this setup was added, select it again to install the extension. +Choosing Claude also attempts to set up its browser extension for Chromium, Chrome, Brave, Brave Origin, and Edge. The extension setup applies to all users and may ask for your system password; cancelling or a failed extension install still selects and launches Claude. Restart your browser, enable the extension if prompted, and sign in to Claude to finish connecting it. Run `/chrome` in Claude to check the connection. Firefox and Zen do not support this extension. If Claude was already your default before this setup was added, select it again to install the extension. [Muse Code](https://dev.meta.ai) — Meta's `muse` — uses a preinstalled mise stub like the other agents. Picking it as the default installs Meta's official launcher through mise's HTTP backend. The launcher verifies and updates the native binary for your machine. diff --git a/test/shell.d/default-agent-test.sh b/test/shell.d/default-agent-test.sh index 7fd06093..60e630d3 100644 --- a/test/shell.d/default-agent-test.sh +++ b/test/shell.d/default-agent-test.sh @@ -25,7 +25,10 @@ mkdir -p "$mock_bin" "$test_home" cat >"$mock_bin/omarchy-install-chromium-claude" <<'SH' #!/bin/bash echo claude-extension >>"$OMARCHY_TEST_STUB_LOG" -[[ ${OMARCHY_TEST_EXTENSION_FAIL:-false} != "true" ]] +if [[ ${OMARCHY_TEST_EXTENSION_FAIL:-false} == "true" ]]; then + echo "Extension installation failed" >&2 + exit 1 +fi SH cat >"$mock_bin/omarchy-notification-send" <<'SH' @@ -440,11 +443,14 @@ pass "default agent selects and opens every supported provider and alias" pass "default agent stores its selection in Omarchy user config" OMARCHY_TEST_AGENT_INSTALLED=true omarchy-default-agent pi -if OMARCHY_TEST_AGENT_INSTALLED=true OMARCHY_TEST_EXTENSION_FAIL=true omarchy-default-agent claude >"$test_tmp/extension-failure" 2>&1; then - fail "Claude selection fails when browser extension installation fails" -fi -[[ $(omarchy-default-agent) == "pi" ]] || fail "extension installation failure preserves the default agent" -pass "extension installation failure preserves the default agent" +: >"$agent_open_log" +OMARCHY_TEST_AGENT_INSTALLED=true OMARCHY_TEST_EXTENSION_FAIL=true omarchy-default-agent claude >"$test_tmp/extension-failure" 2>&1 +[[ $(omarchy-default-agent) == "claude" ]] || fail "extension installation failure still selects Claude" +mapfile -d '' -t agent_open_args <"$agent_open_log" +[[ ${agent_open_args[*]} == "omarchy-agent" ]] || fail "extension installation failure still launches Claude" +[[ ! -s $test_tmp/extension-failure ]] || fail "extension installation failure is silent" +pass "extension installation failure silently continues selecting and launching Claude" +OMARCHY_TEST_AGENT_INSTALLED=true omarchy-default-agent pi : >"$notification_history" : >"$agent_open_log" : >"$terminal_log"