diff --git a/test/shell.d/omarchycn-ai-test.sh b/test/shell.d/omarchycn-ai-test.sh index 5fe2b1b2..e67ef5ed 100755 --- a/test/shell.d/omarchycn-ai-test.sh +++ b/test/shell.d/omarchycn-ai-test.sh @@ -110,8 +110,6 @@ class H(http.server.BaseHTTPRequestHandler): code = 200 elif self.path == "/responses" and b"input" in body and b"messages" not in body: code = 200 - elif self.path == "/chat/completions" and b"messages" in body: - code = 200 else: code = 404 self.send_response(code) @@ -136,11 +134,18 @@ if OMARCHYCN_AI_TEST_BASE_URL="http://127.0.0.1:$port" omarchy-cn-ai-test good > fi pass "mock regression: 200 pass, 401 fail, responses path exercised" -# ai-default merges into claude settings without clobbering user config +# ai-default merges into claude settings without clobbering user config. +# claude is absent; the install branch must run our omarchy-mise-install stub, +# which "installs" the claude stub and leaves a marker. +cat > "$TEST_HOME/stubs/omarchy-mise-install" < "$TEST_HOME/stubs/claude" chmod +x "$TEST_HOME/stubs/claude" +STUB +chmod +x "$TEST_HOME/stubs/omarchy-mise-install" echo "sk-secret-1" | omarchy-cn-ai-secret set deepseek > /dev/null mkdir -p "$HOME/.claude" printf '{"permissions":{"allow":["Bash"]},"env":{"KEEP":"1"}}' > "$HOME/.claude/settings.json" @@ -150,4 +155,5 @@ omarchy-cn-ai-default good > /dev/null [[ $(jq -r '.env.ANTHROPIC_BASE_URL' "$HOME/.claude/settings.json") == "https://api.deepseek.com/anthropic" ]] || fail "ai-default env written" [[ $(cat "$HOME/.config/omarchy/defaults/agent") == claude ]] || fail "upstream default agent set" [[ $(stat -c %a "$HOME/.claude/settings.json") == 600 ]] || fail "claude settings 0600" +[[ -f $TEST_HOME/installer-ran ]] || fail "missing harness triggered installer" pass "ai-default maps the profile onto the upstream agent entry"