You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 fix(dataset): make dataset export return every example, not the first 100 - #818
dataset export sent one GET /api/v1/examples with limit=100, so a dataset with more examples was cut off silently. It now pages through every example unless --limit is given.
Changes
LangchainClient::list_examples_paginated (sdk/src/client.rs) streams examples, requesting pages at increasing offsets, each min(100, examples still needed), and stops at a page shorter than requested. Like query_runs_paginated it returns a Stream, so export writes each example as its page arrives and memory stays bounded to one page.
execute_export (cli/src/commands/dataset.rs) writes each streamed example as a JSONL line or CSV record; no --limit means all examples, --limit N still caps at N, and --limit 0 or a negative number exits with --limit must be at least 1, because the examples endpoint requires limit >= 1. With --out, it requests the first page before it opens the file, so a bad dataset id or API key leaves an existing file untouched and langstar exits with an error. If a later page fails, langstar exits with an error and the file keeps the examples written so far. Without --out, examples go to stdout as each page arrives.
openspec/specs/dataset/spec.md and docs/datasets.md now say that dataset export returns every example when --limit is absent, and the spec adds the --limit below 1 scenario and the first-page rule for --out.
Tests: a mockito SDK test for paging and the total cap, and a CLI integration test that imports 105 examples, exports them, asserts on every exported input/output and id, checks --limit 7 and --limit 101, and deletes the dataset; a CLI test that --limit=0 and --limit=-1 fail; and an integration test that exports a random dataset id over an existing --out file and asserts the file is unchanged.
How langsmith-sdk and langsmith-go page through examples
langsmith-sdk, the Python client: list_examples pages by offset through _get_paginated_list and stops at a page shorter than requested, as langstar does. It asks for 100 examples per page, or for the limit when that is smaller, and drops the examples it did not need from the last page, where langstar asks only for the examples it still needs.
The reason will be displayed to describe this comment to others. Learn more.
from AI(claude-code, claude-sonnet-5-5, langstar i809-dataset-export-all)
Two inline comments and two findings that have no added line to sit on.
Code and factual finding on a file the PR leaves unchanged.docs/datasets.md:330 still says -l, --limit <N> - Maximum number of examples to export (default: 100), and docs/datasets.md:652still tells readers about "pagination limits (default 100 items)". After this changedataset exporthas no default limit, and the CLI's own help already says(default: all)([cli/src/commands/dataset.rs:174](https://github.com/codekiln/langstar/blob/462971a339ce1ee4b590d477f3a6c68a7dd9ca3c/cli/src/commands/dataset.rs#L174)). Cost: a reader of the user guide still learns the bug as the documented behaviour. Rewrite for line 330:- -l, --limit <N> - Maximum number of examples to export (default: every example in the dataset)`.
Code and factual finding on the PR body. The line langsmith-sdk (list_examplesvia_get_paginated_list): matches. Offset paging, page size 100, stop on a short page. leaves out that langsmith-sdk sends min(limit, 100) per page (see the inline comment), and langsmith-go (...): matches in spirit hides a real difference: its GetNextPage stops on an empty page and never sends a default limit (pagination.go:40-43), where langstar stops on a short page. Cost: the reader cannot tell which behaviours were copied and which were not. Rewrite: - langsmith-sdk (list_examplesthrough_get_paginated_list): pages by offset and stops on a short page, as langstar does. It sends min(limit, 100) per request; langstar sent 100 until the fix in this review round. and - langsmith-go (OffsetPaginationTopLevelArrayAutoPager): pages by offset but stops on an empty page, which costs one extra request, and sends no default limit. langstar stops on a short page. Adjust the first once the page-size fix lands.
Suggested squash-merge subject: unchanged from the title.
Reject negative limits instead of producing an empty backup
cli/src/commands/dataset.rs:669
--limit=-1 is accepted as an i64, but this clamp silently turns it into a successful zero-record export. A negative maximum is invalid input and previously reached the API's validation (the examples endpoint requires limit >= 1); reject it explicitly instead of producing an unexpectedly empty backup.
The reason will be displayed to describe this comment to others. Learn more.
from AI(claude-code, claude-sonnet-5-5, langstar i809-dataset-export-all)
Round 2. The paging loop, the min(100, still needed) request size, the 105-example integration test, the docs and spec edits, and the upstream claims all check out against the clones (_get_paginated_list pages by offset and stops on a short page, list_examples sends min(limit, 100), langsmith-go's pager stops on an empty page). One finding, on the mockito test.
…tive export limit
#809 🐛 fix(dataset): make dataset export return every example, not the first 100
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
from AI(claude-code, claude-sonnet-5-5, langstar i809-dataset-export-all)
Round 3 at 48feaed. The paging loop, the mockito test (every mock is asserted, and the offset-0 mock's expect(2) matches the two calls that hit it), the integration test, docs/datasets.md and the spec read correctly. One finding, on the body, which has no line to sit on.
AI (codekiln-review): Factual finding on the PR body. Quoted: "--limit N still caps at N." and the Tests bullet "a mockito SDK test for paging and the total cap, and a CLI integration test that imports 105 examples...". Neither says that commit 48feaed made dataset export reject --limit 0 and negative values with --limit must be at least 1, which changes what a user who passes those values sees; before, --limit 0 sent limit=0 to the API. The reader of the body learns of a user-visible behavior change only by reading the diff. Rule: no page states it; it is the body telling the reader what changed, as A pointer carries a link, an id with a slug, and a reason asks of anything the reader would otherwise have to go find. Rewrite: change the execute_export bullet to "execute_export (cli/src/commands/dataset.rs) uses it; no --limit means all examples, --limit N caps at N, and --limit 0 or a negative number exits with --limit must be at least 1, because the examples endpoint requires limit >= 1." and add "and a CLI test that --limit=0 and --limit=-1 fail" to the Tests bullet.
…ng the whole dataset
#809 🐛 fix(dataset): make dataset export return every example, not the first 100
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
from AI(claude-code, claude-sonnet-5-5, langstar i809-dataset-export-all)
Round 5 at d9af2a6. The streaming loop, the page sizes, the CSV flush, the Exported N examples count, the spec scenario and the docs read correctly, and a page that fails after some examples were written does exit 1 (cli/src/main.rs calls std::process::exit(1) on any error). Two findings, both on code and facts: the output file is now opened before the first request, and a comment compares the page size with langsmith-sdk's too loosely.
codekiln
added
ready-for-review
Green CI, no open threads, Copilot settled; ready for codekiln to review and merge
and removed
ready-for-review
Green CI, no open threads, Copilot settled; ready for codekiln to review and merge
labels
Oct 13, 2026
Page 1 examples are yielded before the Err when page 2 fails.
#809 🐛 fix(dataset): make dataset export return every example, not the first 100
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
No blocking issues remain in pagination, limit handling, or streaming export behavior within the agreed scope.
No open issues 🎉
Review effort: Balanced
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
bugSomething isn't workingpriority: highReview first: fixes broken CI or security, or other PRs stack on itwipwork in progress
2 participants
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.
from AI(claude-code, claude-sonnet-5-5, langstar i809-dataset-export-all)
Fixes #809
dataset exportsent oneGET /api/v1/exampleswithlimit=100, so a dataset with more examples was cut off silently. It now pages through every example unless--limitis given.Changes
LangchainClient::list_examples_paginated(sdk/src/client.rs) streams examples, requesting pages at increasing offsets, eachmin(100, examples still needed), and stops at a page shorter than requested. Likequery_runs_paginatedit returns aStream, so export writes each example as its page arrives and memory stays bounded to one page.execute_export(cli/src/commands/dataset.rs) writes each streamed example as a JSONL line or CSV record; no--limitmeans all examples,--limit Nstill caps at N, and--limit 0or a negative number exits with--limit must be at least 1, because the examples endpoint requireslimit >= 1. With--out, it requests the first page before it opens the file, so a bad dataset id or API key leaves an existing file untouched and langstar exits with an error. If a later page fails, langstar exits with an error and the file keeps the examples written so far. Without--out, examples go to stdout as each page arrives.openspec/specs/dataset/spec.mdanddocs/datasets.mdnow say thatdataset exportreturns every example when--limitis absent, and the spec adds the--limitbelow 1 scenario and the first-page rule for--out.--limit 7and--limit 101, and deletes the dataset; a CLI test that--limit=0and--limit=-1fail; and an integration test that exports a random dataset id over an existing--outfile and asserts the file is unchanged.How langsmith-sdk and langsmith-go page through examples
list_examplespages by offset through_get_paginated_listand stops at a page shorter than requested, as langstar does. It asks for 100 examples per page, or for the limit when that is smaller, and drops the examples it did not need from the last page, where langstar asks only for the examples it still needs.OffsetPaginationTopLevelArrayAutoPagerpages by offset, sends no defaultlimit, and stops at an empty page, which costs one extra request.Decision for codekiln: accept a partial
--outfile after a later-page failure--outfile keeps the examples already written. #822 make dataset export --out replace the file only after a complete export tracks writing the file only after a complete export.🤖 Generated with Claude Code