Skip to content

fix(cli): a real bundle pull whose filters keep nothing prints prose under --json #2800

Closed

Description

@yigitdot

A real (non-dry-run) decdn get 'decdn:<hash>/' --json whose --include/--exclude filters keep no entry prints a prose line on stdout, not JSON.

Where. pull_manifest hands the Planned::Nothing branch to PullObserver::nothing_to_fetch (crates/cli/src/commands/bundle_pull.rs), which calls report_nothing_to_fetch. That function always println!s no bundle entries match the include/exclude filters; nothing to fetch (or the empty-bundle / all-deselected line). It never checks --json, although PullObserver holds the flag.

Contrast. The dry run keeps --json machine-readable for the same empty set: it prints json_plan with count: 0 and an empty entries array, and no prose line. A real run that pulls entries prints its JSON summary. Only the real empty-set exit breaks the contract, so a script that parses --json stdout gets prose.

Repro. With a manifest in the output root's manifest cache (<out>/.decdn-bundles/<hash>.json), run decdn get 'decdn:<hash>/' -o <out> --json --exclude '**' --node-id <id> --provider-address <addr> <chain flags>. Stdout is the prose line. crates/e2e/tests/cli_bundle_pull_unmatched_warning.rs (#2790) reaches this exit with no node and no funds.

Fix sketch. Under --json, print a JSON object for the empty-set exit (the dry run's empty-plan shape, or the real run's summary with zero entries) instead of the prose line. Then add a --json run to the e2e above that parses stdout as JSON.

🤖 Generated with Claude Code

Activity

  1. added
    kind:bug
    area:cli
    prio:low
    on Oct 31, 2026
  2. moved this from Backlog to In progress in deCDNon Nov 1, 2026
  3. moved this from In progress to Done in deCDNon Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clikind:bugprio:low

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions