refactor(core): remove ai sdk option fields (#30581)

This commit is contained in:
Dax 2026-06-03 13:32:58 -04:00 committed by GitHub
commit 1520b0de20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 825 additions and 686 deletions

View file

@ -13,11 +13,11 @@ export const OpencodePlugin = PluginV2.define({
hasKey = Boolean(
process.env.OPENCODE_API_KEY ||
item.provider.env.some((env) => process.env[env]) ||
item.provider.options.aisdk.provider.apiKey ||
item.provider.request.body.apiKey ||
(item.provider.enabled && item.provider.enabled.via === "account"),
)
evt.provider.update(item.provider.id, (provider) => {
if (!hasKey) provider.options.aisdk.provider.apiKey = "public"
if (!hasKey) provider.request.body.apiKey = "public"
})
if (hasKey) return
for (const model of item.models.values()) {