Drop the Claude Code API setup, Dim and Kimi, and the pkg-add change

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 23:45:12 -04:00
1 parent dd704a29cd
commit f2af41bbc9
17 files changed
+14 -275

No files matched your search

+1 -47
View File
@@ -132,8 +132,6 @@ crush_package="crush"
agy_package="antigravity-cli"
ori_package="github:OpenRouterLabs/ori-releases"
cursor_agent_package="cursor-agent"
dim_package="npm:dimcode"
kimi_package="npm:@moonshot-ai/kimi-code"
muse_package="http:muse[url=https://api.meta.ai/muse-launcher.sh,bin=muse,version_list_url=https://api.meta.ai/muse-code/channels/muse-stable,version_json_path=.version]"
assert_lazy_stub() {
@@ -155,8 +153,6 @@ assert_lazy_stub "$crush_package" crush
assert_lazy_stub "$ori_package" ori
assert_lazy_stub "$cursor_agent_package" cursor-agent
assert_lazy_stub "$muse_package" muse
assert_lazy_stub "$dim_package" dim
assert_lazy_stub "$kimi_package" kimi
pass "custom agent lazy stubs preserve their mise packages"
OMARCHY_TEST_MISSING_COMMAND=cursor-agent source "$ROOT/install/user/mise.sh"
@@ -166,10 +162,6 @@ grep -Fx "$cursor_agent_package" "$stub_log" >/dev/null || fail "user setup crea
grep -Fx "$omp_package omp" "$stub_log" >/dev/null || fail "user setup creates the Oh My Pi lazy stub"
grep -Fx "$crush_package" "$stub_log" >/dev/null || fail "user setup creates the Crush lazy stub"
grep -Fx "$ori_package ori" "$stub_log" >/dev/null || fail "user setup creates the Ori lazy stub"
OMARCHY_TEST_MISSING_COMMAND=dim source "$ROOT/install/user/mise.sh"
grep -Fx "$dim_package dim" "$stub_log" >/dev/null || fail "user setup creates the Dim Agent lazy stub"
OMARCHY_TEST_MISSING_COMMAND=kimi source "$ROOT/install/user/mise.sh"
grep -Fx "$kimi_package kimi" "$stub_log" >/dev/null || fail "user setup creates the Kimi Code lazy stub"
OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/install/user/mise.sh"
grep -Fx "$muse_package muse" "$stub_log" >/dev/null || fail "user setup creates the Muse lazy stub"
pass "user setup creates the custom agent lazy stubs"
@@ -179,7 +171,6 @@ source "$ROOT/install/user/mise.sh"
grep -Fx "$cursor_agent_package" "$stub_log" >/dev/null && fail "user setup replaces an existing cursor-agent command"
pass "user setup keeps an existing Cursor CLI install"
grep -Fx "$muse_package muse" "$stub_log" >/dev/null && fail "user setup replaces an existing Muse command"
grep -E "^($dim_package dim|$kimi_package kimi)$" "$stub_log" >/dev/null && fail "user setup replaces an existing Dim or Kimi command"
: >"$stub_log"
OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/migrations/1788724825.sh" >/dev/null
@@ -194,21 +185,6 @@ OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/migrations/1788724825.sh" >/dev/
rm "$test_home/.local/state/omarchy/preinstalls-removed"
pass "Muse migration preserves existing installs and the preinstall opt-out"
for command in dim kimi; do
: >"$stub_log"
OMARCHY_TEST_MISSING_COMMAND=$command source "$ROOT/migrations/1791259271.sh" >/dev/null
package_var=${command}_package
grep -Fx "${!package_var} $command" "$stub_log" >/dev/null || fail "Dim and Kimi migration creates the $command lazy stub"
done
: >"$stub_log"
source "$ROOT/migrations/1791259271.sh" >/dev/null
[[ ! -s $stub_log ]] || fail "Dim and Kimi migration replaces an existing command"
touch "$test_home/.local/state/omarchy/preinstalls-removed"
OMARCHY_TEST_MISSING_COMMAND=dim source "$ROOT/migrations/1791259271.sh" >/dev/null
[[ ! -s $stub_log ]] || fail "Dim and Kimi migration ignores the preinstall opt-out"
rm "$test_home/.local/state/omarchy/preinstalls-removed"
pass "Dim and Kimi migration preserves existing installs and the preinstall opt-out"
: >"$stub_log"
source "$ROOT/migrations/1785617047.sh" >/dev/null
@@ -446,22 +422,11 @@ pass "agent migrations install working wrappers without overriding the preinstal
"$ROOT/bin/omarchy-mise-install" "$muse_package" muse
touch "$test_home/.local/bin/agy" "$test_home/.local/bin/ori"
omarchy-remove-preinstalls >/dev/null
for command in agy omp ori grok crush cursor-agent muse dim kimi; do
for command in agy omp ori grok crush cursor-agent muse; do
[[ ! -e $test_home/.local/bin/$command ]] || fail "Remove Preinstalls deletes the $command lazy stub"
done
pass "Remove Preinstalls deletes every optional agent lazy stub"
for command in dim kimi; do
printf '#!/bin/bash\necho user-%s\n' "$command" >"$test_home/.local/bin/$command"
chmod +x "$test_home/.local/bin/$command"
done
omarchy-remove-preinstalls >/dev/null
for command in dim kimi; do
[[ $("$test_home/.local/bin/$command") == "user-$command" ]] || fail "Remove Preinstalls keeps a user-managed $command"
rm "$test_home/.local/bin/$command"
done
pass "Remove Preinstalls keeps user-managed Dim and Kimi launchers"
# Cursor's installer links the same path, so anything but the mise wrapper is
# the user's own install.
touch "$test_home/.local/bin/cursor-agent.official"
@@ -530,12 +495,7 @@ declare -A expected_agents=(
[claude-code]="claude"
[codex]="codex"
[crush]="crush"
[dim]="dim"
[dimcode]="dim"
[dim-agent]="dim"
[grok]="grok"
[kimi]="kimi"
[kimi-code]="kimi"
[agy]="agy"
[antigravity]="agy"
[antigravity-cli]="agy"
@@ -559,8 +519,6 @@ declare -A expected_packages=(
[codex]="codex"
[crush]="$crush_package"
[grok]="$grok_package"
[dim]="$dim_package"
[kimi]="$kimi_package"
[agy]="$agy_package"
[copilot]="copilot"
[cursor-agent]="$cursor_agent_package"
@@ -832,8 +790,6 @@ assert_launch cursor-agent cursor-agent --yolo --trust agent -- "Review this pro
assert_launch hermes env -u HERMES_SESSION_SOURCE hermes chat --yolo --tui "--query=Review this project"
assert_launch agy agy --dangerously-skip-permissions --prompt-interactive "Review this project"
assert_launch copilot copilot --allow-all --interactive "Review this project"
assert_launch dim dim exec "Review this project"
assert_launch kimi kimi --auto --prompt "Review this project"
pass "agent launcher adapts initial prompts for every supported agent"
literal_muse_prompt=$'--disable-sandbox !Crash {$(touch must-not-run)}\ntrailing\\ '
@@ -862,8 +818,6 @@ assert_bypass cursor-agent cursor-agent --yolo --trust
assert_bypass hermes hermes --yolo
assert_bypass agy agy --dangerously-skip-permissions
assert_bypass copilot copilot --allow-all
assert_bypass dim dim
assert_bypass kimi kimi --auto
pass "agent launcher skips permission prompts for every supported agent"
printf '%s\n' "opencode" >"$agent_file"
+1 -3
View File
@@ -258,8 +258,6 @@ const expectedAgents = {
copilot: { icon: '', label: 'Copilot' },
crush: { icon: '󰋑', label: 'Crush' },
muse: { icon: '󰛤', label: 'Muse Code' },
dim: { icon: '\u{f0f65}', label: 'Dim Agent' },
kimi: { icon: '\u{f0c0a}', label: 'Kimi Code' },
'cursor-agent': { icon: '\ue90d', iconFont: 'omarchy', label: 'Cursor CLI' },
}
@@ -280,7 +278,7 @@ assertDeepEqual(
defaultItems
.filter(item => item.parent === 'setup.default.agent')
.map(item => item.label),
['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Dim Agent', 'Grok', 'Hermes', 'Kimi Code', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'],
['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Grok', 'Hermes', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'],
'menu sorts coding agents alphabetically'
)
const expectedDefaults = {
-39
View File
@@ -1,39 +0,0 @@
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mock_path="$test_tmp/bin"
mkdir -p "$mock_path"
cat >"$mock_path/pacman" <<'MOCK'
#!/bin/bash
if [[ $1 == "-Q" ]]; then
[[ " $TEST_INSTALLED " == *" $3 "* ]]
exit
fi
printf '%s\n' "$*" >>"$TEST_TMP/pacman-sync"
for arg in "$@"; do
[[ $arg == -* ]] || TEST_INSTALLED+=" $arg"
done
printf '%s\n' "$TEST_INSTALLED" >"$TEST_TMP/installed"
MOCK
cat >"$mock_path/sudo" <<'MOCK'
#!/bin/bash
exec "$@"
MOCK
chmod +x "$mock_path"/*
export PATH="$mock_path:$ROOT/bin:$PATH" TEST_TMP="$test_tmp"
TEST_INSTALLED="local-only fcitx5" "$ROOT/bin/omarchy-pkg-add" fcitx5-rime local-only opencc >/dev/null 2>&1 || true
[[ $(<"$test_tmp/pacman-sync") == "-S --noconfirm --needed -- fcitx5-rime opencc" ]] ||
fail "pkg-add asks pacman only for the missing packages" "$(<"$test_tmp/pacman-sync")"
pass "an installed package from no repository is left out of the pacman -S call"
rm -f "$test_tmp/pacman-sync"
TEST_INSTALLED="local-only fcitx5" "$ROOT/bin/omarchy-pkg-add" local-only fcitx5
[[ ! -e $test_tmp/pacman-sync ]] || fail "pkg-add runs no transaction when nothing is missing" "$(<"$test_tmp/pacman-sync")"
pass "pkg-add runs no transaction when everything is installed"
+4 -4
View File
@@ -15,7 +15,7 @@ rewrite() { sed -e "s|/etc/|$root/etc/|g" -e "s| /\\.cargo/| $root/.cargo/|g" "$
rewrite "$ROOT/install/config/region.sh" "$sandbox/install/config/region.sh"
rewrite "$ROOT/bin/omarchy-region" "$sandbox/bin/omarchy-region"
for command in omarchy-refresh-pacman omarchy-setup-claude-api omarchy-system-logout pacman-key pacman omarchy-apply-pacman; do
for command in omarchy-refresh-pacman omarchy-system-logout pacman-key pacman omarchy-apply-pacman; do
printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$test_tmp/bin/$command"
done
printf '#!/bin/bash\necho "omarchy-update-pacman $*" >>"%s"\n[[ -z ${STUB_UPDATE_FAIL:-} ]]\n' "$calls" >"$test_tmp/bin/omarchy-update-pacman"
@@ -47,9 +47,9 @@ pass "switching to China again keeps the channel"
omarchy-region global >/dev/null
[[ $(omarchy-region) == "Global" && ! -e $root/etc/omarchy/region ]] ||
fail "switching to Global removes the region"
[[ $(<"$calls") == $'omarchy-refresh-pacman stable\nomarchy-setup-claude-api --remove' ]] ||
fail "Global refreshes pacman back to the channel defaults and removes the Claude API setup" "$(<"$calls")"
pass "switching to Global restores the channel's pacman defaults and removes the Claude API setup"
[[ $(<"$calls") == 'omarchy-refresh-pacman stable' ]] ||
fail "Global refreshes pacman back to the channel defaults" "$(<"$calls")"
pass "switching to Global restores the channel's pacman defaults"
if output=$(omarchy-region mars 2>&1); then
fail "an unknown region is refused" "$output"
-61
View File
@@ -1,61 +0,0 @@
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mkdir -p "$test_tmp/bin" "$test_tmp/home/.claude"
cat >"$test_tmp/bin/gum" <<'SH'
#!/bin/bash
count=$(($(cat "$GUM_COUNT") + 1))
printf '%s' "$count" >"$GUM_COUNT"
sed -n "${count}p" "$GUM_SCRIPT"
SH
chmod +x "$test_tmp/bin/gum"
export PATH="$test_tmp/bin:$PATH" HOME="$test_tmp/home" GUM_COUNT="$test_tmp/count" GUM_SCRIPT="$test_tmp/script"
settings="$HOME/.claude/settings.json"
run_setup() {
printf '%s\n' "$@" >"$GUM_SCRIPT"
printf '0' >"$GUM_COUNT"
"$ROOT/bin/omarchy-setup-claude-api" >/dev/null
}
echo '{"theme":"dark","env":{"KEEP_ME":"1"}}' >"$settings"
chmod 644 "$settings"
install -m 644 /dev/null "$settings.tmp"
echo '{"userID":"abc"}' >"$HOME/.claude.json"
run_setup DeepSeek sk-test "deepseek-flash[1m]"
expected='{"ANTHROPIC_AUTH_TOKEN":"sk-test","ANTHROPIC_BASE_URL":"https://api.deepseek.com/anthropic","ANTHROPIC_DEFAULT_HAIKU_MODEL":"deepseek-flash[1m]","ANTHROPIC_DEFAULT_OPUS_MODEL":"deepseek-flash[1m]","ANTHROPIC_DEFAULT_SONNET_MODEL":"deepseek-flash[1m]","ANTHROPIC_MODEL":"deepseek-flash[1m]","CLAUDE_CODE_SUBAGENT_MODEL":"deepseek-flash[1m]","KEEP_ME":"1"}'
[[ $(jq -cS .env "$settings") == "$expected" ]] || fail "DeepSeek writes the base URL, key and model for every tier" "$(jq -cS .env "$settings")"
[[ $(jq -r .theme "$settings") == "dark" ]] || fail "setup keeps unrelated Claude settings"
[[ $(stat -c %a "$settings") == "600" ]] || fail "the settings holding the key are private"
[[ $(jq -cS . "$HOME/.claude.json") == '{"hasCompletedOnboarding":true,"userID":"abc"}' ]] || fail "setup skips Anthropic sign-in and keeps Claude state"
pass "a provider preset writes Claude Code's env and skips Anthropic sign-in"
run_setup Custom https://example.com/anthropic sk-custom my-model
[[ $(jq -r '.env.ANTHROPIC_BASE_URL + " " + .env.ANTHROPIC_MODEL + " " + .env.ANTHROPIC_DEFAULT_HAIKU_MODEL' "$settings") == "https://example.com/anthropic my-model my-model" ]] ||
fail "Custom uses the typed base URL and model"
pass "Custom uses the typed base URL and model"
if run_setup Custom "" sk-custom my-model 2>/dev/null; then
fail "setup refuses an empty base URL"
fi
[[ $(jq -r .env.ANTHROPIC_MODEL "$settings") == "my-model" ]] || fail "a refused setup leaves the previous config"
pass "setup refuses an empty base URL and keeps the previous config"
"$ROOT/bin/omarchy-setup-claude-api" --remove >/dev/null
[[ $(jq -cS . "$settings") == '{"env":{"KEEP_ME":"1"},"theme":"dark"}' ]] || fail "remove deletes only the API setup" "$(jq -cS . "$settings")"
jq 'del(.env)' "$settings" >"$settings.tmp" && mv "$settings.tmp" "$settings"
run_setup MiniMax sk-mm "MiniMax-M3[1m]"
"$ROOT/bin/omarchy-setup-claude-api" --remove >/dev/null
[[ $(jq -cS . "$settings") == '{"theme":"dark"}' ]] || fail "remove drops an env it emptied" "$(jq -cS . "$settings")"
pass "remove deletes only the keys setup wrote"
grep -F '"setup.claude-api"' "$ROOT/default/omarchy/omarchy-menu.jsonc" | grep -qF '"when":"[[ \"$(omarchy-region)\" == \"China\" ]]"' ||
fail "the Claude Code API entry shows only in China"
pass "the Claude Code API entry shows only in China"