Fix session list cwd pagination#329
Open
OldKrab wants to merge 4 commits into
Open
Conversation
OldKrab
marked this pull request as ready for review
July 22, 2026 11:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session/listcwdfilter to Codex App Server'sthread/listsortKey: "updated_at"andsortDirection: "desc"limitunset so App Server keeps its default page sizecwdhandlingRoot cause
CodexAcpClient.listSessionsrequested a global App Server page, then filtered that page locally bycwd. A requested workspace could therefore receive an empty page with anextCursorbelonging to unrelated global results even when matching sessions existed on later pages.Passing the scalar ACP
cwdthrough tothread/listis compatible with both App Server forms and makes the returned page and cursor belong to the filtered result set. Local post-pagination filtering is removed because App Server now owns exact CWD filtering.The request also uses the same updated-at descending ordering as Codex CLI. The CWD, opaque cursor, and ordering parameters are forwarded on every page without specifying a page-size limit.
Empty CWD-filtered listings are valid for new worktrees, so they return immediately. The existing three-query diagnostics remain limited to an empty unfiltered global listing; this avoids turning one filtered request into four App Server scans.
Verification
npx vitest run src/__tests__/CodexACPAgent/list-sessions.test.tsnpm run typechecknpm test(329 passed, 28 skipped)npm run build