Skip to content

v2.17.0

Latest

Choose a tag to compare

@anthropic-sdks-releaser anthropic-sdks-releaser released this 03 Dec 18:32

Features

  • api: add the beta analytics list of projects in the new projects experience
  • api: add the organization_url_fetch_disabled error code

Bug Fixes

  • client: free the connection of a response that middleware drops

    A middleware that replaced a response, or called the next handler twice, left the unread response holding its pooled connection, so later requests could time out waiting for one.

    After a redirect to another origin, a retry no longer relies on the request's metadata to keep the credentials off.

  • client: hide secret values in inspect and to_s

    A property that the API marks as sensitive now prints "REDACTED" in inspect, pp and to_s. Read its value with its reader method.

  • client: include the caller's frames in connection error backtraces

  • client: keep a request body's encoding when the request is sent again

    A retry or a redirect now sends the same bytes as the first attempt, so a multipart upload keeps its boundary.

    An upload that holds an IO still can't be sent twice. Its second attempt now has an empty body, where it had an empty file part.

  • client: name the host, cause and timeout in connection error messages

  • client: raise the connection error when a response body is cut short

    A successful response that ends before the length in its Content-Length header used to be taken for a complete one: a JSON response raised JSON::ParserError, and a binary response was returned truncated with no error.
    Both now raise Anthropic::Errors::APIConnectionError, with the EOFError as its cause.
    Code that rescues JSON::ParserError to handle a dropped connection should rescue Anthropic::Errors::APIConnectionError instead.

  • client: retry when the connection drops while the response body is read

    A call that returns a parsed response is now sent again, up to max_retries, when the connection drops or times out partway through the response body. Before, it raised APIConnectionError after one request.

    A stream is not sent again. Neither is a call whose response has x-should-retry: false.

  • client: send a request body that a middleware edited between two sends

  • client: use the API's error message, not the whole response body, as the error message

    The error of a stream's error event now has the URL that was sent, not the URL from before a redirect or from before the Bedrock or Vertex client changed it.

  • credentials: keep a base URL's password out of token endpoint errors

Chores

  • docs: clarify what a federation rule's match must contain
  • docs: update example request bodies
  • docs: use example.com in example email addresses
  • internal: check formatting in CI
  • internal: check formatting with the hash-locked gems
  • internal: lock the formatter gems by hash
  • tests: cover the URL of a stream's error event on the Bedrock and Vertex clients

Documentation

  • api: clarify that max_tokens applies to each model call
  • api: clarify when SCIM-provisioned RBAC groups can be changed
  • api: say to retry storage_not_ready in a minute