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
[bug] Token usage info WAY off, failed request #174
just tried to use opencode to generate me some overviews and dunno what exactly happened, but the token usage is WAY off and the request failed. Even the TUI flickered for som reason while "working..." showed at the bottom - there also were 2 prompts at the same time (there were two subfolders, so it created 2 agents??) - might be a feature (not sure).
Obviously, also the price was higher - no $0.01, but $0.18.
And even the Anthropic Usage info, so you see the difference in token usage and at the bottom - blocked API calls...
Here are the logs - it sent a quite a lot of requests too (blurred the request ids just in case):
EDIT: yup, it spawned 2 child sessions and everything was going off at the same time - both produced $0.06 (which still doesnt add up to $0.18 of costs, but we're getting there) and around 20k of tokens each - everything together created a lot of load on the API - this thing should/could be handled somehow on the opencode's side IMHO - to detect the size before sending it off (maybe an Anthropic API mode VS the Claude Pro/Max mode where it compresses more agressively)
Even the TUI flickered for som reason while "working..." showed at the bottom
Not sure if related, but I noticed this same "flickering" in the TUI. It happened for about 20 seconds (or so) rapidly while this "TASK ..." message was shown. As if stuff was happening in the background. Eventually it stopped and then displayed the last message shown in my screenshot.
I use a proxy so was monitoring the requests it was sending during this time and while it sent multiple (a few) it definitely was NOT spamming a bunch of API calls... this leads me to believe it was maybe doing tool calls locally or mcp stuff or something in the background?
Activity
[-][bug] Token use WAY off[/-][+][bug] Token usage info WAY off, failed request[/+]akuuly-7 commentedon Jun 17, 2025
Going to bed, gonna come back in around 10 hours time (if any input is needed)
thdxr commentedon Jun 18, 2025
if possible can you open up the session again and do
/shareand see if the cost listed on that page is the same?akuuly-7 commentedon Jun 18, 2025
Didn't change much on the last message, but it worked and produced an output :) See the share link
akuuly-7 commentedon Jun 18, 2025
The compacting command from #180 could help :)
GitMurf commentedon Jun 18, 2025
Not sure if related, but I noticed this same "flickering" in the TUI. It happened for about 20 seconds (or so) rapidly while this "TASK ..." message was shown. As if stuff was happening in the background. Eventually it stopped and then displayed the last message shown in my screenshot.
I use a proxy so was monitoring the requests it was sending during this time and while it sent multiple (a few) it definitely was NOT spamming a bunch of API calls... this leads me to believe it was maybe doing tool calls locally or mcp stuff or something in the background?
akuuly-7 commentedon Jun 19, 2025
Just tried using OpenRouter and this is the result:
Percentages and cost don't seem right at all. Here are the real ones (also why was the last prompt 33k tokens :D):
Share doesn't really work either, throws a 500... But here's the link anyway: https://dev.opencode.ai/s/7c052e39
EDIT: a rather simple prompt to make a change in an ETL script cost me 2 dollars and used 500k tokens
thdxr commentedon Jun 19, 2025
the % is off because when you configure a custom provider + model you have to specify what the max content length is
i'm looking into getting openrouter to use input token caching though
thdxr commentedon Jun 19, 2025
i got it working and it's released in 0.1.94 - i can see in the openrouter dashboard caching is drastically decreasing cost
going to close this issue for now because it's mixing a few different problems - feel free to reopen more specific ones
Local test merge of PR anomalyco#174: fix: update Dockerfile to use r…
refactor: move embedded patterns from agents to skills (anomalyco#174)
restart engine when user switch workspace. fix issuse anomalyco#174 (a…
fix(ci): merge desktop manifest and R2 cache TTL (anomalyco#174)