Skip to content

chore(core): remove unreachable AI SDK providers - #43115

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
remove-ai-sdk
Open

chore(core): remove unreachable AI SDK providers#43115
opencode-agent[bot] wants to merge 1 commit into
v2from
remove-ai-sdk

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • remove direct dependencies on the Amazon Bedrock, Anthropic, Azure, and OpenAI-compatible AI SDK providers now covered by native routing
  • delete unreachable AI SDK provider hooks while retaining catalog and integration transforms still used by native routes
  • reject OpenAI-compatible configurations without an endpoint before the generic AI SDK fallback
  • remove the now-unused AWS credential-chain and Google auth dependencies from Core

Checks

  • bun typecheck (packages/core)
  • bun test test/model-resolver.test.ts test/aisdk-native.test.ts test/plugin/provider-amazon-bedrock.test.ts test/plugin/provider-anthropic.test.ts test/plugin/provider-azure.test.ts test/plugin/provider-cloudflare-workers-ai.test.ts test/plugin/provider-google-vertex.test.ts (74 pass)
  • bun test test/aisdk.test.ts test/plugin/provider-factory.test.ts (30 pass)

Requested by: @rekram1-node (Aiden Cline via Slack)

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  • packages/opencode/src/provider/provider.ts (and core plugins generally) — This removes real user-facing behaviors along with the dead code: Snowflake Cortex loses its protocol shims (max_tokens→max_completion_tokens rewriting, role:"" stream repair, conversation-complete 400→stop translation), Bedrock loses cross-region inference-prefix resolution plus the default AWS credential chain, and Azure loses its missing-resourceName validation — none of these have generic equivalents in the diff — please add a changeset/migration note stating these configurations are no longer supported and what users should move to, so removal isn't discovered as a runtime breakage.
  • packages/core/src/plugin/provider/amazon-bedrock.ts — Even granting "unreachable", the deletion leaves the remaining catalog/auth-form hooks advertising a provider whose SDK wiring no longer exists anywhere in this package; either strip the plugin files down consistently (as done for openai-compatible/snowflake-cortex) or keep a pointer comment naming what now owns SDK creation for @ai-sdk/amazon-bedrock, otherwise the half-empty files mislead the next reader.
  • packages/core/src/plugin/provider/google-vertex.ts:41 — Dropping authFetch means OpenAI-compatible Vertex endpoints no longer receive ADC bearer-token injection; if the generic loader does not replicate Google-auth for that endpoint shape, Vertex-via-openai-compatible breaks silently at request time — worth an explicit test or doc line confirming the supported path for Vertex non-native endpoints post-change.
  • packages/core/src/model-resolver.ts:188 — The two consecutive isAISDK(package) && packageName === "@ai-sdk/openai-compatible" checks read as separate rules but are really one guard plus its body; folding into a single if/else would make the new unsupported-rejection obviously exhaustive and avoid re-evaluating the same predicate twice.
  • packages/core/test/model-resolver.test.ts:418 — Good rejection test with the loader-must-not-run assertion; consider one companion case proving openai-compatible WITH baseURL still resolves through OpenAICompatibleChat, since this PR narrows the accepted input space and both edges deserve pinning.

— AI code review (automated)

@Enough1122

Copy link
Copy Markdown

AI code review - automated review for reference; please use your judgment.

  • packages/core/package.json - @ai-sdk/google-vertex remains in dependencies even though plugin/provider/google-vertex.ts and its test are deleted here; if nothing else imports it, this looks like an incomplete cleanup (its transitive google-auth-library was removed, so a lingering import would break anyway). Worth grepping once more or removing it too.
  • packages/core/src/model-resolver.ts:188-196 - the two consecutive openai-compatible branches read awkwardly: first rejects missing baseURL, then handles present baseURL. A single branch with early-return inside would be clearer; behavior itself is fine and the new test locking "loader must not be called" is a good guard.
  • Deletion scope (bedrock/anthropic/azure/cloudflare/snowflake/openai-compatible plugins) matches "unreachable" claim since none are imported from provider.ts; ~2k lines of tests removed with them - acceptable given they tested dead code, but note users pinning e.g. snowflake cortex via config will now get unsupported-package errors instead of silent no-ops.

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  • Coordination flag: this deletes packages/core/src/plugin/provider/amazon-bedrock.ts and azure.ts as "unreachable," while two other open PRs in flight actively extend exactly those files (feat: support Claude models on the Bedrock Mantle endpoint #43231 Bedrock Mantle support, refactor(ai): move credential lowering into providers #43515/fix(provider): select Azure DeepSeek adapter #43135 Azure DeepSeek adapter). Please reconcile with those authors before merging — either they're building on dead code (they should retarget), or these paths aren't actually unreachable.
  • packages/core/src/model-resolver.ts:188 — behavior change worth a release note: @ai-sdk/openai-compatible without a baseURL is now hard-unsupported instead of falling through to the (removed) plugin's defaults. Configs that relied on implicit defaults will start erroring.
  • The inlined OpenAI-compatible handling in the resolver keeps the Auth.none/bearer distinction; the new resolver tests cover it — good replacement coverage for the deleted plugin tests.
  • Large test deletions (~1500 lines) match the removed surface 1:1 from what I can see; no blocking issues beyond the coordination question above.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants