Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude limits load again for users with large transcript histories #16358

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/16358/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Users with a few GB of Claude transcripts saw probeFailed on every Claude instance, and the Limits tab stayed empty. The probe's usage request also scans every local transcript from the last 7 days to fill behaviors. The probe never reads that field. With about 4 GB of transcripts the request takes 5.4-5.8 s, which is longer than the probe's 4 s deadline.

The probe now calls usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET({ skipBehaviors: true }). The SDK documents this option for callers that need only the plan rate limits. With it, the same request answers in about 0.4 s.

This takes over #14456 by @Ashkaan, who found the cause and wrote the fix. Their commit is kept with its authorship. It is rebased onto the module layout that replaced provider/Layers/, and its test moved to ClaudeCapabilitiesProbe.test.ts.

Proof: the new test fails without the option and passes with it. The installed CLI (2.1.287) accepts skip_behaviors and documents that it skips the transcript scan. A real SDK call with the option succeeds. I could not reproduce the 5 s slowdown on my machine: it authenticates through a proxy token that has no plan limits, so the timings above are @Ashkaan's measurements.

Co-authored-by: Ashkaan <a@ashkaan.me>

🤖 Generated with Claude Code using Claude Opus 5.5

    1. juliusmarminge added labelsmacroscope-review

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 874854f

      Macroscope's review found this PR approvable — This narrowly fixes Claude capability probing for large transcript histories by skipping an unused local scan while preserving rate-limit data. The production change is isolated and covered by a regression test, with no product-default, schema, security, or deployment changes.

      No code changes detected at 53453ba. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 61a0ec9 · PR result: 53453ba · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Important

      Review skipped

      Review was skipped as selected files did not have any reviewable changes.

      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Team
      • Run ID: 70668d5c-f36c-4bd3-bf4e-c02f680bff67
      📥 Commits

      Reviewing files that changed from the base of the PR and between 874854f2d160606627f78e05f979ecc38de9d6c9 and 53453ba0cd7e1472ff65d12cbe23024760dd9349.

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Team
      • Run ID: 6afb7458-0aa8-439a-be38-a08e515b20ea
      📥 Commits

      Reviewing files that changed from the base of the PR and between 71964e670ff212006ebb8de26585649c2adced68 and 874854f2d160606627f78e05f979ecc38de9d6c9.

      📒 Files selected for processing (2)
      • apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts
      • apps/server/src/provider/ClaudeProvider.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


      📝 Walkthrough

      Walkthrough

      The Claude capability probe now requests usage data with behavior collection disabled. A test verifies that the request receives { skipBehaviors: true }.

      Changes

      Claude usage probe

      Layer / File(s)Summary
      Skip behavior collection in usage probe
      apps/server/src/provider/ClaudeProvider.ts, apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts
      The usage request passes skipBehaviors: true. The probe still reads rate-limit fields, and a test verifies the request option. Existing timeout and failure handling remain unchanged.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 87485

      The probe can skip transcript scanning while still reading plan rate limits, so no actionable merge risk remains.

      🚥 Pre-merge checks | ✅ 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the fix: Claude limits load again for users with large transcript histories. It is concise and relevant to the main change.
      Description check✅ PassedThe description covers the problem, the change, and focused verification, including what could not be reproduced. It also identifies issue #14456. It does not state that maintainers approved the direc…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.

Sign in to join this conversation.