Skip to content

docs(unstable-v2): say which order session/list returns and that cwd stays the same - #2882

Merged
benbrandt merged 1 commit into
mainfrom
docs/v2-session-list-order
Nov 19, 2026
Merged

benbrandt merged 1 commit into
mainfrom
docs/v2-session-list-order

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Two rules for session/list were missing from the v2 session list page.

  • Order. Nothing said in what order sessions are returned, so a Client could not show recent sessions from the first page.
  • Same filter while paging. The rule that a Client keeps the same cwd while it follows nextCursor was only in the unstable archive section of the draft page.

Changes

  • Order: Agents SHOULD return the sessions with the most recent activity first. It is on the sessions response field, in the stable page and its draft/ copy.
  • Same filter: the Pagination section says Clients keep the same cwd when following nextCursor, in both copies. The draft's archive section keeps its sentence, which also covers archived.
  • Schema descriptions: ListSessionsResponse.sessions and ListSessionsRequest.cwd state the same rules. This regenerates schema/v2/schema.json, schema/v2/schema.unstable.json and both schema.mdx pages. Only description text changes.

Notes

  • The order rule says "most recent activity" and does not name updatedAt. claude-agent-acp orders by the last user prompt when it knows it, and falls back to updatedAt.
  • claude-agent-acp already returns the most recent sessions first. codex-acp lists threads by Codex's recency_at key. The sort direction of that key was not confirmed. Checked on 2026-11-19 against the default branch of each repository.
  • The same-filter sentence carries no keyword, like the existing sentence for archived.

Checks

  • cargo clippy in the three configurations from npm run check, cargo test --all-features, and rustdoc with -D warnings pass.
  • Regenerating the schema a second time produces no diff.
  • Prettier, cargo fmt, the spellcheck script, and the link check pass.

…stays the same

The session list page did not say in what order `session/list` returns
sessions, so a Client could not show recent sessions from the first
page. The rule that a Client keeps the same `cwd` while it follows
`nextCursor` was only in the unstable archive section of the draft page.

- Say that Agents SHOULD return the sessions with the most recent
  activity first.
- Say in the Pagination section that Clients keep the same `cwd` when
  following `nextCursor`.
- State both in the schema descriptions of `ListSessionsResponse` and
  `ListSessionsRequest`.
@benbrandt
benbrandt requested a review from a team as a code owner November 19, 2026 09:23
@benbrandt
benbrandt enabled auto-merge (squash) November 19, 2026 09:24
@benbrandt
benbrandt merged commit 24bfeed into main Nov 19, 2026
13 checks passed
@benbrandt
benbrandt deleted the docs/v2-session-list-order branch November 19, 2026 09:29
@acp-release-bot acp-release-bot Bot mentioned this pull request Nov 19, 2026
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.

1 participant