Expand description
GET /agentmux/viewer/agents/:name/history?before=<gen:line>&limit=: older lines of an agent’s transcript than a
paired device has, for a remote pane scrolled up past the feed’s snapshot
(docs/specs/SPEC_REMOTE_PANES_WATCH_AND_DRIVE_AN_AGENT_ON_ANOTHER_COMPUTER_2026_11_20.md §2, §7 “Large history”).
before is a line of the feed’s own numbering: the snapshot’s from_line (or an earlier page’s) with the
snapshot’s gen. A page is the limit lines (at most 2,000) just before it, read and vetted the same way as the
feed’s (FeedSource::read: origin-vetted, withheld values out, viewer::filter applied), framed the same way, and
at most PAGE_BYTES on the wire: when the lines are larger the oldest are left for the next page. A transcript
that is another generation now answers 409 gen_changed, and the device starts again from a snapshot.
Structs§
Constants§
- MAX_
PAGE_ 🔒LINES - The most lines one page holds.
- PAGE_
BYTES 🔒 - The most a page’s lines take on the wire. A remote pane keeps at most 20 MiB of history (§2), so a page is a
tenth of that; a page always holds at least one line (a frame is at most 64 KiB,
feed::device_frame).
Functions§
- gen_
changed 🔒 - handle_
viewer_ 🔒history GET /agentmux/viewer/agents/:name/history?before=<gen:line>&limit=:{gen, from_line, before, lines, more}, the linesfrom_line..before;morewhen there are older ones. 404 for an agent that isn’t this channel’s or is hidden, 400 for a malformedbeforeor one past the end, 409gen_changed. A computer’s read is signed as its feed open is (http_viewer_computers::refuse_unsigned_open), over the path and the query, so a page asked for is the page signed for; its token alone reads nothing.- oldest_
left_ 🔒out - How many of
frames, oldest first, to leave for the next page so the rest fit inbudgetbytes on the wire. The newest frame always stays. - page_
lines 🔒 - The lines a page asks for:
limit, 1 toMAX_PAGE_LINES, all of them when not given. - refuse 🔒