Repository navigation
fix(ai-anthropic): accept unknown refusal categories in RefusalCategory schemas - #11397
Open
standard-librarian wants to merge 1 commit into
Open
standard-librarian wants to merge 1 commit into
standard-librarian wants to merge 1 commit into
Conversation
standard-librarian
requested a deployment
to
fork
December 3, 2026 00:29 — with
GitHub Actions
Waiting
🦋 Changeset detectedLatest commit: 762b4f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 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
|
I believe that this PR has been superseded by #11400 |
This branch is waiting to be deployed
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.
Summary
RefusalCategoryandBetaRefusalCategoryinpackages/ai/anthropic/codegen.ymlto append{"type": "string"}to theiranyOfunions, matching howModelstays open to newly added values.Schema.Stringunion branch (and| stringtype) toRefusalCategoryandBetaRefusalCategoryinpackages/ai/anthropic/src/Generated.ts.AnthropicClient.test.tsandAnthropicLanguageModel.test.tsverifying unknown refusal categories decode cleanly inRefusalStopDetails,BetaRefusalStopDetails,BetaFallbackRefusalTrigger, and streamingmessage_deltaevents (finishing withreason: "content-filter").@effect/ai-anthropic.Note: Checked
BetaFallbackCreditNotApplied.reasonas mentioned in the issue — left it closed because Anthropic's OpenAPI spec explicitly documents it as "A closed enum; additions to the redemption-check vocabulary arrive as deliberate schema updates."Fixes #11391
Verification
Expected RefusalCategory/Expected BetaRefusalCategory)../node_modules/.bin/vitest run packages/ai/anthropic/test/— 3/3 test files, 100/100 tests passed.pnpm --filter @effect/ai-anthropic check(tsc -b tsconfig.json) — 0 errors../node_modules/.bin/oxlinton changed TS files — 0 warnings, 0 errors../node_modules/.bin/dprint checkon changed TS files — passed.