acpmux: _acpmux/sessions takes peer and status filters (paged), for the sidebar's Older row

Merged
TE
13d ago
+154-0

Leo, 2026-10-24, word for word: "the whole ACP MUX thing, like that, it should just be able to show me, say on my sidebar, right? Like we already discussed this, like with the cloud icon, the group where, you know, on a different machine or whatever, there's the other agent sessions, the other workspaces running, but you guys aren't doing that yet."

Follow-up to #24950. The sidebar's machine groups count and list only live chats. The coordinator's note: "closed and archived ones go behind an 'Older' row, capped and paged". The peers hold about 1,175 closed sessions, and the only way to read them was the whole _acpmux/sessions list (about 9 MB here).

Summary

  • _acpmux/sessions (and the page of _acpmux/watch, which shares session_list_reply) takes two optional filters: peer (only that acpmux peer's sessions) and status (only that status, e.g. closed).
  • The filters apply before keyset paging, so limit/cursor page through one machine's closed chats.
  • With no filter the reply is unchanged. An empty filter means no filter (as the schema allows); a non-string one is refused.
  • _acpmux/watch refuses peer and status with invalid params. Its events cover every session, so a filtered first page would promise a scope the events don't keep.
  • SessionsParams (schema, deny_unknown_fields) gains both fields. The spec IR and the web types (acpmux-protocol:codegen) are regenerated.
  • The regenerated IR also includes a titleSource field (with its default: null) that #24985 added to the schema without blessing the IR, so protocol_ir_is_current was red on base for that reason too.

The sidebar's Older row comes in a separate PR that uses this.

Testing

  • hub::session_pages::tests (unit, 4): filters before paging with a cursor; each filter alone; an empty filter is none; a watch refuses filters.
  • Fleet at fa77c01: cmux-tui-rust-check.sh all session_pages (fmt, clippy, 4/4 tests) and test protocol_ir_is_current both passed.
  • Review: Codex gpt-6-astra xhigh. BLOCK (watch scope, empty strings), both fixed, then SHIP at fa77c01.

No capture: daemon protocol only, no UI.

Risk: normal. The change is additive and optional request parameters only, with the read path's behavior unchanged when they're absent. No socket or relay policy changes.

Changelog

Changed: acpmux's session list can be narrowed to one machine and one status.

Agent session: cosmic-gray

šŸ¤– Generated with Claude Code