Chief: read a paged acpmux session list whole
Problem
acpmux #28182 answers _acpmux/sessions and _acpmux/watch with no limit in byte-bounded pages when the whole list is over its largest message (~14 MiB): the first page carries a nextCursor, and the rest is read with _acpmux/sessions {cursor, ...same params}. One daemon's list was 17 MB with tools and was refused as message.too_large. The Chief's Rust client reads only the first reply, so against a paging daemon it would come up on part of the list and miss sessions on later pages (its own leftover turn and compactor sessions, a peer's session find/session fall back to the list for).
What changed
optchat-chief/src/acpmux.rs: one helper,whole_list, reads every page (the reference is acpmux'sClient::whole_listin #28182): with nolimitit followsnextCursorby_acpmux/sessionswith the same params less the watch'senabled, and joinssessions. A cursor that comes again is refused with an error, so a bad daemon never loops it. With alimit, one plain request. A list that fits is one reply with no cursor, so older daemons work unchanged.- Every
_acpmux/sessions/_acpmux/watchcall in optchat-chief without alimitgoes through it: the link's watch,sessions()(the list fallback forsession/findandagents), andagents.rs's boundedsessions_bounded(each page keeps its 1 s bound). - Tests:
tests/acpmux_session_info.rsadds a fake daemon that answers in two pages (the_link_comes_up_on_every_page_of_the_watch_list,a_session_on_a_later_page_of_the_list_is_found,a_cursor_that_comes_again_is_refused);src/acpmux.rsadds a unit test that a list with alimitis one request.
The test commit comes first; the fix follows.
Red / green
Linux fast checks (cargo test --no-fail-fast of the whole optchat-chief crate):
- Red, at the test commit 93fbd17f4f47 (base plus the new tests only): https://github.com/manaflow-ai/cmux/actions/runs/41047905428. The three new tests fail as expected:
the_link_comes_up_on_every_page_of_the_watch_list(left: ["s-1"], the link came up on page one only),a_session_on_a_later_page_of_the_list_is_found(listed on page two: not found),a_cursor_that_comes_again_is_refused(unwrap_err()onOk(None)). One more fails:harness::the_chiefs_turn_and_compactor_sessions_carry_cmux_chief_and_children_do_not(harness.rs:445,left: 5). - Green, at the head 952bc6014db5: https://github.com/manaflow-ai/cmux/actions/runs/41049652619. 114 test binaries pass, 690 tests passed. All three new tests pass, and so does the
whole_list_testsunit test. One binary fails,--test harness, on the same test.
Failing tests at the head, compared by name with the base:
| Test | Head | Base (the merge-base 4a0b8f01e175 itself) | Verdict |
|---|---|---|---|
harness::the_chiefs_turn_and_compactor_sessions_carry_cmux_chief_and_children_do_not | fails, harness.rs:445:9, left: 5 right: 4 | fails, harness.rs:445:9, left: 5 right: 4 (run 41050748089, tested tree 943c5e5b = the merge-base's tree; the only failure of 28 in --test harness) | base red: same assertion on base, not a crash. The turn session's tags gained cmux.chief.participant in #27935 and the test still counts 4; this PR touches neither |
No crash, signal or cut-short run in either run.
No capture: no UI change.
Observed / Not run
Observed: the red and green Linux runs above, and the base run of the harness test. Fresh-home launch at the head 952bc6014db5 on a fleet Mac (build b0d14eaaee6d99eb3f453260): PASSED. Home in 6.4 s, up 30 s, no crash; the Chief thread "Chief - Main - This Mac" is listed and its intro rendered, with no error banner (run with --no-status, so no commit status was posted). An independent Codex (gpt-6-astra, high) review of 4a0b8f01e17..952bc6014db5 gave VERDICT: SHIP, with no findings.
Not run: a run against a real daemon that pages (#28182 landed after these tests ran).
Changelog
- Chief reads a paged acpmux session list whole, so it sees every session on a daemon whose list is too large for one message.
Agent session: agent session
š¤ Generated with Claude Code