aboutsummaryrefslogtreecommitdiff
path: root/tests/pi-live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pi-live.sh')
-rwxr-xr-xtests/pi-live.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pi-live.sh b/tests/pi-live.sh
index 53115ec..04ef04a 100755
--- a/tests/pi-live.sh
+++ b/tests/pi-live.sh
@@ -277,6 +277,31 @@ same_cost() { python3 -c "import sys; a,b=sys.argv[1:]; print('same' if a and b
expect "cost: compaction counted, as pi's footer counts" same_cost same 30
t kill-window -t main:ctx
+# A failed run (the provider refuses the key): done, and why.
+t new-window -d -t main: -n fail -c "$D/work3"
+t send-keys -t main:fail "pi $NO_MCP" Enter
+expect "failures: an agent of its own" "st fail" idle 150
+type_line fail "fail 401 now"
+expect "a failed run: done" "st fail" done 80
+expect "with why, as one readable line" "t show -pv -t main:fail @dingger_error 2>/dev/null" "401: invalid x-api-key" 30
+expect "the menu says it failed" "\"$MENU\" --print | grep -F 'main · fail' | cut -f3 | grep -oE 'failed [^·]*· 401: invalid x-api-key'" "failed now · 401: invalid x-api-key"
+t set -p -t main:fail @dingger_ack 1; "$DINGGER" poke
+expect "seen: plain idle" "st fail" idle 50
+expect "and the failure is no longer shown" "t show -pv -t main:fail @dingger_error 2>/dev/null" "" 30
+type_line fail "fail 401 again"
+expect "failed again" "t show -pv -t main:fail @dingger_error 2>/dev/null" "401: invalid x-api-key" 80
+# A run cancelled after a failure is not a failure.
+type_line fail "slow 8 cancel me"
+expect "a new run: working" "st fail" working 50
+expect "the failure goes with it" "t show -pv -t main:fail @dingger_error 2>/dev/null" "" 30
+t send-keys -t main:fail Escape
+expect "cancelled: idle" "st fail" idle 50
+expect "with no failure" "t show -pv -t main:fail @dingger_error 2>/dev/null" ""
+type_line fail "slow 1 fine"
+expect "a run that works: done" "st fail" done 80
+expect "with no failure" "t show -pv -t main:fail @dingger_error 2>/dev/null" ""
+t kill-window -t main:fail
+
echo "2. screen detection (pi without the extension)"
t send-keys -t main:plain "PI_CODING_AGENT_DIR=$D/agent-plain pi $NO_MCP" Enter
expect "identified as pi" "t show -pv -t main:plain @agent 2>/dev/null" pi 150