Skip to content

feat: widen ai_provider_type enum for chatd providers#25394

Merged
dannykopping merged 1 commit into
mainfrom
dk/aibridge-providers-chatd-types
May 18, 2026
Merged

feat: widen ai_provider_type enum for chatd providers#25394
dannykopping merged 1 commit into
mainfrom
dk/aibridge-providers-chatd-types

Conversation

@dannykopping

@dannykopping dannykopping commented May 15, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: implemented by a Coder Agent using Claude Opus 4.7

Splits the ai_provider_type enum widening out of the original chatd PR so it can land as a focused database change ahead of the runtime and CLI plumbing it unlocks.

Adds six values to the Postgres enum: azure, bedrock, google, openai-compat, openrouter, vercel. Mirrors the new values in codersdk.AIProviderType and regenerates the SQL dump, Go models, and typesGenerated.ts. No runtime behaviour change: validation widening, env/seed mapping, and dbsource routing for the new types live in #25435.

bedrock here is the enum value used to tag native Bedrock providers when aibridge grows direct Bedrock support; current Bedrock providers still ride on type='anthropic' plus the bedrock discriminator in ai_providers.settings.

The down migration is a no-op because Postgres does not allow removing enum values safely, matching the precedent in 000495_ai_providers.down.sql.

Part of the implementation of RFC: Migrate chatd providers to ai_providers and route Coder-agent traffic via aibridge.

@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/api/aibridge.md

@dannykopping dannykopping changed the title feat(coderd/database): widen ai_provider_type for chatd providers feat: widen ai_provider_type and config plumbing for chatd providers May 15, 2026
@dannykopping dannykopping force-pushed the dk/aibridge-providers-chatd-types branch from 4f29b23 to cd662ae Compare May 15, 2026 16:07
@dannykopping dannykopping force-pushed the dk/aibridge-providers-deprecate-env branch from b2477d9 to 0cbdf1a Compare May 15, 2026 16:07
@dannykopping dannykopping changed the base branch from dk/aibridge-providers-deprecate-env to graphite-base/25394 May 18, 2026 08:49
@dannykopping dannykopping force-pushed the graphite-base/25394 branch from 0cbdf1a to 787b845 Compare May 18, 2026 08:49
@dannykopping dannykopping force-pushed the dk/aibridge-providers-chatd-types branch from cd662ae to 4075c84 Compare May 18, 2026 08:49
@dannykopping dannykopping changed the base branch from graphite-base/25394 to dk/aibridge-providers-pool-reload May 18, 2026 08:49
@dannykopping dannykopping force-pushed the dk/aibridge-providers-pool-reload branch from 787b845 to 45ef2af Compare May 18, 2026 09:12
@dannykopping dannykopping force-pushed the dk/aibridge-providers-chatd-types branch from 4075c84 to a979851 Compare May 18, 2026 09:12
@dannykopping dannykopping changed the base branch from dk/aibridge-providers-pool-reload to graphite-base/25394 May 18, 2026 12:40
@dannykopping dannykopping force-pushed the dk/aibridge-providers-chatd-types branch from a979851 to 292e691 Compare May 18, 2026 12:41
@dannykopping dannykopping changed the base branch from graphite-base/25394 to main May 18, 2026 12:41
@dannykopping dannykopping changed the title feat: widen ai_provider_type and config plumbing for chatd providers feat(coderd/database): widen ai_provider_type enum for chatd providers May 18, 2026
@dannykopping dannykopping changed the title feat(coderd/database): widen ai_provider_type enum for chatd providers feat: widen ai_provider_type enum for chatd providers May 18, 2026
@dannykopping dannykopping changed the title feat: widen ai_provider_type enum for chatd providers feat: widen ai_provider_type enum for chatd providers May 18, 2026
Adds six new values to the ai_provider_type Postgres enum so the
chatd-side migration can preserve type fidelity when it lands:

  azure, bedrock, google, openai-compat, openrouter, vercel.

Mirrors the new values in codersdk.AIProviderType and regenerates the
SQL dump, Go models, and typesGenerated.ts enum union. No runtime
behaviour change: validation, env/seed mapping, and dbsource routing
for the new types come later in the stack.

Bedrock here is the enum value used to tag native Bedrock providers
when aibridge grows direct Bedrock support; current Bedrock providers
still ride on type='anthropic' plus the bedrock discriminator in
ai_providers.settings.
@dannykopping dannykopping marked this pull request as ready for review May 18, 2026 12:45
@dannykopping dannykopping requested a review from ibetitsmike May 18, 2026 12:45
@dannykopping dannykopping force-pushed the dk/aibridge-providers-chatd-types branch from 292e691 to 2a7877f Compare May 18, 2026 12:45
@dannykopping dannykopping merged commit c69dd9c into main May 18, 2026
24 of 26 checks passed
@dannykopping dannykopping deleted the dk/aibridge-providers-chatd-types branch May 18, 2026 13:06
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants