Skip to content

fix(cli): report every saved session in session_list total, not just the limited page - #4344

Merged
ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/session-list-total
Oct 21, 2026
Merged

ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/session-list-total

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Summary

session_list sets total after applying limit, so total always equals the number of returned sessions. ruflo session list then prints Showing 10 of 10 sessions even when 30 sessions are saved, and MCP callers can't tell that the list was cut off.

This is the same pattern that #4324 fixed for task_list.

Change

mcp-tools/session-tools.ts: count the sessions before slice(0, limit) and return that as total. The returned sessions array, the sort and limit are unchanged.

Tests

New __tests__/session-list-total.test.ts (temp CLAUDE_FLOW_CWD, 4 sessions saved through session_save):

  • limit: 2 returns 2 sessions with total: 4
  • with no limit, total equals the number of returned sessions

Before the fix the first test fails (total is 2); after it, both pass. The other __tests__/session-*.test.ts files give the same results with and without the change.

This change was prepared with AI assistance; I reviewed the diff and verified it by running the tests above.

@kevin9327
kevin9327 requested a review from ruvnet as a code owner October 21, 2026 06:10
@ruvnet
ruvnet merged commit 86a44c5 into ruvnet:main Oct 21, 2026
111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants