Repository navigation
fix: expose API pagination metadata on stderr - #478
Conversation
|
LGTM |
commit: |
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 286.8 ms | 4.8 ms | 278.8 ms | 299.4 ms |
| base | 281.7 ms | 3.7 ms | 276.2 ms | 290.4 ms |
Δ (PR vs base): ↑ +5.2 ms (+1.8%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
There was a problem hiding this comment.
✅ Approved — I found no issues. The pagination metadata goes to stderr, stdout payloads are unchanged, --quiet suppresses the line, and tests and a changeset are included.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Low risk. The patch changeset fits a fix and follows the changeset rules. There is no version bump and no change to the release job.
🔒 Security: ✅ LGTM
No security concerns. Only result_info returned by the API is written to stderr.
📖 AGENTS.md: ✅ LGTM
Follows the repository conventions: notices go to stderr, payloads go to stdout, and a changeset is included for a user-facing fix.
📋 Code Quality: ✅ LGTM
Metadata is kept in a side WeakMap, and formatOutput writes it to stderr without changing what goes to stdout. The tests cover the main paths.
⚡ Performance: ✅ LGTM
The WeakMap lookup and one JSON.stringify of small metadata cost almost nothing.
📝 Documentation: ✅ LGTM
docs/architecture.md correctly describes the new stderr line and how to paginate by hand.
Reviewed commit: bd0b08b0
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Looks good to me
Although I don't particularly like how it's presented to the user, it doesn't feel very user friendly, personally I would prefer if it could be either opt-in or, for interactive sessions, presented, if possible, not as a plain json printed in the terminal but as a not user-friendly section with information.
Right now we are JSON first for |
List commands discard
result_info, leaving users without the cursor needed to request the next page. Preserve metadata through object responses and passthrough requests, then print a plainresult_info: {...}line on stderr while keeping stdout payloads unchanged.--quietsuppresses the notice.Add cursor reuse regression coverage for CASB findings, finding instances, policies, KV keys, and R2 buckets, plus coverage for offset counts and redirected output. Include a patch changeset and document manual pagination.
Validation
pnpm checkpassed, including generation, builds, workspace type checks, lint, and formatting.