Skip to content

chat: Follow task-list pagination links - #344841

Closed
Osvaldo Ortega (osortega) wants to merge 2 commits into
mainfrom
osortega/agents/task-list-cursor-pagination
Closed

Osvaldo Ortega (osortega) wants to merge 2 commits into
mainfrom
osortega/agents/task-list-cursor-pagination

Conversation

@osortega

@osortega Osvaldo Ortega (osortega) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Cloud sandbox discovery currently checks whether another task-list page exists but constructs that request by incrementing a page number. This ignores cursor-based continuation URLs.

  • Follow the returned Link: rel="next" URL until no continuation remains, including after empty pages.
  • Resolve relative cursor links against the current request and preserve legacy numbered-page filters and API routing.
  • Support quoted or unquoted relation parameters in any parameter position in the shared Link parser, without splitting quoted values or URL targets at embedded delimiters.
  • Reject malformed, unsafe, or repeated continuations while retaining cancellation, retries, and partial-result handling.
  • Add regression coverage for full and incremental cursor walks across all discovery scopes, header variants, empty pages, legacy links, cycles, and cancellation. Malformed-continuation tests verify cached sessions and the refresh checkpoint are preserved.

Validation

Validated on macOS with Node.js 24.22.1 and refreshed transpiled output:

  • npm run test-browser-no-install -- --run src/vs/platform/github/test/common/githubResponse.test.ts --run src/vs/platform/github/test/common/localApiRequestProvider.test.ts --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxApiService.test.ts --browser chromium --reporter dot — passed, 645 tests.
  • npm run test-node -- --run src/vs/platform/github/test/node/missionControlClient.test.ts --run src/vs/platform/github/test/node/pullRequestQueryService.test.ts --reporter dot — passed, 133 tests.
  • npm run eslint -- src/vs/platform/github/common/githubResponse.ts src/vs/platform/github/test/common/githubResponse.test.ts src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxApiService.test.ts — passed.
  • Commit hygiene hook — passed.

The new parser/checkpoint regression checks reproduced four failures before the shared-parser fix. Full build/type-check and live-service verification were not run.

Follow server-provided continuation URLs when discovering cloud sandbox sessions instead of reconstructing numbered pages. Preserve legacy filters and endpoint routing, and reject unsafe or repeated continuations.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The continuation parser rejects previously supported link formats, silently truncating pagination and risking cached-session eviction and checkpoint advancement past unread tasks.

1 open issue
What changed in this PR

Updates cloud sandbox discovery to follow task-list continuation URLs instead of incrementing page numbers, enabling cursor-based pagination.

Changes:

  • Follows relative and absolute continuation links, including through empty pages.
  • Preserves legacy numbered-page filters and API routing while rejecting unsafe or repeated URLs.
  • Adds regression coverage for full and incremental discovery, cancellation, and partial-result handling.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxApiService.test.ts Adds pagination regression tests and updates existing fixtures.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxApiService.ts Follows and validates continuation URLs while preserving legacy routing and filters.

Review effort: Balanced

Recognize unquoted and reordered relation parameters in pagination links. Reject malformed advertised continuations so incomplete discovery cannot evict cached sessions or advance its checkpoint.

Co-authored-by: Copilot <[email protected]>
}
}
// Separate repository scopes include workspace-less sandboxes as well as repository sessions.
for (const { withRepository, archived } of targeted ? [] : [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still makes 4 list calls per pass every 60s per window, which is currently what is causing the saturation of CMC's Redis I believe, so i don't know if this is the fix

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was supposed to point at lines 636 - 639 🤦

@A-Georgiou

Copy link
Copy Markdown

At cloudSandboxSessionContribution.ts:304 can we please poll every 5+ minute with jitter regardless of the feed, skip users with no sandboxes, and back off on slow or 5xx responses?

@osortega

Copy link
Copy Markdown
Contributor Author

Closing this PR in favor of migrating to the new service that handles this already Dmitriy Vasyura (@dmitrivMS) will create a PR for it

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.

3 participants