Skip to content

Use --limit as page size when --page-size is not set - #1284

Open
yash251 wants to merge 1 commit into
temporalio:mainfrom
yash251:yash/1283-list-limit-page-size
Open

yash251 wants to merge 1 commit into
temporalio:mainfrom
yash251:yash/1283-list-limit-page-size

Conversation

@yash251

@yash251 yash251 commented Dec 5, 2026

Copy link
Copy Markdown

Related issues

Fixes #1283

What changed?

workflow list, activity list and nexus operation list only lowered the page size to --limit when --page-size was larger. --page-size defaults to 0, so --limit 3 on its own sent PageSize: 0 and got the server default page. With a remote codec, every payload in that page was decoded before the limit was applied.

Now the page size is set to --limit when --page-size is unset or larger than the limit. Passing --page-size below the limit still works as before.

The codec concurrency part of the issue (sdk-go interceptor) is not touched here.

Checklist

Stability

  • No breaking changes. Output is the same, only the request page size changes.

Tests

  • Added functional tests (SharedServerSuite) for all three commands. They capture the first list request with a client interceptor and check its PageSize for: no flags (0), --limit 1 (1), --limit 2 --page-size 5 (2), --limit 5 --page-size 2 (2), --page-size 3 (3).

Manual tests

Before the fix, the new tests fail on --limit 1 with expected: 1, actual: 0 for all three commands. After the fix:

$ go test ./internal/temporalcli -run 'TestSharedServerSuite/(TestWorkflow_List_LimitBoundsPageSize|TestActivity_List_LimitBoundsPageSize|TestNexusOperationList_LimitBoundsPageSize)$' -count=1
ok  	github.com/temporalio/cli/internal/temporalcli	1.274s

$ go test ./... -count=1
ok  	github.com/temporalio/cli/internal/temporalcli	158.702s
(all other packages ok)

workflow list, activity list and nexus operation list only lowered the
page size to --limit when --page-size was larger than it. --page-size
defaults to 0, so a plain --limit N still fetched (and codec-decoded) a
full server-default page before truncating.

Fixes temporalio#1283
@yash251
yash251 requested a review from a team as a code owner December 5, 2026 12:15
@CLAassistant

CLAassistant commented Dec 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T12:18:34.178789Z c72a7b5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

workflow list --limit N decodes a full default page through --codec-endpoint, serially, before applying the limit

2 participants