Repository navigation
Let a compatible AI config override anthropic-version - #104
Open
robinbowes wants to merge 2 commits into
Open
robinbowes wants to merge 2 commits into
robinbowes wants to merge 2 commits into
Conversation
SDK 1.x sends anthropic-version 2026-10-21 to every endpoint, third-party
Anthropic-compatible vendors included. An anthropic_compatible config now
takes an optional apiVersion ('2023-06-01'; unset = the SDK's), stored in
ai_configs.api_version and sent through the SDK's defaultHeaders, for a
vendor that answers only on the original version. Any other provider gets
400 api_version_unsupported, on save and on the connection test.
Settings -> AI shows an API version select for compatible vendors, and
"Set default" carries the stored value so re-posting the row keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
…thropic-version-override # Conflicts: # docs/upgrades/unreleased.md
cliftonc
reviewed
Nov 3, 2026
cliftonc
left a comment
Contributor
There was a problem hiding this comment.
Thanks for picking this up, the wiring and the mutation-checked tests are thorough.
I looked into whether we need it. Our two anthropic_compatible presets don't seem to: Fireworks' docs say it ignores anthropic-version entirely, and Moonshot's Messages API spec doesn't document the header. So the override wouldn't change anything for either of them today, and it costs a column, a migration and seven porting steps.
Could we close this one for now? If a vendor ever does reject 2026-10-21, a one-line defaultHeaders for anthropic_compatible in createAnthropicChatClient would cover it, and the work here gives us a good starting point.
This branch has not been 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
SDK 1.x (#103) sends
anthropic-version: 2026-10-21to every endpoint, including third-partyanthropic_compatiblevendors. Ananthropic_compatibleAI config can now name2023-06-01instead. Unset keeps the SDK's version.shared/ai/config.ts):apiVersiononaiConfigSchema(nullable), on the upsert (''or omitted clears it, the same asserviceTier), and on the inline connection-test candidate.ProviderInfo.supportsApiVersionistrueonly foranthropic_compatible. Any other provider gets 400api_version_unsupportedon save and on the connection test.2026-10-21 (SDK default)/2023-06-01) for compatible vendors. "Set default" re-posts the whole row, so it now carriesapiVersion; without that, making a row the default would clear the value.0020_kit-ai-config-api-version.sql:ALTER TABLE "ai_configs" ADD COLUMN "api_version" text.services/ai/CLAUDE.md,ui/CLAUDE.md,.claude/rules/api.md. Porting note steps 42–48, and verify step 19 rewritten (the "no override in source" check no longer holds).Evidence
expected '2026-10-21' to be '2023-06-01',api_version_unsupported: expected 201 to be 400,Unable to find a label with the text of: API version).After:
pnpm gatepasses.2023-06-01, and the same row re-saved without the field sends2026-10-21. An inline compatible candidate is probed on the version it names.anthropicwithapiVersiongets 400 on save and on test. An unknown value gets 400validation_failed.setDefault, modal body) fails a test.Merge Danger
Door: two-way
The column is nullable and every existing row reads as null, so nothing changes until someone sets the field. Rolling back means dropping the column.
Blast Radius: AI settings
pnpm db:generate) rather than taking the kit's0020, because their numbering differs. The porting note says so.🤖 Generated with Claude Code