Skip to content

[Medium] --limit -1 silently returns default results instead of rejecting #169

@Nicolai1205

Description

@Nicolai1205

Summary

Passing --limit -1 does not produce a validation error. The CLI silently falls back to the default page size (10 results) with no warning or error.

Repro

nansen research smart-money netflow --chain solana --limit -1

Output: 10 results returned as if --limit was not passed. No error, no warning, exit code 0.

Expected

{"success":false,"error":"--limit must be a positive integer","code":"INVALID_PARAMS"}

Why it matters

Agents constructing dynamic queries may produce negative limits through arithmetic. Silent fallback to default masks the bug and returns unexpected data. The related case (--limit 0) does produce an error, but exposes the internal API field path (body -> pagination -> per_page) rather than referencing the --limit flag.

Found during

Clawfooding session on v1.10.1. Referenced in PR #167.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions