Repository navigation
ccusage opencode hangs on long-lived installs because --since/--until are ignored #1189
Description
Activity
github-actions commented
on May 29, 2026 on May 29, 2026 – with GitHub ActionsContributorMore actionsThis 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.
i'll check it. thanks
@pullfrog work on this.
Reacted by pullfrogImplemented 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_date- Both the SQLite row loop and JSON file loop skip out-of-range entries before the expensive
message_value_to_entrycall - 6 new tests cover exclusion, inclusion, bracket, and exact-match scenarios
- All 219 existing tests pass
PR: #1220
Task list (6/7 completed)
- Explore codebase to understand opencode adapter loader and where --since/--until are parsed vs used
- Add --since/--until filtering to opencode SQLite loader
- Add --since/--until filtering to opencode JSON file loader
- Add/update tests for filtered loading
- Run tests and lint checks
- Self-review and commit
- Push branch and create PR
| View workflow run | via Pullfrog | UsingDeepSeek Pro(free via Pullfrog for OSS) | 𝕏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-22
No usage data found -npx ccusage daily --since 2026-06-22 --until 2026-06-26@josephgrice
Author of the issue here. On the opencode side: the fix is up in #1188 - it combines the indexed SQLitetime_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.Reacted by Joe Gricelgtm
github-actions commented
on Jul 27, 2026 on Jul 27, 2026 – with GitHub ActionsContributorMore actions@justi approved for issues and PRs. Your future issues and PRs will not be auto-closed.
See CONTRIBUTING.md.
- addedtriage:resolvedResolved by a later change or current implementation.Resolved by a later change or current implementation.
on 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.

What happened?
The opencode adapter accepts
--since/--untilat the CLI but ignores them in the loader. The SQLite query has noWHEREclause and thestorage/message/*.jsonloop reads every file. On my install (largeopencode.db, a lot of legacy JSON files from before the SQLite migration)ccusage opencodenever returns; even bareccusagegets stuck on the OpenCode loader step.Steps to reproduce
ccusage opencode --since 2026-05-04 --until 2026-05-10 # never returnsA raw
sqlite3query withWHERE time_created BETWEEN ? AND ?against the same DB returns immediately. Themessagetable already has atime_createdindex.Expected behavior
With
--since/--untilset, 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.