aboutsummaryrefslogtreecommitdiff
path: root/tests/pi-live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pi-live.sh')
-rwxr-xr-xtests/pi-live.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/pi-live.sh b/tests/pi-live.sh
index 3f4b4b8..9842343 100755
--- a/tests/pi-live.sh
+++ b/tests/pi-live.sh
@@ -7,7 +7,7 @@
# tests/pi-live.sh <pi binary> [dingger binary]
#
# Covers: identification, the extension's state and session reports, a turn
-# (working, then done), /reload, an extension's blocked event, /importance,
+# (working, then done), /reload, an extension's blocked event, /importance, /unread,
# screen detection for a pi without the extension, restore (`pi --session`,
# importance included), exit.
set -u
@@ -112,6 +112,15 @@ type_line agent "/importance high"
expect "/importance high: the pane option" "t show -pv -t main:agent @dingger_importance 2>/dev/null" high 50
expect "and pi's footer (its last line)" "t capture-pane -p -t main:agent | grep -v '^ *$' | tail -1 | sed 's/^ *//'" "importance: high" 30
expect "saved in the session file" "grep -c '\"customType\":\"dingger-importance\"' \"\$(t show -pv -t main:agent @agent_session)\"" 1 30
+# Seen (what a jump does; no client is attached here), then marked unread.
+t set -p -t main:agent @dingger_ack 1; "$DINGGER" poke
+expect "seen: idle" "st agent" idle 50
+type_line agent "/unread"
+expect "/unread: done again" "st agent" done 50
+# Not a turn (an unknown command would be sent to the model, and also end
+# done): the daemon applied a mark, and pi said so.
+expect "by a mark" "sed 's/\x1b\[[0-9;]*m//g' $D/daemon.log | grep -c 'mark unread target=main:agent applied=true'" 1 30
+expect "pi says so" "t capture-pane -p -t main:agent | grep -c 'marked unread: dingger shows it as done'" 1 30
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