acpmux clients (web, mux host): read a paged session list whole
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.tsSessionPager.whole(): after the limitless_acpmux/watch, reads the rest with_acpmux/sessions {cursor}(nolimit, 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 throughwhole(), so it is covered too.mux/host/src/acpmux-client.tssessions()andwatch(): a privatewholeListdoes the same, with the same params minusenabled. It refuses a repeated cursor. A watch reply that has nosessionsstays without one, sohost.tsstill 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.tswith the fake's newpageSessions/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
| Command | Base source (tests only) | Head |
|---|---|---|
cd mux/host && bun test tests/acpmux-events-paging.test.ts | 3 pass, 2 fail | 5 pass |
cd webviews && bun test test/agent-session-pager-whole.test.ts | 1 pass, 2 fail | 3 pass |
cd mux && bun test (the mux bun test CI job) | 75 pass, 0 fail | |
cd mux && bun run typecheck | clean | |
scripts/web-lint.sh (webviews bun run check) | passed | |
python3 scripts/cmux-next/prepush-gate.py | no 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-ciat 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