Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
- Last reviewed commit: 0fd1b4a4aca4cb486b7ee032a1103ac63486c366
- Latest commit, not reviewed: 0a82dd59aa9a87aafd3e259745dc78814920b203
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- Resume reviews
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The usage-limit lookup now reads stored Console key and OAuth credentials. It sends an associated workspace ID with requests, fingerprints OAuth credentials by workspace, and retries another credential after HTTP 401 or 403.
Changes: Console credential usage
Layer / File(s) Summary Resolve stored credentials
packages/provider-opencode/src/server/usageLimits.ts,packages/provider-opencode/src/server/status.test.tsThe credential reader accepts stored key and OAuth records, extracts tokens and optional workspace IDs, and fingerprints OAuth credentials by workspace when available. Tests cover Console credential fixtures and fingerprint expectations. Select credentials and send usage requests
packages/provider-opencode/src/server/usageLimits.ts,packages/provider-opencode/src/server/status.test.ts,packages/provider-opencode/src/server/driver.test.tsThe lookup orders and deduplicates credentials, sends the workspace header when available, and retries another credential only after HTTP 401 or 403. Tests check request headers and set explicit auth content in the test helper. Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- pingdotgg/t3code#31040 — The issue reports duplicate accounts when fingerprints depend on API keys. This change uses workspace-based fingerprints for OAuth credentials with a workspace ID, but it does not change the reported case involving multiple API keys.
Suggested reviewers:
juliusmarminge,maria-rcks
Merge Risk: External image Low · previous review 0fd1b
-
The change adds OpenCode Console login support for usage limits. Limit accounts could be shown twice, or merged incorrectly for Go Teams members, in edge cases involving different credential forms. These cases are bounded and cosmetic to the limits display, so owners should be aware of them but the change is mergeable.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title "fix(opencode): read usage from Console OAuth logins" follows conventional commit format and names the main change. The changeset adds reading of active OpenCode Console OAuth credentials fo… Description check Passed The description follows the template's main sections. It has What changed, Why, and How I verified it, which cover the template's Problem and Change content. The Why section states the problem, the ex… Linked Issues check Passed Issue #14983is the only directly linked issue, and it is open. Its coding requirement is that Usage → Limits reports OpenCode Go session, weekly, and monthly windows for an OpenCode 2 Console login. …Out of Scope Changes check Passed All changes connect to #14983. (1) usageLimits.ts: reads Console OAuth credentials, sends the workspace header, keeps the legacy fallback, deduplicates by token, and fingerprints OAuth credentials by …Full details: Title check
-
Explanation
The title "fix(opencode): read usage from Console OAuth logins" follows conventional commit format and names the main change. The changeset adds reading of active OpenCode Console OAuth credentials for Go usage limits, sends the workspace ID in a header, and fingerprints by workspace. The title matches the primary change and the linked objectives.
Full details: Description check
-
Explanation
The description follows the template's main sections. It has What changed, Why, and How I verified it, which cover the template's Problem and Change content. The Why section states the problem, the expected behavior, and reproduction steps. The Scope section is not labeled, but the description links issue
#14983and explains it is a small compatibility fix for an obvious bug. The Verification section lists focused tests, the repo checks it ran, and what it did not run. The description states that the full repository test suites and build were not run. The description also gives model and harness attribution, as the template asks. The template's section headings Problem, Change, Scope, and Verification are not used verbatim, but the required information is present.
Full details: Linked Issues check
-
Explanation
Issue
#14983is the only directly linked issue, and it is open. Its coding requirement is that Usage → Limits reports OpenCode Go session, weekly, and monthly windows for an OpenCode 2 Console login. That login has no opencode-go entry in auth.json and no OPENCODE_API_KEY. The issue does not require a specific mechanism. The current head changes readStoredCredential in usageLimits.ts to decode stored oauth credentials with optional orgID metadata. It returns the trimmed access token and workspace ID. Requests include x-opencode-org-id when a workspace ID is available. The legacy opencode-go key fallback remains after a 401 or 403. status.test.ts covers the OAuth and workspace-header case. The fingerprint change gives one workspace fingerprint for OAuth tokens, so rotating tokens do not split one workspace into several accounts. The issue's direction question is answered by the chosen mechanism, which is reading the OpenCode 2 credential store and the Console Go status endpoint. This verdict relies on the whole-PR summary and the reported test results. Source hunks were not read directly in this pass.
Full details: Out of Scope Changes check
-
Explanation
All changes connect to
#14983. (1) usageLimits.ts: reads Console OAuth credentials, sends the workspace header, keeps the legacy fallback, deduplicates by token, and fingerprints OAuth credentials by workspace. These changes support the Console OAuth read. (2) status.test.ts: tests the OAuth, workspace-header, and fingerprint behavior. It also tests inline Console API keys, which keep their own fingerprint. (3) driver.test.ts: sets OPENCODE_AUTH_CONTENT to an empty value in the test factory. This isolates the new credential read from host credentials, so it is supporting test change. The summary shows no unrelated product change. Rebased commits from#33287only add the isolation change and do not add unrelated work. This verdict relies on the whole-PR summary and was not checked against source hunks.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 18188ba
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c8d7d611-7467-4977-a684-2701d98a2ad6
External image Commits
-
Reviewing files that changed from the base of the PR and between ee41108147da28602fda1c81722e559ccdb9f578 and 0fd1b4a4aca4cb486b7ee032a1103ac63486c366.
External image Files selected for processing: 2
-
packages/provider-opencode/src/server/status.test.tspackages/provider-opencode/src/server/usageLimits.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 18188ba
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c8d7d611-7467-4977-a684-2701d98a2ad6
External image Commits
-
Reviewing files that changed from the base of the PR and between ee41108147da28602fda1c81722e559ccdb9f578 and 0fd1b4a4aca4cb486b7ee032a1103ac63486c366.
External image Files selected for processing: 2
-
packages/provider-opencode/src/server/status.test.tspackages/provider-opencode/src/server/usageLimits.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-