Skip to content

v4.2.0

Latest

Choose a tag to compare

@ben-vargas ben-vargas released this 31 Aug 23:50
ac40fa6

Added

  • errorKind on ClaudeCodeErrorMetadata — the structured SDK assistant error kind (e.g. 'account_on_hold', 'billing_error', 'overloaded') is now preserved on every mapped error path. Set only when the SDK delivers the kind structurally; heuristic (message/stderr text) classifications never fabricate one. Typed as open string so future SDK kinds flow through without a type-level break. (#155, #156)
  • Actionable account_on_hold / billing_error mapping — account-state failures now map to non-retryable APICallErrors with Anthropic Console guidance, classified before the auth-substring heuristics so they can never be misrouted to re-authentication (LoadAPIKeyError). (#155, #156)
  • isAccountStateError() helper — detects account-state failures structurally, never from message text; account-state errors never satisfy isAuthenticationError(), even when the metadata carries exit code 401. (#155, #156)
  • SDKAssistantMessageError type re-export — the SDK's known-value union of structured assistant error kinds, for consumers narrowing errorKind. (#156)
  • perTaskStopAffordance setting — maps the Agent SDK's new capability assertion that the host renders per-task stop controls wired to stopTask(), so an interrupt on a live open-input query spares running background tasks. (#153, #154)
  • Completed hook type re-exportsPreModelSwitch/PostModelSwitch hook types (new in SDK 0.3.251) plus the previously missing DirectoryAddedHookInput, restoring the full HookInput union guarantee. (#154)

Changed

  • Claude Agent SDK pinned at 0.3.251 (from 0.3.232) — resolves the weekly canary's Options drift guard failure; perTaskStopAffordance was the only new Options key, and typecheck plus the full unit suite pass against the new pin. Inherited runtime behavior changes are noted in the CHANGELOG. (#153, #154)

Full changelog: v4.1.1...v4.2.0