Skip to content

ai-anthropic: codegen can't fetch the spec since .stats.yml dropped openapi_spec_url #9501

Closed

Description

@typedrat

packages/ai/anthropic/codegen.yml gets its spec through type: stainless-stats, which reads openapi_spec_url from https://raw.githubusercontent.com/anthropics/anthropic-sdk-typescript/main/.stats.yml. That file stopped carrying openapi_spec_url on 2026-09-03 (anthropics/anthropic-sdk-typescript@8752d02422). It now holds only configured_endpoints, so fetchViaStainlessStats fails with SpecFetchError and the Anthropic schemas can't be regenerated.

The last .stats.yml that still had a URL (anthropics/anthropic-sdk-typescript@f31cbb5a6e, 2026-09-02) points to:

https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-465bff21a179090915396565d1ae8f705cf8596e2ec920eb121072f25b8a7d68.yml

That URL still resolves.

Effect on Generated.ts

src/Generated.ts is now behind the API. For example, BetaThinkingConfigAdaptive / ThinkingConfigAdaptive are { type: "adaptive" } only. The spec above has an optional display: "summarized" | "omitted" (plus "updates" and block_binding on the beta variant). Because the encoder strips unknown keys, callers can't set display through Config. That matters for models that default display to "omitted", where thinking blocks then stream with empty text. Today the only way around it is rewriting the request body in transformClient.

Notes from trying a regeneration

Pointing spec: at the pinned URL above and running effect-ai-codegen generate --provider anthropic succeeds in fetching and generating, but:

  • the diff to Generated.ts is large (about 19k insertions and 12.5k deletions), and
  • the generator's own Oxlint post-processing step then fails on the output (PostProcessError: lint failed).

So this probably needs a maintainer-run regeneration rather than an outside PR. It also needs a decision on where the spec comes from now that .stats.yml no longer names it: pinning a URL in codegen.yml works, but goes stale without anyone noticing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions