← Engineering Work & Open Source
Shipped IndependentlyAnthropic SDK · Client Observability

Stable User-Agent Identity in Anthropic’s TypeScript SDK

A focused SDK reliability contribution showing that constructor-derived User-Agent names drift under subclassing or minification. Anthropic closed the PR after shipping the same fix and regression scenario in v0.116.0.

Ribbsaeter Systems Anthropic TypeScript SDK v0.116.0 stable User-Agent fix shipped upstream

v0.116.0

Anthropic release

51

tests passed

1

focused test file

#1135

public PR

01 · Engineering problem

The failure mode

The SDK generated its User-Agent from constructor.name. Subclassing or JavaScript minification can rename that constructor, producing unstable network identity and weakening observability across builds.

02 · Technical response

What changed

  1. 01Demonstrated the failure with a subclass whose constructor name differs from the SDK’s canonical identity.
  2. 02Specified a stable Anthropic/JS versioned token independent of runtime class names.
  3. 03Added a regression assertion that rejects leaked subclass names while preserving the established header format.
  4. 04Validated the focused Jest suite, formatting, linting, and TypeScript compilation.

03 · Verified outcome

Evidence, not implication

  • Anthropic confirmed the fix shipped in SDK v0.116.0.
  • The shipped release included regression coverage for the subclass/minified-name case.
  • PR #1135 was closed without merge because upstream had already implemented the same correction.
  • The case study is classified as public validation—not a merged contribution.

04 · Public record

Source evidence

Independent engineering and open-source work by Patrick Ribbsaeter / Ribbsaeter Systems. References to maintainers, repositories, or companies identify the public technical context only. No employment, client, vendor, or partnership relationship is implied unless explicitly stated.