acpmux ls: --live, --name, --host; the plain view is the live sessions
Closed
TE
7d ago+535+535+012345678901234567890123456789-249-249-012345678901234567890123456789
Leo, 2026-10-29: "are the tools/commands/docs/etc clear and good enough for you guys? i feel like they could be better"
What was wrong
On a busy host acpmux ls --json lists 4,800+ sessions, mostly closed, which is far too much for an agent to read. The plain text acpmux ls printed every one of them too. An agent looking for "my live lanes" or "the sessions on host X" had to pull everything and filter it with jq.
What changes
- New filters on
acpmux ls. Each one narrows both the text and the--jsonoutput, and they combine with the existing--status,--pending,--tag,--since,--limitand--fields:--live: any status but closed. It is also sent to the daemon asexcludeStatus: ["closed"], so closed rows never cross the socket.--name REGEX: matches the session name (HOST/NAMEfor a peer's). A bad pattern is a usage error (exit 2).--host HOST: a peer's sessions, or this machine's (localor the machine name).
- Compact default for the text view only. With no filter,
acpmux lsprints the live sessions, newest first, at most 40, then one line that says what it left out and how to see it:
2660 more live and 300 closed not shown: --all lists every session; --live, --name REGEX, --host HOST, --status S or --limit N narrow it.
--allgives the old full table. Any filter prints every row it keeps. --fields a,b,calready existed. The docs now point agents atacpmux ls --json --live --fields name,status,peer.- Unflagged
acpmux ls --jsonis unchanged and still returns the full list. I checked the callers that read it: in this repo the acpmux integration tests; in our workspace tooling lane-place, pr-owner, orphan-sweep, lane-failover, the keep-going, stale-PR and sidebar reconcilers, review-report, the review-box reaper and acpmux_sessions. All of them use--jsonand several need every row. I found no caller that parses the text table. Command::Ls's flags and handler moved tocli/run/ls.rs(LsArgs), socommand.rsandrun/standard.rsshrink instead of growing. Both are already over the god-file ceiling on base.- README and the acpmux skill document the new flags.
Tests
cli::run::ls::tests:--live/--name/--hostrow filtering (peer, own machine name,local), bad regex as a usage error, and the compact view's rows plus its hidden-count note (including "no live sessions").tests/ls_selection.rsagainst a real daemon with a 3,000-session store, every tenth one closed:--json --livereturns 2,700 rows and none closed;--namewith--live;--host localand an unknown host; a bad--nameexits 2; a filtered text view lists every match; the plainlsis a header, 40 live rows and the note;--allis all 3,000. The existing checks still hold: unflagged--jsonreturns all 3,000 rows, and--limit/--fields/--sincework as before.
Observed / Not run
- Observed:
cargo check -p acpmux --testsandcargo clippy -p acpmux --testsare clean here, and the god-file check with--base origin/feat-cmux-nextreports no growth. - The test run is on CI (
cmux-ci test), linked in a comment below.
Agent session: agent session
š¤ Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Makes acpmux ls readable on a busy host: the plain text view now shows live sessions only, and new --live, --name, and --host flags narrow both text and JSON output.
- With no filter,
acpmux lsprints at most 40 live sessions, newest first, and a note saying what it hid and how to see it;--allrestores every session. - The new flags combine with the existing
--status,--pending,--tag,--since,--limit, and--fields; a bad--namepattern is a usage error (exit 2). - Unflagged
acpmux ls --jsonis unchanged and still returns the full list; no caller in this repo parses the text table. Command::Ls's flags and handler moved tocli/run/ls.rs, keepingcommand.rsandrun/standard.rsfrom growing further.
Tests
cli::run::ls::testscovers row filtering, a bad regex as a usage error, and the compact view's rows plus its hidden-count note.tests/ls_selection.rsruns against a real daemon with a 3,000-session store, every tenth one closed, including a fix so closed fixture sessions keep an event log (without one, the daemon treats them as purged and drops them at startup).