From 2324851da1bfd53b3cfd449a225cf0a412c278a7 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 4 Aug 2026 06:06:04 -0700 Subject: [PATCH] Fall back to OpenCode in agent launcher --- bin/omarchy-launch-agent | 6 ------ test/shell.d/default-agent-test.sh | 15 ++++----------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/bin/omarchy-launch-agent b/bin/omarchy-launch-agent index 9e5a5ddc..0c619b09 100755 --- a/bin/omarchy-launch-agent +++ b/bin/omarchy-launch-agent @@ -11,12 +11,6 @@ else inline=false fi -agent_file="$HOME/.local/state/omarchy/defaults/agent" - -if [[ ! -s $agent_file ]]; then - exec omarchy-menu summon setup.default.agent -fi - agent=$(omarchy-default-agent) if omarchy-cmd-missing "$agent"; then diff --git a/test/shell.d/default-agent-test.sh b/test/shell.d/default-agent-test.sh index 1c284867..3ac8feeb 100644 --- a/test/shell.d/default-agent-test.sh +++ b/test/shell.d/default-agent-test.sh @@ -15,7 +15,6 @@ launch_log="$test_tmp/launch" inline_log="$test_tmp/inline" mise_log="$test_tmp/mise" mise_history="$test_tmp/mise-history" -picker_log="$test_tmp/picker" stub_log="$test_tmp/stubs" mkdir -p "$mock_bin" "$test_home" @@ -35,11 +34,6 @@ cat >"$mock_bin/omarchy-launch-tui" <<'SH' printf '%s\0' "$@" >"$OMARCHY_TEST_AGENT_LAUNCH_LOG" SH -cat >"$mock_bin/omarchy-menu" <<'SH' -#!/bin/bash -printf '%s\0' "$@" >"$OMARCHY_TEST_AGENT_PICKER_LOG" -SH - cat >"$mock_bin/opencode" <<'SH' #!/bin/bash printf '%s\0' opencode "$@" >"$OMARCHY_TEST_AGENT_INLINE_LOG" @@ -80,7 +74,6 @@ export OMARCHY_TEST_NOTIFICATION_LOG="$notification_log" export OMARCHY_TEST_NOTIFICATION_HISTORY="$notification_history" export OMARCHY_TEST_AGENT_LAUNCH_LOG="$launch_log" export OMARCHY_TEST_AGENT_INLINE_LOG="$inline_log" -export OMARCHY_TEST_AGENT_PICKER_LOG="$picker_log" export OMARCHY_TEST_MISE_LOG="$mise_log" export OMARCHY_TEST_MISE_HISTORY="$mise_history" export OMARCHY_TEST_STUB_LOG="$stub_log" @@ -144,10 +137,10 @@ pass "Remove Preinstalls deletes every optional agent lazy stub" pass "default agent falls back to OpenCode" omarchy-launch-agent -mapfile -d '' -t picker_args <"$picker_log" -[[ ${picker_args[0]} == "summon" && ${picker_args[1]} == "setup.default.agent" ]] || - fail "agent launcher opens the picker before a default is selected" -pass "agent launcher opens the picker before a default is selected" +mapfile -d '' -t launch_args <"$launch_log" +[[ ${#launch_args[@]} == 1 && ${launch_args[0]} == "opencode" ]] || + fail "agent launcher falls back to OpenCode before a default is selected" +pass "agent launcher falls back to OpenCode before a default is selected" source "$ROOT/default/bash/aliases" [[ $(alias a) == "alias a='omarchy-launch-agent --inline'" ]] ||