CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

OpenCode provider reaches cookie-authenticated session, but fetch fails with HTTP 500

Open jeshbarlow opened this issue 7 months ago • 6 comments

Environment:

  • CodexBar 0.20
  • macOS 15.x
  • OpenCode provider
  • Cookie source: Manual

What I verified:

  • I am logged into opencode.ai in the browser
  • I can see authenticated POST requests to https://opencode.ai/_server in DevTools
  • Request headers include a valid Cookie header
  • CodexBar no longer fails with “No OpenCode session cookies found in browsers”
  • After supplying the cookie manually, CodexBar fails with: “OpenCode API error: HTTP 500: HTTPError”

What I tried:

  • Manual cookie from authenticated /_server request
  • Workspace override set to: wrk_01KNJZ12TYPERCDX6W75FZF8ZZ

Expected:

  • CodexBar should fetch workspace/subscription usage from OpenCode

Actual:

  • CodexBar returns HTTP 500 from the OpenCode provider

jeshbarlow avatar Apr 13 '26 03:04 jeshbarlow

how can we help for this ?

yovanoc avatar Apr 27 '26 17:04 yovanoc

Image

I have this issue too. If I enable debugging, then in the log file it says this

Image

sixhobbits avatar May 05 '26 16:05 sixhobbits

have the same issue

[2026-05-05T22:40:59.093Z] [DEBUG] com.steipete.codexbar.cookie-cache: Cookie cache hit provider=opencode
[2026-05-05T22:40:59.498Z] [ERROR] com.steipete.codexbar.opencode-usage: OpenCode subscription payload missing after GET; retrying with POST.
[2026-05-05T22:40:59.636Z] [ERROR] com.steipete.codexbar.opencode-usage: OpenCode returned 500 (type=application/json;charset=UTF-8 length=53)
[2026-05-05T22:40:59.658Z] [DEBUG] com.steipete.codexbar.cookie-cache: Cookie cache hit provider=opencode

ctf0 avatar May 05 '26 22:05 ctf0

Turned out I was using OpenCode but I don't have credits and htere's a separate provider for OpenCode Go that works for me. After disabling OpenCode and switching to OpenCode Go in codexbar it worked for me. I had Codex clone the repo and replace my app with a locally built one instead of the release binary and it was surprisingly easy even without xcode, then it could help debug and make a better error message than HTTP 500

Image

sixhobbits avatar May 06 '26 07:05 sixhobbits

i have zen enabled with credit and still not working, still both opencode and go doesnt work.

ctf0 avatar May 06 '26 08:05 ctf0

Closing this as upstream/server-side for now. Current main already handles the client-side part: OpenCode auth/account-context failures are treated as invalid credentials and HTTP/server responses surface clearer errors instead of a misleading generic 500. I re-ran OpenCodeUsageFetcherErrorTests locally; all 7 tests pass. The remaining reported behavior is the opencode.ai _server endpoint returning HTTP 500 for an authenticated session, which CodexBar cannot fix client-side. Also note OpenCode Go credits are separate and should use the OpenCode Go provider.

steipete avatar May 10 '26 13:05 steipete