Description
The opencode stats --days=X command, where X defines the time-window in days, correctly looks at all sessions that have been updated within the past X days. However, it considers all messages of these sessions when computing the statistics like total cost. I think the correct behavior should be to also only consider messages created within the last X days.
I have a fix coded for this and will raise a PR.
Plugins
No response
OpenCode version
1.4.3
Steps to reproduce
- When a new day begins and
opencode stats --days=0 reports 0 cost, choose any session you worked on prior to today.
- Look at the total cost reported of that session, assume the cost is 5$.
- Send a simple prompt that by itself should only cost a few cents.
- Run
opencode stats --days=0 again
- You will see a total cost reported that is greater than 5$
Screenshot and/or share link
Operating System
MacOS 26.3.1
Terminal
iTerm2
Description
The opencode stats --days=X command, where X defines the time-window in days, correctly looks at all sessions that have been updated within the past X days. However, it considers all messages of these sessions when computing the statistics like total cost. I think the correct behavior should be to also only consider messages created within the last X days.
I have a fix coded for this and will raise a PR.
Plugins
No response
OpenCode version
1.4.3
Steps to reproduce
opencode stats --days=0reports 0 cost, choose any session you worked on prior to today.opencode stats --days=0againScreenshot and/or share link
Operating System
MacOS 26.3.1
Terminal
iTerm2