fix(cli): stop framing Claude Code session limits as auth failures (KLO-734)#300
Open
kevinmessiaen wants to merge 1 commit into
Open
Conversation
…LO-734) The Claude Code auth probe wrapped every error as "authentication is not usable", so a subscription session limit told users to re-authenticate — which cannot help, since auth already succeeded and only a reset clears it. Discriminate probe failures with describeClaudeProbeFailure: session-limit and rate-limit hits get their own messages (preserving the upstream reset text), and genuine auth errors keep the original guidance. Also add the session/usage-limit markers to the shared rate-limit classifier so the governor stops treating a cap as a generic error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Claude Code auth probe (
runClaudeCodeAuthProbe) wrapped every probe error asClaude Code authentication is not usable…. When the subscription hits its session limit, the user saw:That advice is wrong: auth already succeeded. Re-authenticating cannot help — only the reset clears the cap. (KLO-734)
Fix
Discriminate probe failures with a new
describeClaudeProbeFailure, mirroring the existingdescribeCodexProbeFailurepattern in the sibling runtime:session limit/usage limit) → "Claude Code session limit reached. Wait for the reset shown…", preserving the upstream text so the reset time survives.Also extended the shared
CLAUDE_RATE_LIMIT_ERROR_MARKERSwith the session/usage-limit phrasing so the governor's classifier (isClaudeRateLimitResult) stops treating a cap as a generic error — one source of truth, both the probe and the streaming path benefit.Why string markers, not a typed field
The Claude Code / Agent SDK docs were checked: the session-limit phrasing is a client UI string, not a documented API
error.type. In the probe path (maxTurns: 1, no governor) it arrives as free text in the result'serrors[], so marker matching on that text is the correct channel. The marker is anchored on the stablesession limitphrase and deliberately not broadened to loose words like "limit"/"resets", which would risk swallowing genuine auth errors.Tests
Added three cases to
claude-code-runtime.test.ts:Verification
vitestclaude-code-runtime.test.ts: 22/22 passpnpm --filter @kaelio/ktx run type-check: cleanpnpm run dead-code(Biome + Knip default + production): clean🤖 Generated with Claude Code