Skip to content

Chief: read a paged acpmux session list whole - #28297

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/acpmux-chief-clients-pages
Oct 30, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/acpmux-chief-clients-pages

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

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's Client::whole_list in acpmux: a session list too large for one message goes in pages #28182): with no limit it follows nextCursor by _acpmux/sessions with the same params less the watch's enabled, and joins sessions. A cursor that comes again is refused with an error, so a bad daemon never loops it. With a limit, one plain request. A list that fits is one reply with no cursor, so older daemons work unchanged.
  • Every _acpmux/sessions / _acpmux/watch call in optchat-chief without a limit goes through it: the link's watch, sessions() (the list fallback for session/find and agents), and agents.rs's bounded sessions_bounded (each page keeps its 1 s bound).
  • Tests: tests/acpmux_session_info.rs adds 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.rs adds a unit test that a list with a limit is 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):

Failing tests at the head, compared by name with the base:

Test Head Base (the merge-base 4a0b8f0 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 952bc60 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 4a0b8f0..952bc60 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

acpmux answers `_acpmux/sessions` and `_acpmux/watch` with no `limit` in
pages, each with the `nextCursor` of the rest, when the whole list is too
large for one message. A fake daemon answers in two pages: the link comes up
on both, a session only the second page lists is found, and a cursor the
daemon answers with again is refused. These fail on the Chief as it is, which
reads the first page only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-c11d09c9f41988fc1d93
@cursor

cursor Bot commented Oct 30, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

acpmux answers `_acpmux/sessions` and `_acpmux/watch` with no `limit` in
byte-bounded pages, each with the `nextCursor` of the rest, when the whole
list is too large for one message. The Chief read only the first page. One
helper, `whole_list`, now reads every page by `_acpmux/sessions` with the
same params (less the watch's `enabled`) from each cursor and joins the rows;
a cursor that comes again is refused so it never loops, and a call with a
`limit` stays one request. The link's watch, `sessions()` and the bounded
list in agents.rs all go through it. A list that fits is one reply with no
cursor, so older daemons work unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-c11d09c9f41988fc1d93
@blacksmith-sh

blacksmith-sh Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)/
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions github-actions Bot added the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 30, 2026
@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 952bc60: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr28297 -f ref=lane/acpmux-chief-clients-pages -f platform=macos -f backend_mode=local

web and size checks: green

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

@lawrencecchen for awareness, since you have the most recent commits on these Chief paths (optchat-chief/src/acpmux.rs, src/agents.rs, tests/acpmux_session_info.rs): this PR makes the Chief's acpmux client read a session list that acpmux #28182 sends in pages (nextCursor). The change is one helper, whole_list. The link's watch, sessions() and the bounded list in agents.rs go through it. A list that fits is still one request, so older daemons behave as before. A review is welcome but not required. It is held until #28182 lands and a fresh-home launch on a fleet Mac passes.

Separately, harness::the_chiefs_turn_and_compactor_sessions_carry_cmux_chief_and_children_do_not fails on the base as well (harness.rs:445, left: 5 right: 4). It is not caused by this PR.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (Codex gpt-6-astra, high, independent): SHIP at 952bc60. It found nothing to fix: every _acpmux/sessions / _acpmux/watch call with no limit goes through whole_list, a repeated cursor is refused, and the tests are red at the base and green with the fix.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Chief rule 2, the failing test by name on base itself: harness::the_chiefs_turn_and_compactor_sessions_carry_cmux_chief_and_children_do_not fails on the merge-base 4a0b8f0 exactly as at this PR's head: tests/harness.rs:445:9, assert_eq!(tags.len(), 4), left: 5 right: 4. Run: https://github.com/manaflow-ai/cmux/actions/runs/41050748089 (tested tree 943c5e5b, the merge-base's tree). It is the only failure in --test harness there (27 passed), an assertion, not a crash. So it is a base red, not this PR's.

Cause: turn_tags in optchat-chief/src/acpmux.rs adds cmux.chief.participant since #27935, so a turn session has 5 tags; the test still counts 4. This PR changes neither file.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Chief rule 2 at 952bc60: every failing check, compared by test name against base. This PR changes only Native/OptChat/optchat-chief/{src/acpmux.rs, src/agents.rs, tests/acpmux_session_info.rs}. None of these reds is a crash (no signal, abort or dead runner), and every one fails the same way on base.

Check Failing step / test at this head Base Verdict
rust workspaces / Native/OptChat/optchat-chief (job) harness::the_chiefs_turn_and_compactor_sessions_carry_cmux_chief_and_children_do_not, tests/harness.rs:445 (tags left 5, right 4) fails the same way on the merge-base itself (comment); the base fix #28316 has since landed base red
rust workspaces / rust workspaces "Every planned workspace passed" wrapper of the row above base red
cmux-next checks (job) check-state-roots: cmux-tui/crates/acpmux/src/cli/help_examples/session.rs:179 (a literal ~/.acpmux root), so "red check: No literal state roots" the same file, line and red check on base cc40c49 (job) base red
same job "3 commit(s) change the sidebar's drawing code without a Sidebar-Look: trailer": 4367c16, 6c1a5ab, eb8105b all three are feat-cmux-next commits before this PR's merge-base, not this PR's (its commits are 93fbd17 and 952bc60, Chief only) not this PR's
release-notary (job) test_the_repository_highlights_validate (chief-name-in-agent-chats.md), test_every_listed_hook_is_one_glaeda_released_with_the_check (hash 0de22d74… not found) the same two tests with the same assertions on base 8f5dfe0 (job) base red
Guard status "Check routed guard jobs" wrapper of release-notary base red

The other Chief rules at this head:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Chief rule 2 at the new head c97a42e (base 49cba34 merged in; the PR's own diff is unchanged, patch-id 203ff031): every failing check, compared by test name against base. The earlier classification at 952bc60 doesn't hold: that run's optchat-chief job stopped at its first failing binary, so it was cut short.

  • rust workspaces / Native/OptChat/optchat-chief passed this time and ran the whole workspace (job): 115 test binaries ok, 0 failed. That includes acpmux_session_info, harness, shared_acpmux, sub_watch and every subagent_* test. rust workspaces passed too (job).
  • Of 95 checks, only two failed. Both fail the same way on base 49cba34 itself, the base this head merged, and neither is a crash:
Check Failing tests at this head Base 49cba34 (job) Verdict
release-notary (job) test_the_repository_highlights_validate (chief-name-in-agent-chats.md); test_every_listed_hook_is_one_glaeda_released_with_the_check (hash e94edf9c… not found) the same two tests, the same assertions and the same hash base red
Guard status "Check routed guard jobs" wraps release-notary base red

The Astra SHIP at 952bc60 carries over by patch-id: the PR's own change is the same three optchat-chief files, byte for byte. The acpmux panic ratchet covers only cmux-tui crates, which this PR doesn't touch.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Fresh-home launch of c97a42e4074e on a fleet capture Mac (empty HOME, CFFIXED_USER_HOME, TMPDIR and defaults): PASS

Verdict PASS
Build fleet job 67ff54d67772fcc467897936 of c97a42e4074e
Validator scripts/ci/fresh_home_launch_smoke.py from feat-cmux-next at 45d6f7093d11
Home rendered 9.0s after launch
Up 30s
first_window_frame_committed 5221 ms
Crash reports / uncaught exceptions 0 / 0

Screenshot withheld: the pr-media privacy check or upload refused it.

cmux-ci fresh-home --job 67ff54d67772fcc467897936 --pr N (commit status cmux-ci/fresh-home on c97a42e4074e)

@teamleaderleo
teamleaderleo merged commit 27f2c06 into feat-cmux-next Oct 30, 2026
138 of 140 checks passed
@teamleaderleo
teamleaderleo deleted the lane/acpmux-chief-clients-pages branch October 30, 2026 17:16
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — c97a42e4 Deployed Oct 30, 2026 by teamleaderleo via wait for same-key tree publisher #84253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant