fix(server): skip the transcript scan in the Claude usage probe #14456
main fromrefs/pull/14456/head·opened View on GitHubWhat Changed#
The Claude capabilities probe now calls usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET({ skipBehaviors: true }), plus a test that the probe passes the option.
Why#
By default the SDK's usage request also scans every local transcript to fill behaviors, which the probe never reads. With about 4 GB of transcripts under ~/.claude/projects the request takes 5.4-5.8 s, longer than the probe's 4 s DEFAULT_TIMEOUT_MS, so every Claude instance shows probeFailed and the Limits tab stays empty. With skipBehaviors the same request answers in about 0.4 s. The SDK documents the option for exactly this case: "for callers that need only the plan rate limits."
Checklist#
- This PR is small and focused
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
a0dceadMacroscope's review found this PR approvable — This is a narrowly scoped fix to the Claude capability probe that removes an unnecessary transcript scan while preserving the rate-limit data used by the server. The change is covered by a focused test and introduces no product-default, schema, deployment, or sensitive-package changes.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
2d349d0f-6787-4a4d-8a7b-da4ad82d7b1b📥 Commits
Reviewing files that changed from the base of the PR and between c2fa9fc911daeac97df4760f95fc57dca42b84c8 and a0dcead79242eadf28c30ac0a4bf6c504c1c9ebe.
📒 Files selected for processing (2)
apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.tsapps/server/src/provider/Layers/ClaudeProvider.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
The Claude capability probe now requests usage with
skipBehaviors: true. A test verifies that the option is passed.Changes#
Claude capability probe
Layer / File(s) Summary Usage request and verification
apps/server/src/provider/Layers/ClaudeProvider.ts,apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.tsThe probe sets skipBehaviors: truein its usage request. The test verifies that option. The existing timeout and result handling remain unchanged.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
maria-rcksMerge Risk: ⚪ Minimal · up to
a0dceThe probe avoids the transcript scan while retaining rate-limit data, with no identified issue blocking merge.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: skipping transcript scanning in the Claude usage probe. Description check ✅ Passed The description includes the required What Changed, Why, and Checklist sections. It explains the timeout problem, the selected fix, and the test coverage. The UI Changes section is not needed because … Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. ✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Autopilot is currently an internal CodeRabbit preview.
Comment `@coderabbitai help` to get the list of available commands.juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Grok responding on behalf of Julius.
Thanks @Ashkaan for finding the cause and writing this fix! It landed in #16358, which kept your commit and authorship and rebased it onto the new module layout. Closing this one as superseded.
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed