# Session closed at 01:42
{"time":1781826140544,"action":"session.close","session":"6afr3v","event":"received"}
# Scrolls continue immediately after, every ~100ms
{"time":1781826141514,"action":"scroll","session":"6afr3v","event":"received"}
{"time":1781826141515,"event":"response","ok":false,"elapsed_ms":0,"error_code":"SESSION_NOT_FOUND"}
{"time":1781826141614,"action":"scroll","session":"6afr3v","event":"received"}
{"time":1781826141614,"event":"response","ok":false,"elapsed_ms":0,"error_code":"SESSION_NOT_FOUND"}
...
# Still going 17 hours later at 18:51
{"time":1781887876856,"action":"scroll","session":"6afr3v","event":"received"}
{"time":1781887876856,"event":"response","ok":false,"elapsed_ms":0,"error_code":"SESSION_NOT_FOUND"}
Summary
A
pisub-agent entered an infinite retry loop sendingscrollcommands to a closed session. The daemon correctly returnedSESSION_NOT_FOUNDon every request, but the agent never broke out of the loop. Result: 608,970 failed scroll commands over 17 hours at ~10 req/s, bloating the log to 235 MB.Reproduction
session.closeor externally)bproxy scroll -s <dead-session>in a tight loop{"ok": false, "error_code": "SESSION_NOT_FOUND"}Evidence from logs
Impact
Proposed fix
The issue is on the client (CLI) side, not the daemon. The daemon behaves correctly (returns errors). The CLI should implement:
Circuit breaker: If N consecutive commands to the same session return the same error (e.g., 3x
SESSION_NOT_FOUND), the CLI should exit with a non-zero code and a clear message like"Session terminated — aborting"rather than returning the error to the caller in a way that allows silent retry.Rate limiting on errors: If the CLI receives errors at >1/s from the same session, introduce exponential backoff or hard-stop after a threshold.
Session liveness check: Before executing a destructive action, optionally verify the session still exists (cheap
tab listor internal state check).Environment
Workaround
Manual
kill <pid>on the stuck agent process.