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
[Agent Usage] Use the new OpenCode Go usage API instead of scraping the workspace web page #30848
The current implementation in the extension (extensions/agent-usage/src/opencode-go/fetcher.ts) fetches the workspace web page (https://opencode.ai/workspace/wrk_.../go) using the auth cookie and parses the usage data out of the HTML (parser.ts). This is currently broken and is inherently fragile, since any change to the page markup breaks parsing.
Proposal: replace the HTML scraping with a request to the new API using the user's OpenCode API key (Bearer auth), mapping:
usage.rolling → rolling limit (percent + resetsAt)
The Agent Usage extension now fetches OpenCode Go usage from the Zen JSON API (https://opencode.ai/zen/go/v1/usage) with Bearer auth instead of scraping the workspace web page, mapping rolling/weekly/monthly (percent + resetsAt) as proposed. The workspace ID and auth cookie preferences were replaced by an optional OpenCode Go API key, auto-detected from ~/.local/share/opencode/auth.json (opencode-go entry).
Activity
raycastbot commentedon Sep 7, 2026
Thank you for opening this issue!
🔔 @natsustan @alexibuild @AdrianBonpin @GarrickZ2 @EDM115 @chingweih @natsustan @jakoss you might want to have a look.
💡 Author and Contributors commands
The author and contributors of
thuggyduck/agent-usagecan trigger bot actions by commenting:@raycastbot close this issueCloses the issue.@raycastbot close as not plannedCloses the issue as not planned.@raycastbot close as duplicateCloses the issue as duplicate.@raycastbot rename this issue to "Awesome new title"Renames the issue.@raycastbot reopen this issueReopens the issue.@raycastbot assign meAssigns yourself to the issue.@raycastbot good first issueAdds the "Good first issue" label to the issue.@raycastbot keep this issue openMake sure the issue won't go stale and will be kept open by the bot.ericrocha97 commentedon Sep 8, 2026
Implemented in #30849 — merged 🎉
The Agent Usage extension now fetches OpenCode Go usage from the Zen JSON API (
https://opencode.ai/zen/go/v1/usage) with Bearer auth instead of scraping the workspace web page, mappingrolling/weekly/monthly(percent +resetsAt) as proposed. The workspace ID and auth cookie preferences were replaced by an optional OpenCode Go API key, auto-detected from~/.local/share/opencode/auth.json(opencode-goentry).Closing as completed.