From 9b5daad0a15063eef788845f462e1620a59f8ffd Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 13 Aug 2026 13:33:55 -0700 Subject: [PATCH 1/2] Route dictation config to the install flow when voxtype is missing Clicking the bar's Dictation indicator runs omarchy-voxtype-config, which launched `voxtype configure` in a floating terminal even when voxtype was never installed, surfacing a raw `command not found` error. Guard the config command so a missing voxtype routes to omarchy-voxtype-install instead, matching the menu's install.ai.dictation action. Fixes #6823 Co-Authored-By: Claude Fable 5 --- bin/omarchy-voxtype-config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/omarchy-voxtype-config b/bin/omarchy-voxtype-config index 8b73ec51d723..506cfe1b6d26 100755 --- a/bin/omarchy-voxtype-config +++ b/bin/omarchy-voxtype-config @@ -4,5 +4,9 @@ set -e +if omarchy-cmd-missing voxtype; then + exec omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install +fi + omarchy-launch-floating-terminal-with-presentation "voxtype configure" omarchy-restart-shell From dc9d15ed3a05a0ee8c6646a9bb3ffbf70a4a167e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 28 Sep 2026 03:42:21 +0200 Subject: [PATCH 2/2] Branch the voxtype guard with if/else and cover it with a test AGENTS.md asks for a full if/else for two-path control flow rather than an exec in one branch that makes the rest unreachable. The missing branch still skips omarchy-restart-shell, since the installer restarts the shell itself once voxtype is in place. The test stubs the presence check, so it passes or fails on the script rather than on whether the machine running it has voxtype installed. It fails on quattro, where a missing voxtype still runs voxtype configure and restarts the shell. --- bin/omarchy-voxtype-config | 8 ++-- test/shell.d/voxtype-config-test.sh | 57 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 test/shell.d/voxtype-config-test.sh diff --git a/bin/omarchy-voxtype-config b/bin/omarchy-voxtype-config index 506cfe1b6d26..d5f703b74b8e 100755 --- a/bin/omarchy-voxtype-config +++ b/bin/omarchy-voxtype-config @@ -5,8 +5,8 @@ set -e if omarchy-cmd-missing voxtype; then - exec omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install + omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install +else + omarchy-launch-floating-terminal-with-presentation "voxtype configure" + omarchy-restart-shell fi - -omarchy-launch-floating-terminal-with-presentation "voxtype configure" -omarchy-restart-shell diff --git a/test/shell.d/voxtype-config-test.sh b/test/shell.d/voxtype-config-test.sh new file mode 100644 index 000000000000..e3bb9271be58 --- /dev/null +++ b/test/shell.d/voxtype-config-test.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +source "$(dirname "$0")/base-test.sh" + +test_bin=$(mktemp -d) +log_file=$(mktemp) + +cleanup() { + rm -rf "$test_bin" + rm -f "$log_file" +} +trap cleanup EXIT + +# Stub the presence check so the branch is decided by the test, not by whether +# this machine happens to have Voxtype installed. +cat >"$test_bin/omarchy-cmd-missing" <<'STUB' +#!/bin/bash +[[ -z $TEST_VOXTYPE_PRESENT ]] +STUB + +cat >"$test_bin/omarchy-launch-floating-terminal-with-presentation" <<'STUB' +#!/bin/bash +echo "present:$*" >>"$TEST_LOG" +STUB + +cat >"$test_bin/omarchy-restart-shell" <<'STUB' +#!/bin/bash +echo "restart-shell" >>"$TEST_LOG" +STUB + +chmod +x "$test_bin"/* + +run_config() { + : >"$log_file" + TEST_VOXTYPE_PRESENT="$1" TEST_LOG="$log_file" PATH="$test_bin:$ROOT/bin:$PATH" \ + bash "$ROOT/bin/omarchy-voxtype-config" +} + +run_config "" + +grep -qx 'present:omarchy-voxtype-install' "$log_file" || + fail "missing Voxtype routes the config command to the installer" "$(cat "$log_file")" +grep -q 'voxtype configure' "$log_file" && + fail "missing Voxtype does not run voxtype configure" +grep -qx 'restart-shell' "$log_file" && + fail "missing Voxtype does not restart the shell" + +run_config 1 + +grep -qx 'present:voxtype configure' "$log_file" || + fail "installed Voxtype opens its configuration" "$(cat "$log_file")" +grep -qx 'restart-shell' "$log_file" || + fail "installed Voxtype restarts the shell to pick up the new config" +grep -q 'omarchy-voxtype-install' "$log_file" && + fail "installed Voxtype does not re-run the installer" + +pass "Voxtype config guards against a missing Voxtype"