codexbar-gnome icon indicating copy to clipboard operation
codexbar-gnome copied to clipboard

[Bug] GUI shows no output for openrouter provider (CLI works correctly)

Open jxxcr opened this issue 6 months ago • 3 comments

I encountered a bug while using it. When using the openrouter provider, there is no output in the GUI. I can output normally using codexbar gui.

codexbar output: codexbar --provider openrouter --source api --format json --pretty
[ { "provider" : "openrouter", "source" : "api", "usage" : { "identity" : { "loginMethod" : "Balance: $35.05", "providerID" : "openrouter" }, "loginMethod" : "Balance: $35.05", "openRouterUsage" : { "balance" : 35.05187273999999, "keyDataFetched" : true, "keyUsage" : 41.728327348, "keyUsageDaily" : 1.478974613, "keyUsageMonthly" : 17.475567237, "keyUsageWeekly" : 4.241156151, "rateLimit" : { "interval" : "10s", "requests" : -1 }, "totalCredits" : 160, "totalUsage" : 124.94812726, "updatedAt" : "2026-05-26T15:20:45Z", "usedPercent" : 78.0925795375 }, "primary" : null, "secondary" : null, "tertiary" : null, "updatedAt" : "2026-05-26T15:20:45Z" } } ]

jxxcr avatar May 26 '26 15:05 jxxcr

thanks for your interest and sorry for the problem.

I'll get right on it!

Also, thanks to the console output you provided, implementing the solution will be easier.

jaimegh-es avatar May 27 '26 18:05 jaimegh-es

Hello! I've applied an update to the extension to fix the error you're describing. Please, download the extension from the repo and try again. I hope it works. I don't have an OpenRouter account, so I've covered that with tests based on the output you provided.

If you have any other problems, feel free to write.

Thank you for your interest in the extension.

jaimegh-es avatar May 28 '26 10:05 jaimegh-es

Thank you very much for your efforts, it is already usable, and the bug fix was very fast,。 There is a small issue with the JSON logic returned by the OpenRouter API, which is not the issue with extension: The keys "totalCredits", "totalUsage", "usedPercent" display data that should be from all time, which is clearly not what users want. I achieved a fairly reasonable result by modifying the default command line: codexbar --provider openrouter --source api --format json --pretty | jq '.[0].usage.openRouterUsage |= (.usedPercent = .balance / 50 | del(.limit, .usage, .totalUsage, .totalCredits, .total, .cap, .max))' Just consider this as sharing my usage experience.

jxxcr avatar May 29 '26 08:05 jxxcr