Skip to content

A --since date later than --until is accepted and prints an empty report #1729

Closed

Description

@ravsau

Summary

A window whose --since date is later than its --until date is not rejected. The report loads every entry, keeps nothing, and prints an empty table (or {"daily": [], "totals": {...}} with --json) with exit code 0. That looks like "no usage data" rather than a typo in the flags.

Reproduce

ccusage daily --since 2026-09-14 --until 2026-09-01
# empty table, exit 0
ccusage codex monthly --since 20260914 --until 20260901 --json
# {"monthly": [], "totals": {...}}, exit 0

Reproduced on main d341949 and on the published 20.0.20.

Expected

Reject the window before loading data, the same way #1604 rejects a bound that is not a real date:

The --since date '20260914' is later than the --until date '20260901'.
Run 'ccusage --help' for usage.

with exit code 2, for flags, config-file bounds, and a mix of both.

Notes

normalize_date_bound already stores both bounds as YYYYMMDD, so the check is a string comparison in ccusage-cli-parser after the command is parsed and config is applied. I have this implemented with tests and a docs line and will open the PR right after triage.

Activity

  1. pullfrog commented on Sep 15, 2026

    @pullfrog
    Contributor
  2. added
    bugSomething isn't working
    priority:lowMinor polish, documentation, or a low-impact edge case.
    triage:maintainableFits the repository's maintainable scope and needs review.
    on Sep 15, 2026
  3. added
    priority:mediumA normal bug or meaningful improvement.
    and removed
    priority:lowMinor polish, documentation, or a low-impact edge case.
    on Sep 15, 2026
  4. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    Pullfrog triage: priority:medium
    Kind: bug
    Maintenance fit: maintainable
    Confidence: high

    Inverted since/until window returns empty report with exit 0 instead of an error, which misreports usage as no data. Fix is bounded validation consistent with existing date validation, protecting core reporting.

    Decision: kept open.

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

    bugSomething isn't workingpriority:mediumA normal bug or meaningful improvement.triage:maintainableFits the repository's maintainable scope and needs review.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions