acpmux clients (web, mux host): read a paged session list whole

TE
5d ago
+302-17

Problem

On 2026-10-30 one daemon's session list was 17 MB with tools, past acpmux's largest reply, and _acpmux/sessions / _acpmux/watch refused it as message.too_large. #28182 makes the daemon answer such a list (asked with no limit) in byte-bounded pages: the first rows plus a nextCursor, and the rest from _acpmux/sessions {cursor, ...same params minus enabled}. The in-repo TypeScript clients that ask for the whole list kept only the first reply, so against that daemon they would see a partial list.

What changed

Both clients now follow nextCursor the way the acpmux CLI's Client::whole_list (#28182) does. A list that fits is one reply with no cursor, so nothing changes against older daemons.

  • webviews/src/agent-session/acpmux/sessionPages.ts SessionPager.whole(): after the limitless _acpmux/watch, reads the rest with _acpmux/sessions {cursor} (no limit, which the host's pane policy allows) and concatenates. A cursor that comes back fails the read, so it never loops. rest()'s fallback goes through whole(), so it is covered too.
  • mux/host/src/acpmux-client.ts sessions() and watch(): a private wholeList does the same, with the same params minus enabled. It refuses a repeated cursor. A watch reply that has no sessions stays without one, so host.ts still lists after watch.
  • No other TS call site asks for the list without limit. The paged first/rest path already followed cursors.

Tests (committed red first, then the fix):

  • mux/host/tests/acpmux-events-paging.test.ts with the fake's new pageSessions / repeatSessionsCursor: sessions() reads every page; a repeated cursor is refused; watch() with no cursor returns the reply as sent.
  • webviews/test/agent-session-pager-whole.test.ts (new, plain bun): whole() with one reply, with three pages, and with a repeated cursor.
  • webviews/test/agent-pane-session-pages.test.ts (Chromium): a whole list read in 500-row pages still opens a linked chat on a late page and lists every session.

Test commands and results

CommandBase source (tests only)Head
cd mux/host && bun test tests/acpmux-events-paging.test.ts3 pass, 2 fail5 pass
cd webviews && bun test test/agent-session-pager-whole.test.ts1 pass, 2 fail3 pass
cd mux && bun test (the mux bun test CI job)75 pass, 0 fail
cd mux && bun run typecheckclean
scripts/web-lint.sh (webviews bun run check)passed
python3 scripts/cmux-next/prepush-gate.pyno new violations
cmux-ci test: CMUX_BROWSER_TESTS=1 bun test test/agent-pane-session-pages.test.ts test/agent-session-pager-whole.test.ts (hosted Linux, Chromium, run)13 pass, 0 fail (the job's red is the forced exit 1 that prints the log)

Observed / Not run

  • Observed: every command in the table, on Linux. The Chromium session-pages test ran through cmux-ci at this head.
  • Not run: against a live daemon built from #28182. The fakes page the same way that branch does.

Changelog

  • Fixed: the agent pane and the Home mux host read a session list too large for one acpmux reply in full instead of failing.

Agent session: agent session

🤖 Generated with Claude Code