Skip to content

fix(api): follow all pod and endpoint cursor pages - #688

Open
feiiiiii5 wants to merge 1 commit into
runpod:mainfrom
feiiiiii5:codex/fix-sdk-list-pagination
Open

feiiiiii5 wants to merge 1 commit into
runpod:mainfrom
feiiiiii5:codex/fix-sdk-list-pagination

Conversation

@feiiiiii5

Copy link
Copy Markdown

get_pods() and get_endpoints() promise all resources but return only the first REST v2 page. Accounts with additional pages silently lose pods or serverless endpoints from these lists.

Follow pagination.hasNextPage and nextCursor through a shared private loop, matching the CLI's existing behavior for the same endpoints. Every request retains the API key and uses the existing REST transport, so later-page errors propagate.

Six regressions use the public SDK functions and a local HTTP server. On main (a677ee9), three truncate the list and three miss a second-page 503. After the fix, 109 related tests and the full suite (2,739 tests + 6 subtests, 94.28% coverage) pass on Python 3.12.8.

Validation
  • pytest -o addopts= -q tests/test_api/test_ctl_commands.py tests/test_api/test_rest.py: 109 passed.
  • pytest -q: 2,739 passed, 6 subtests passed; the configured 90% coverage gate passes.
  • Black checks pass for the production file and REST tests. The other test file has one untouched long function declaration with the identical Black finding on main; it is unchanged.
  • Python compilation and git diff --check pass. No live RunPod API or paid resources were used.

This branch has not been deployed

No deployments
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