Repository navigation
feat(batch): name api_key_cap_reached and expose failure_detail on runs stopped by an API key credit cap - #32
Merged
Conversation
…old apart from an empty account, so the SDK now types api_key_cap_reached and failure_detail Run.failure_reason gains api_key_cap_reached (exported as RunFailureReason), Run gains failure_detail, TaskStatus gains processing to match conveyor's spec, and the README documents the 402 api_key_cap_reached problem code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…terminal, so waitForRun polled until its timeout Add `failed` to TERMINAL_RUN_STATUSES so waitForRun / run.wait() / job.run.wait() resolve with the failed run and its failure_reason / failure_detail. A status in failureStatuses now takes precedence over the targets, so failureStatuses: new Set(["failed"]) still throws WaiterFailureError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lr2QdqhUNrX6q4DRLGeTMY
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.
Why
A Batch run that stops because its API key reached a credit cap reports
failure_reason: "api_key_cap_reached"and afailure_detailsaying which cap and when it resets. Since #31 unknown values type-check, but callers can't name this reason or read the detail.What
RunFailureReasonincludingapi_key_cap_reached.Run.failure_detail?: string | null(at most 500 characters).TaskStatusgainsprocessing, matching the API.api_key_cap_reachedproblem code.Verification
pnpm check: clean.pnpm test -- --run: 252 passed, no type errors.pnpm build: OK.No version bump (the release sets it).
🤖 Generated with Claude Code