Repository navigation
fix(batch): point an inactive subscription to Billing, not to re-login - #45
Draft
emirlan-zen wants to merge 2 commits into
Draft
emirlan-zen wants to merge 2 commits into
emirlan-zen wants to merge 2 commits into
Conversation
The Batch API now answers a valid key whose subscription is past due, unpaid, incomplete or paused with 401 code subscription_inactive. The CLI treated every 401 as a bad key and told the user to log in again, which cannot fix a billing state. Keep the AUTH_INVALID code for every 401 so scripts and agents that branch on it are unaffected; for subscription_inactive only the message and next action change, pointing to Billing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes
The Batch API now returns
401withcode: subscription_inactivewhen the API key is valid but the subscription is past due, unpaid, incomplete or paused. The CLI treated every Batch401as a bad key and suggestedzenrows login, which can't fix a billing problem.For
subscription_inactive, the CLI now explains that the key is valid and points to Billing, or to Azure Marketplace for subscriptions bought there. It no longer suggests logging in again.Compatibility
The error code stays
AUTH_INVALIDfor every401, so scripts and agents that branch on it behave as before. Onlymessage,likely_causeandnext_actionchange, and only forsubscription_inactive. Every other401keeps the same text and thezenrows loginsuggestion.Tests
tests/batch-api.test.ts:unauthenticatedkeeps the re-login guidancesubscription_inactivekeepsAUTH_INVALIDand points to Billingnpm run typecheckpasses, andnpm testpasses (366 tests).🤖 Generated with Claude Code