You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ccusage opencode hangs on long-lived installs because --since/--until are ignored #1189
The opencode adapter accepts --since / --until at the CLI but ignores them in the loader. The SQLite query has no WHERE clause and the storage/message/*.json loop reads every file. On my install (large opencode.db, a lot of legacy JSON files from before the SQLite migration) ccusage opencode never returns; even bare ccusage gets stuck on the OpenCode loader step.
Steps to reproduce
ccusage opencode --since 2026-05-04 --until 2026-05-10
# never returns
A raw sqlite3 query with WHERE time_created BETWEEN ? AND ? against the same DB returns immediately. The message table already has a time_created index.
Expected behavior
With --since / --until set, the loader should only look at rows/files in that range and return in seconds.
Version
20.0.6
I have a patch + tests ready (it was auto-closed at #1188). Happy to wait for an OK before resubmitting it.
Reacted by Chris Hasiński, Zachary Cutlip and Chris Ella
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.
@josephgrice
Author of the issue here. On the opencode side: the fix is up in #1188 - it combines the indexed SQLite time_created push-down with content-based JSON filtering, and it's just waiting on a maintainer "Approve and run" for CI.
Your case looks like a different one, though: ccusage daily (without an agent name) reads the Claude Code logs, not opencode, so the #1188 fix won't touch it. If --since X --until Y returns "No usage data found" on Claude data while --since X alone works, that sounds like a separate --until handling problem in the default adapter. Might be worth opening a separate issue with your ccusage version so it doesn't get tangled up with the opencode one here.
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current main implementation covers this request. This item is kept for history and does not need to be reopened.
Activity
github-actions commentedon May 29, 2026
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
ryoppippi commentedon May 29, 2026
i'll check it. thanks
ryoppippi commentedon Jun 6, 2026
@pullfrog work on this.
pullfrog commentedon Jun 6, 2026
Implemented pre-filtering by
--since/--untilin the opencode loader atrust/crates/ccusage/src/adapter/opencode/loader.rs.extract_message_timestampquickly pulls the millis timestamp from raw JSON strings without full deserializationtimestamp_within_rangecompares againstshared.since/shared.untilusing the same date-string comparison asfilter_loaded_entries_by_datemessage_value_to_entrycallPR: #1220
Task list (6/7 completed)
DeepSeek Pro(free via Pullfrog for OSS) | 𝕏josephgrice commentedon Jun 29, 2026
Any update on this? Mine does not hang when providing
--untilbut it does result inNo usage data found.Works -
npx ccusage daily --since 2026-06-22No usage data found -
npx ccusage daily --since 2026-06-22 --until 2026-06-26justi commentedon Jun 29, 2026
@josephgrice
Author of the issue here. On the opencode side: the fix is up in #1188 - it combines the indexed SQLite
time_createdpush-down with content-based JSON filtering, and it's just waiting on a maintainer "Approve and run" for CI.Your case looks like a different one, though:
ccusage daily(without an agent name) reads the Claude Code logs, not opencode, so the #1188 fix won't touch it. If--since X --until Yreturns "No usage data found" on Claude data while--since Xalone works, that sounds like a separate--untilhandling problem in the default adapter. Might be worth opening a separate issue with your ccusage version so it doesn't get tangled up with the opencode one here.ryoppippi commentedon Jul 27, 2026
lgtm
github-actions commentedon Jul 27, 2026
@justi approved for issues and PRs. Your future issues and PRs will not be auto-closed.
See CONTRIBUTING.md.
ryoppippi commentedon Aug 31, 2026
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.