fix(acpmux): spec _acpmux/sessions paging fields
Summary
_acpmux/sessions and _acpmux/watch both page through hub::session_pages::session_list_reply. They take limit and cursor, and with limit the reply carries nextCursor. The protocol IR didn't match: it declared SessionsParams as {} with deny_unknown_fields, and SessionsResult had no nextCursor. As a result, the generated web type was Record<string, never>, and sessionPages.ts / AllChatsList.tsx read nextCursor around the types.
This PR:
- Adds
limit(minimum 1) andcursortoSessionsParams, andnextCursor(string or null, present only withlimit) toSessionsResult. Both are incmux-tui/crates/acpmux/src/protocol/session.rs. - Re-blesses
spec/acpmux-protocol.jsonand regenerateswebviews/.../protocol/generated/types.ts. - Picks up spec drift: the committed IR was already stale on
feat-cmux-next. TwoLifecycleReceiptdoc comments had changed in Rust without a regenerate, and blessing pulls them in. Those lines are comments only.
_acpmux/watch stays untyped (params: true), as it is today. Its docs on SessionsParams say the page fields are the same. The rest of #20894's typing work is out of scope here.
This is re-cut from #20894, which now conflicts with this branch.
Verification
- Regression test
protocol_sessions_names_its_page_fieldsis committed first. It fails before the fix and passes after.cargo test -p acpmux --lib protocol_: 4/4 pass, includingprotocol_ir_is_current. cargo fmt --checkandcargo clippy -p acpmux --all-targetsare clean.bun run acpmux-protocol:checkis current,tsc --noEmitis clean, andacpmux-codegen.test.tspasses.scripts/verify-local.py --affected origin/feat-cmux-next: 9/10 pass. The only failure islocalization, which is already red on the base branch (xcstringsneeds_reviewparity errors, no catalog touched here).- Skipped: the full
cargo test -p acpmuxsuite didn't run locally because the disk filled up. These Rust types only feed IR generation: the dispatcher servesserde_json::Value, so runtime behavior doesn't change.
Observed / Not run
- Observed:
cargo test -p acpmux --lib protocolfails on the base (protocol_sessions_names_its_page_fields: SessionsParams has nolimit/cursor) and passes on this head (4/4).cargo test -p acpmux --test hub_integration session_listpasses (3/3) on fba65e65.bun scripts/acpmux-protocol-codegen.ts --checkreports generated code current. CI: protocol contract, rustfmt, acpmux Windows build pass. - Base reds, not this PR:
cmux-next checks(state roots, concurrency, type scale, motion, l10n; also red on base 7e5d0b10, fixes in #22101), web markdown eager-JS budget (#22116), Windows cmux-tui-coreroutingbuild, fast-tier Swift build. - Not run: full
cargo test -p acpmuxsuite locally; no Swift or app run (types are schema-only).
Changelog
none
Credit: original spec fix in #20894.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Specifies the _acpmux/sessions paging fields (limit, cursor, nextCursor) in the protocol IR so typed clients can send and read them. Previously SessionsParams was {} and SessionsResult had no nextCursor, leaving the generated web type as Record<string, never>.
- Adds optional
limit(minimum 1) andcursortoSessionsParams, plus optionalnextCursortoSessionsResult. - Re-blesses
spec/acpmux-protocol.jsonand regenerates the webviewtypes.ts, also picking up twoLifecycleReceiptdoc-comment changes the committed spec had drifted from — comments only, no behavior change. - Adds a regression test that fails before the fix and passes after.
_acpmux/watchstays untyped (params: true);SessionsParams' docs note its page fields are shared with it.- Since the last summary, only merges of
feat-cmux-nextand a formatting-only autofix landed; no code changes.