acpmux clients (Rust): read a paged session list whole

Merged
TE
5d ago
+492-29

Problem

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

A list that fits is still one reply with no cursor, so these clients behave as before against an older acpmux.

What changed

  • cmux-tui/crates/cmux-tui-core/src/server/agent_session_link.rs: AcpmuxLink::call_whole_list does what acpmux's Client::whole_list does. With a limit it makes one plain call, since that caller pages for itself. Otherwise it follows nextCursor through _acpmux/sessions with the same params less enabled and appends each page's sessions. timeout bounds each reply.
  • agent_session_children.rs (agent-session-children), agent_session_stream.rs (the attach's _acpmux/watch, whose list picks the children the attachment follows) and agent_transfer/agent_update.rs (the update plan's chat list) read their lists through it. The watch's first page and its cursor pages are merged before descendant_ids reads them.
  • cmux-next-ios/rust/crates/cmux-mobile-host/src/notify_waiting.rs: the phone push watch asks for each next page by its cursor. The classifier loads every page's rows and each row is observed. A failed page reconnects the watch, which reads the list again from its start. notify.rs: doc comment only.
  • agent_chat_notices.rs already pages with a limit and is unchanged.
  • Tests: agent_session_attach_tests.rs gives the fake acpmux a two-page _acpmux/sessions and a two-page watch. session_children_reads_every_page_of_a_list_too_big_for_one_reply and session_children_follows_a_child_only_a_later_watch_page_names cover cmux-tui-core. a_watch_list_past_one_reply_reads_its_rest_from_the_cursor covers mobile-host.

Tests

Red/green are both on hosted Linux through cmux-ci test at the PR head. The red run used the test commit alone and the green run used the fix.

bash scripts/ci/init-submodule.sh ghostty-next && ./scripts/install-zig-ci.sh
(cd cmux-tui && cargo test -p cmux-tui-core --lib session_children)
(cd cmux-next-ios/rust && cargo test -p cmux-mobile-host notify_waiting)

Observed / Not run

  • Observed: the runs above. rustfmt --check is clean on every changed file.
  • Not run: a live daemon with #28182 and a list past one reply. Clippy and the full cmux-tui suite are left to this PR's CI.

Changelog

none

Agent session: agent session

šŸ¤– Generated with Claude Code