Repository navigation
Restore reproducible Anthropic schema generation - #9981
Closed
effect-bot wants to merge 11 commits into
Closed
effect-bot wants to merge 11 commits into
effect-bot wants to merge 11 commits into
Conversation
🦋 Changeset detectedLatest commit: f971866 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
1 of 5 tasks
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.
Type
Description
The Anthropic client spec could no longer be fetched, so the client couldn't be regenerated. The
stainless-statssource readsopenapi_spec_urlfrom the SDK's.stats.yml, whichanthropics/anthropic-sdk-typescript@8752d02(2026-09-03) removed. The Stainless storage bucket behind the old URLs now returns 403 to anonymous requests.This PR pins the spec the SDK bundles at that commit (
scripts/mock-spec.json.gz) and regeneratesGenerated.ts. The bundled spec is the same as the last published one (465bff…, 2026-09-02), apart from one droppedmaxLengthonResponseTextBlock.text. #8971 hand-added its fallback schemas from that same spec.@effect/openapi-generatorNew
includeSchemasoption ongenerate. It generates the namedcomponents.schemasentries, and their dependencies, even when no operation references them. When the option is unset, output is unchanged.@effect/ai-codegen(private tool).gz, from a URL or a file, are decompressed before parsing. Decompression failures are reported asSpecFetchError.includePaths: optional list of spec path keys to generate.includeSchemas: passed straight through to the generator.errorStatusRanges: optional list of4XXand/or5XX.GenerationErrorif their content differs (descriptions are ignored), so distinct schemas are never merged.orElsebranch.packages/ai/anthropic/codegen.ymlspecpoints at the pinned gzipped SDK spec.includePathslists the 31 paths the client already had. The spec now has 202 endpoints (Admin API, agents, sessions, vaults, …).errorStatusRanges: [4XX]keeps main's error API, because the new spec lists every error status (400…529) separately.includeSchemaskeeps schemas that no included operation references:AnthropicClientdecodes;All optionality is expressed as
requiredpatches. Those patches cover:citations,inference_geo,server_tool_use,context_managementandcontainerfields, previously done with text replacements;stop_details,diagnostics, model capabilities and limits,encrypted_content,estimated_tokens,Container.skills,output_tokens_details,fallback_credit.Only the two index-signature replacements remain, and
codegen.ymlis 86 lines.Header:
@since 4.0.0(matches main), plusoxlint-disable no-control-regex. The spec's string patterns exclude control characters on purpose.AnthropicLanguageModel.tsThe input content block union now includes
fallbackblocks, which can't carrycache_control.setLastCacheControlskips them the same way it skips thinking blocks.Compatibility of
Generated.ts(+15k/−9k lines, 12.7k → 18.9k)What stays the same:
*4XXexports and error tags are identical to main, and there's no5XX.BetaMemoryTool_20250818_*Commandare generated with the same keys as main.What changed:
anthropics/anthropic-sdk-typescript@33f5103009(2026-08-27). These are intentional breaking migrations, not compatibility preservation.BetaSkillchanges meaning. It now describes the Skill resource; the container skill parameter it used to describe is nowBetaContainerSkill.display_title→display_name,latest_version→latest_version_id, andsourceis now a structured object instead of a string. TheCreate/Get/DeleteSkill and SkillVersion response types (plusBetavariants andBetaapi__schemas__skills__Skill) are replaced bySkill,SkillVersion,DeletedSkillandDeletedSkillVersion.Body_create_skill_*are now*Multipart, with__ClientMultipartFilefile fields.{ data, next_page }and paginates withpage, in place of{ data, has_more, first_id, last_id }andbefore_id/after_id.files-api-2025-04-14andskills-2025-10-02tokens from anyanthropic-betaheader they send, keeping any other beta tokens. The generated methods forward the caller'santhropic-betaheader, and the API still returns the previous beta shapes to requests that send these tokens, which the new schemas can't decode. Upstream migration guides: Files, Skills.Schema.Int, and open enums.The changeset lists these migrations.
Validation
@effect/openapi-generator,@effect/ai-codegenand@effect/ai-anthropic: 239 tests pass. No Anthropic tests changed.pnpm checkpasses in all three packages, andoxlint,dprint checkandpnpm jsdocs --checkare clean.nix develop -c node packages/tools/ai-codegen/src/bin.ts generate --provider anthropicreproduces the committedGenerated.ts.Closes EFF-2979