Skip to content

feat(core): support numbered pagination without continuation tokens - #1801

Open
Yuzu02 wants to merge 10 commits into
alchemy-run:mainfrom
Yuzu02:feat/core-numbered-pagination
Open

Yuzu02 wants to merge 10 commits into
alchemy-run:mainfrom
Yuzu02:feat/core-numbered-pagination

Conversation

@Yuzu02

@Yuzu02 Yuzu02 commented Nov 29, 2026 •

Copy link
Copy Markdown

Refs #1800.

Doppler's list groups endpoint (GET /v3/workplace/groups?page=1&per_page=20) returns a groups collection without a continuation token (pinned OpenAPI spec).

This adds items-only numbered pagination to the existing strategy and codegen profiles. It reuses the existing path helpers, continues through short pages, and stops at an empty or repeated consecutive collection. Existing pagination signatures and other strategies are unchanged.

Validated: 1,518 core/codegen tests, local runtime checks, typecheck, lint, and regeneration of the pinned Doppler SDK. Full merge-queue regeneration remains pending.

Note

This comment was left by an agent on behalf of @Yuzu02
model: Claude Mythos 5.2
harness: T3 code

As an agent I have read the CONTRIBUTING.md and AGENTS.md and understand the risks of getting @Yuzu02 flagged as untrustworthy if I regularly violate the outlined rules

Expose SdkError on pagination strategies instead of casting it into arbitrary operation errors. Reuse Effect collection traversal and immutable record updates without copying each nested record twice.
Keep stream completion, operation errors, and requirements in their native Effect channels. Reject unsafe numeric pages in both page modes and exercise the REST operation and interruption boundaries.
@Yuzu02 Yuzu02 changed the title feat(core): support numbered pagination without continuation tokens feat(core)!: support numbered pagination without continuation tokens Nov 30, 2026
@Yuzu02
Yuzu02 marked this pull request as ready for review November 30, 2026 00:59
github-actions Bot added a commit that referenced this pull request Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks: PR 95457431c vs main b62da6707

  • 🔴 Bundle size 66.4 KB: +1.0% (+669 B), bigger than main
  • ⚪ Runtime speed 4.1 µs: +16.3% (+0.6 µs), same as main
  • ⚪ Runtime memory 937.2 KB: +0.5% (+4.4 KB), same as main
  • ⚪ Objects at import 1,380: +0.1% (+1), same as main
  • ⚪ Whole-SDK memory aws 41.0 MB (+0.0%), cloudflare 8.33 MB (−0.2%), gcp 30.6 MB (+0.0%)
  • ⚪ Repo size 640.1 MB tracked in 10,644 files, same as main (+14.4 KB). .generated-specs/ 0 B, src/services/ 605.1 MB, everything else 35.0 MB.

sdk-memory

bundle-programs

memory-programs

bundle memory
speed objects

Numbers
Metric Change vs main Programs
Bundle (gzip) 11 worse 18
Import heap no change 15
Objects at import no change 15
Added latency (p50) ¹ no change 15
Import time ¹ no change 15
First call ¹ no change 15
Program Call Bundle (gzip) Import heap Objects at import Added latency (p50) Import time First call
aws s3.listBuckets 83.2 KB (+0.8%) 🔴 1.5 MB 2,134 23.1 µs 16.5 ms 8.0 ms
aws~awsJson1_0 dynamodb.listTables 75.3 KB (+0.8%) 🔴 1.4 MB 2,067 13.3 µs 15.8 ms 6.0 ms
aws~awsJson1_1 kms.listKeys 74.6 KB (+0.8%) 🔴 1.3 MB 2,014 12.7 µs 15.8 ms 6.3 ms
aws~awsQuery sts.getCallerIdentity 75.3 KB 1.3 MB 1,968 16.8 µs 15.3 ms 6.9 ms
aws~ec2Query ec2.describeRegions 75.4 KB 2.8 MB 3,104 15.5 µs 23.1 ms 7.3 ms
aws~restJson1 lambda.listFunctions 76.8 KB (+0.8%) 🔴 1.4 MB 2,090 12.9 µs 16.4 ms 7.5 ms
azure resources.ListTenants 64.8 KB (+1.0%) 🔴 — — — — —
azure~AzureDataPlaneProtocol maps-render.GetRenderMapStaticImage 69.9 KB — — — — —
cloudflare workers.listScripts 74.1 KB (+0.9%) 🔴 1.0 MB 1,536 2.7 µs 11.0 ms 3.9 ms
cloudflare~CloudflareProtocol ips.listIps 53.4 KB 802.5 KB 1,380 2.2 µs 10.2 ms 3.1 ms
fly-io machines.getRegions 53.5 KB 805.4 KB 1,135 3.7 µs 8.6 ms 3.1 ms
fly-io~FlyApiProtocol mpg.listUsers 53.4 KB 691.4 KB 1,025 2.6 µs 8.0 ms 3.0 ms
fly-io~SpritesProtocol sprites.listSprites 54.5 KB (+1.2%) 🔴 746.5 KB 1,066 4.1 µs 8.4 ms 3.0 ms
gcp storage_v1.listBuckets 55.7 KB (+1.2%) 🔴 915.2 KB 1,345 4.8 µs 9.3 ms 3.2 ms
github gists.list 56.9 KB (+1.1%) 🔴 682.9 KB 1,004 2.7 µs 7.9 ms 3.3 ms
neon neon.listProjects 55.6 KB (+1.2%) 🔴 786.4 KB 1,055 2.5 µs 8.3 ms 3.4 ms
resend resend.listLogs 55.4 KB (+1.2%) 🔴 899.6 KB 1,206 2.7 µs 8.5 ms 3.0 ms
stripe stripe.GetFiles 52.8 KB — — — — —

PR 95457431c against main b62da6707 (main's cached run from 2026-11-29 07:39 UTC). 18 programs, measured in 86 s on 8 vCPU.

Package Tarball Unpacked Files
aws 18.4 MB 147.7 MB 2985
cloudflare 6.0 MB 60.4 MB 840
core 361.8 KB (+0.4%) 1.4 MB (+0.3%) 244
dev 444.8 KB (+0.2%) 2.0 MB (+0.2%) 229
fly-io 268.5 KB 1.6 MB 71
gcp 37.8 MB 283.7 MB 3253
github 2.2 MB 19.9 MB 338
neon 248.1 KB 1.3 MB 58
resend 175.9 KB 1.1 MB 57
Tracked files Size Change vs main Files
services 605.1 MB ±0 B 3,287
in-tree-specs 299.6 KB ±0 B 10
patches 10.9 MB ±0 B 4,516
handwritten 11.5 MB +14.4 KB 2,079
benches 9.6 MB ±0 B 209
other 2.7 MB ±0 B 543
Total 640.1 MB +14.4 KB 10,644

What a checkout or worktree writes to disk, from git ls-tree (benches/repo-size/tree.ts). The dashboard's Repo size page has the full picture.

Effect alone: effect-minimal bundle 8.5 KB gzip, hand-written effect-http call 49.9 KB gzip; effect import 73.8 ms and 12.9 MB heap; bare mocked HTTP roundtrip 10.6 µs p50.

Bundled (from src/): resend, neon, github, fly-io, aws, cloudflare, gcp, azure, stripe, dev. Built and probed (from lib/): resend, neon, github, fly-io, aws, cloudflare, gcp, dev. Changed in this PR: dev. No target in targets.json: dev.

Job time: bundle 7.0 s, build: tsrs 2.0 s, build: bundle-lib 34.6 s, build: strip-lib-docs 0.2 s, build 36.7 s, size 6.1 s, runtime 31.1 s, providers 5.4 s.

¹ Timings run on a different runner than main's, so 🟡 marks a large move that may still be noise. Sizes, heap and object counts are stable. Offline: every call hits a canned in-memory response. Full suite: node benches/sdks/run.ts. Job log

@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

@distilled.cloud (129)
pnpm install https://pkg.distilled.cloud/@distilled.cloud/acme/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/adyen/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/anthropic/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/apache-superset/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/archil/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/argocd/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/auth0/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/aws/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/aws4signer/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/axiom/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/azure/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/bitbucket/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/boat-dev/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/boxd/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/browserbase/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/celld/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/chronosphere/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/clerk/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/clickhouse-cloud/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/cloudflare/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/coinbase/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/coinflow/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/convex/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/coolify/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/core/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/customerio/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/datadog/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/daytona/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/digitalocean/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/discord/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/docker/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/dokploy/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/doppler/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/e2b/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/elasticsearch/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/entire/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/exa/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/expo-eas/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/fly-io/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/forgejo/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/gcp/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/github/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/google-workspace/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/grafana/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/growthbook/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/gusto/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/hetzner/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/hostinger/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/huggingface/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/hydradb/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/iceberg/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/infisical/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/inngest/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/intercom/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/jira/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/kubernetes/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/launchdarkly/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/linear/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/mailchimp/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/meilisearch/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/mercury/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/metabase/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/microsoft-graph/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/modal/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/modrinth/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/mollie/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/mongodb-atlas/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/mux/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/namespacelabs/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/neon/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/netbird/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/notion/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/npm/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/okta/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/onepassword/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/opencode/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/opensearch/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/ovh/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/paypal/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/plaid/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/planetscale/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/polar/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/polymarket/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/porkbun/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/posthog/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/prisma/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/proxmox/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/questrade/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/railway/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/redis-cloud/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/remote/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/render/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/resend/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/revenuecat/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/rivet/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/s2/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/s3/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/scaleway/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/sentry/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/slack/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/spacetimedb/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/sproutboat/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/squarespace/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/stackit/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/starburst-galaxy/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/steel/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/stripe/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/supabase/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/surrealdb/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/tailscale/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/technitium/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/temporal/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/tencentcloud/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/tinybird/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/trigger-dev/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/turbopuffer/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/turso/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/twitch/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/typesense/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/unifi/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/unkey/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/vanta/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/vercel/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/whatsapp/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/whop/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/workos/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/xata/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/zendesk/pr:1801:9545743
pnpm install https://pkg.distilled.cloud/@distilled.cloud/zerossl/pr:1801:9545743

Published Nov 30, 2026, 3:32 AM UTC. Expires Dec 7, 2026, 3:32 AM UTC, extended while this pull request is open.

@Mkassabov

Copy link
Copy Markdown
Collaborator

A few things

  1. can we add a guard to prevent this getting stuck in a loop (see how we handle this on cloudflare which has one of these)
  2. you seem to be refactoring a lot of shared code here; if thats needed (which looking at it a lot of it seems to not be needed) it should be done in a separate PR. A lot of what you are trying to do here I think is already doable with getItems rather than reworking the path utilities

@Mkassabov
Mkassabov marked this pull request as draft November 30, 2026 03:32
Address review by reusing existing path and item helpers for items-only page traversal. Stop before emitting a repeated collection, retain existing strategy signatures and behavior, and limit generator validation to the new mode.
Use Effect Record.get for the new strategy lookup. Keep the existing runtime test suite unchanged pending maintainer approval for additional runtime tests, per AGENTS.md rule 9; the new generator contract tests remain.
@Yuzu02 Yuzu02 changed the title feat(core)!: support numbered pagination without continuation tokens feat(core): support numbered pagination without continuation tokens Nov 30, 2026
@Yuzu02

Yuzu02 commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

Thanks for the pointers! I've dropped the shared refactors, reused getItems, and added a guard for repeated collections. Local checks are passing now!
(っ˘ω˘ς)

@Yuzu02
Yuzu02 marked this pull request as ready for review November 30, 2026 05:34
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