fix(list): emit informative truncation hint in all output modes (GH#3212)#3243
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…#3212) bd list silently truncated at --limit (default 50) with no reliable signal that results were hidden. The existing hint fired when len==limit, which both gave false positives (exact match count) and no warning for JSON consumers. Fetch one extra row (effectiveLimit+1) to detect truncation accurately, then emit a clearer one-line hint to stderr in all output modes — including --json, --format, pretty/tree, and agent mode — so downstream agents and scripts don't mistake a partial view for a complete one. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TestEmbeddedList/limit used CombinedOutput() to parse JSON, so it choked on the new stderr hint landing after the JSON array. Split stdout/stderr in bdListJSON, add bdListCapture helper, and add a limit_truncation_hint subtest covering GH#3212: - hint appears on stderr when --limit truncates - hint never leaks into stdout (JSON consumers) - no hint with --limit 0 or when results fit under the cap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The truncation-detection change fetches effectiveLimit+1 rows, but the watch loop re-ran SearchIssues with the bumped filter and never trimmed, so every refresh rendered one extra issue (e.g. 21 rows under --limit 20). Pass effectiveLimit to watchIssues and trim both the initial render and each refresh; also surface the truncation hint in watch mode so persistent watchers don't quietly show a partial view. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5e1903f to
d2d2b5e
Compare
mzlee
pushed a commit
to mzlee/beads
that referenced
this pull request
Apr 22, 2026
…212) (gastownhall#3243) * fix(list): show informative truncation hint and emit in JSON mode (GH#3212) bd list silently truncated at --limit (default 50) with no reliable signal that results were hidden. The existing hint fired when len==limit, which both gave false positives (exact match count) and no warning for JSON consumers. Fetch one extra row (effectiveLimit+1) to detect truncation accurately, then emit a clearer one-line hint to stderr in all output modes — including --json, --format, pretty/tree, and agent mode — so downstream agents and scripts don't mistake a partial view for a complete one. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(list): capture stdout/stderr separately; cover truncation hint TestEmbeddedList/limit used CombinedOutput() to parse JSON, so it choked on the new stderr hint landing after the JSON array. Split stdout/stderr in bdListJSON, add bdListCapture helper, and add a limit_truncation_hint subtest covering GH#3212: - hint appears on stderr when --limit truncates - hint never leaks into stdout (JSON consumers) - no hint with --limit 0 or when results fit under the cap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(list): trim +1 overflow row in --watch mode (review feedback) The truncation-detection change fetches effectiveLimit+1 rows, but the watch loop re-ran SearchIssues with the bumped filter and never trimmed, so every refresh rendered one extra issue (e.g. 21 rows under --limit 20). Pass effectiveLimit to watchIssues and trim both the initial render and each refresh; also surface the truncation hint in watch mode so persistent watchers don't quietly show a partial view. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
effectiveLimit+1rows so we can distinguish "exactly N matches" from "N+ matches truncated" without a second count query--json,--format, pretty/tree, and agent mode — closing the silent-data-loss gap called out in GH#3212Motivation
bd listdefaults to--limit 50and previously:len(issues) == limit, which false-positives when exactly N issues match--jsonmode, so agents consuming JSON couldn't tell a truncated view from a complete oneNew hint:
Closes #3212.
Test plan
make buildgo test -tags gms_pure_go ./cmd/bd/ -run TestListpassesbd listshows hint;bd list --jsonshows hint on stderr;--limit 100,--limit 0, and exact-count runs emit no hint (no false positives)🤖 Generated with Claude Code