diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-05 19:21:43 +0200 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-05 19:21:43 +0200 |
| commit | 5842b093cc502b46076423e4f8efdbbc568f86aa (patch) | |
| tree | 35b5a2ab971a2b9abb3188e56e0416033b4f13ea /tests/pi-live.sh | |
| parent | 3b7b7ed091bae3b0609c38b2d445201cc4b7a026 (diff) | |
pi: a failed run says so: a 'failed' alert with the error, and the error in red until seen
Diffstat (limited to 'tests/pi-live.sh')
| -rwxr-xr-x | tests/pi-live.sh | 25 |
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 |
