Expand description
Cursor-paginated event polling exposed as a futures::Stream.
Two entry points:
list_events_page— single-pageGET /agents/me/events; useful for CLIevents poll --cursor …invocations that want manual control.stream_events— long-runningStreamofAgentEventthat chaseshas_morewithout sleeping and falls back topoll_intervalonly when it hits the page tip.
§Cursor discipline
When the server returns next_cursor: null, we’ve reached the tip.
On the next poll we reuse the last-known cursor — sending None
again would risk reprocessing the entire backlog. The server treats
the cursor as opaque; the client must too.
Structs§
- Poll
Options - Tolerant
Event Page - Event page tolerant of per-item decode failures.
- Unparseable
Event - One unparseable event carried alongside the decoded page so callers can surface partial success instead of failing the whole batch.
Constants§
- DEFAULT_
PAGE_ LIMIT - DEFAULT_
POLL_ INTERVAL - Default knobs. Page size of 100 matches the server’s ceiling for this endpoint; a 5-second sleep at the tip balances liveness vs. quota pressure on long-idle agents.
Functions§
- list_
events_ page - One-shot
GET /agents/me/events?cursor=…&limit=…. - list_
events_ page_ tolerant - Tolerant variant of
list_events_page. - stream_
events - Long-running event stream. The returned
Streamnever ends on its own — drop it when the consumer is done. EachResultitem is independent: the stream surfaces transient errors but does not abort, so consumers can.next()again to retry.