fix(acpmux): spec _acpmux/sessions paging fields

Merged
TE
17d ago
+74-5

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) and cursor to SessionsParams, and nextCursor (string or null, present only with limit) to SessionsResult. Both are in cmux-tui/crates/acpmux/src/protocol/session.rs.
  • Re-blesses spec/acpmux-protocol.json and regenerates webviews/.../protocol/generated/types.ts.
  • Picks up spec drift: the committed IR was already stale on feat-cmux-next. Two LifecycleReceipt doc 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_fields is committed first. It fails before the fix and passes after. cargo test -p acpmux --lib protocol_: 4/4 pass, including protocol_ir_is_current.
  • cargo fmt --check and cargo clippy -p acpmux --all-targets are clean.
  • bun run acpmux-protocol:check is current, tsc --noEmit is clean, and acpmux-codegen.test.ts passes.
  • scripts/verify-local.py --affected origin/feat-cmux-next: 9/10 pass. The only failure is localization, which is already red on the base branch (xcstrings needs_review parity errors, no catalog touched here).
  • Skipped: the full cargo test -p acpmux suite didn't run locally because the disk filled up. These Rust types only feed IR generation: the dispatcher serves serde_json::Value, so runtime behavior doesn't change.

Observed / Not run

  • Observed: cargo test -p acpmux --lib protocol fails on the base (protocol_sessions_names_its_page_fields: SessionsParams has no limit/cursor) and passes on this head (4/4). cargo test -p acpmux --test hub_integration session_list passes (3/3) on fba65e65. bun scripts/acpmux-protocol-codegen.ts --check reports 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-core routing build, fast-tier Swift build.
  • Not run: full cargo test -p acpmux suite locally; no Swift or app run (types are schema-only).

Changelog

none

Credit: original spec fix in #20894.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
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) and cursor to SessionsParams, plus optional nextCursor to SessionsResult.
  • Re-blesses spec/acpmux-protocol.json and regenerates the webview types.ts, also picking up two LifecycleReceipt doc-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/watch stays untyped (params: true); SessionsParams' docs note its page fields are shared with it.
  • Since the last summary, only merges of feat-cmux-next and a formatting-only autofix landed; no code changes.