Skip to main content

Module http_viewer_history

Module http_viewer_history 

Source
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§

HistoryQuery 🔒

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 lines from_line..before; more when there are older ones. 404 for an agent that isn’t this channel’s or is hidden, 400 for a malformed before or one past the end, 409 gen_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 in budget bytes on the wire. The newest frame always stays.
page_lines 🔒
The lines a page asks for: limit, 1 to MAX_PAGE_LINES, all of them when not given.
refuse 🔒