Repository navigation
fix(rate-limits): authenticate OpenCode Go through a session cookie jar - #8047
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between dbe482fae11a258e7b0b23421f62369dae55915b and 69827fa. 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughOpenCode Go rate-limit fetching now parses supported authentication cookies and installs them in an isolated Electron session partition. Workspace and usage requests use the session’s cookie jar instead of manually setting 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dbe482f to
69827fa
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Taking a look! |
|
Thanks for the fix! I pushed a maintainer follow-up that keeps the isolated cookie-jar approach while making the partition honor Orca, environment, and system proxy settings, serializing cookie installation so cleanup cannot race a rejected write, and adding focused regression coverage. The branch remains conflict-free with current main; changed-area tests, lint, max-lines, and the full typecheck pass. |
…ws-session-cookie-2
|
@brennanb2025 Thanks for the maintainer follow-up (cookie-jar partition + install serialization + regressions). Still MERGEABLE against current |
|
Sorry for the delay, just doing one more manual test then will merge it in! |
…ar (stablyai#8047) * fix(rate-limits): use session cookies for OpenCode Go * fix(rate-limits): harden OpenCode session setup --------- Co-authored-by: Brennan Benson <[email protected]> Co-authored-by: OrcaWin <[email protected]>
Summary
Fixes #7104.
OpenCode Go usage refresh now authenticates through an isolated Electron session cookie jar instead of manually setting the
Cookierequest header. This avoids Chromium'snet::ERR_FAILEDbehavior observed on Windows while preserving the existing workspace discovery and usage parsing flow.The session accepts only the
authand__Host-authcookies, clears its cookie storage before use, and clears it again after success or failure. Users can continue pasting either a full auth cookie pair or a bare token.Screenshots
No visual change. The existing OpenCode Go usage UI now displays quota data instead of a refresh error on affected Windows systems.
Testing
pnpm lint— repository baseline fails locale parity forja.json: interpolation mismatch atcomponents.native-chat.composer.uploadingAttachments; all earlier lint stages passedpnpm typecheckpnpm test— OpenCode tests pass, but the full Windows suite has 93 existing failures across 31 files (including/bin/shandopensslENOENT, symlink behavior, and unrelated Claude usage expectations)pnpm buildCookieheader, auth-cookie filtering, cleanup after success, and cleanup after partial cookie setup failureAdditional verification:
pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/opencode-go-usage-fetcher.test.ts— 29/29 passedpnpm exec oxlint src/main/rate-limits/opencode-go-usage-fetcher.ts src/main/rate-limits/opencode-go-usage-fetcher.test.ts— passedpnpm check:max-lines-ratchet— passednet::ERR_FAILEDor cookie-jar errorsAI Review Report
Reviewed the final diff for correctness, failure cleanup, compatibility, and scope.
cookies.set()could leave an earlier cookie installed; added cleanup for partial initialization and a regression test.SessionAPI and HTTPS cookie attributes are supported on Windows, macOS, and Linux; no platform-specific shortcuts, labels, paths, or shell behavior changed.No unresolved review findings remain.
Security Audit
authand__Host-auth; unrelated pasted cookies are not installed or transmitted.Cookieheader was removed, allowing Chromium to attach cookies from its scoped jar normally.Notes