fix(agent): cap inspection cursors per owner and session

Cursors shared one global FIFO of 1,024 and were never retired on use, so one
agent polling every second evicted every other caller's cursors after about
17 minutes. Each owner and session now keeps its newest 8 cursors, older ones
retired first, under the same global backstop; the cursor just used stays
among the newest, so a retry of the last call still works.
This commit is contained in:
Aamer Akhter committed 2026-10-26 09:04:53 -04:00
1 parent a29192a248
commit ecaddb40ae
4 files changed
+46 -7

No files matched your search

@@ -45,8 +45,8 @@ these reads do not provide authoritative current-thread tracking.
Terminal resizes preserve inspection cursors. Cursors are opaque, scoped to the
requesting identity, session, pane lifecycle generation
and attributed transcript, expire after 15 minutes, and disappear on server
restart. At most 1024 are retained; capacity eviction can invalidate an older
cursor. A replaced/truncated/rewritten source, reassociated session, foreign cursor
restart. Each caller and session keeps its newest 8 (so retrying the last call
works), at most 1024 in all; an older cursor can be retired. A replaced/truncated/rewritten source, reassociated session, foreign cursor
or unavailable native source returns `409 CONFLICT`. Inspect again without
`--since` to establish a new tail baseline; this may omit older evidence.