refactor: move legacy auth choice aliases into plugin manifests

This commit is contained in:
Peter Steinberger
2026-03-27 17:22:05 +00:00
parent e25f634d50
commit 2d26f2d876
14 changed files with 174 additions and 56 deletions

View File

@@ -192,6 +192,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [
provider: "anthropic",
method: "cli",
choiceId: "anthropic-cli",
deprecatedChoiceIds: ["claude-cli"],
choiceLabel: "Anthropic Claude CLI",
choiceHint: "Reuse a local Claude CLI login on this host",
groupId: "anthropic",
@@ -11374,6 +11375,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [
provider: "openai-codex",
method: "oauth",
choiceId: "openai-codex",
deprecatedChoiceIds: ["codex-cli"],
choiceLabel: "OpenAI Codex (ChatGPT OAuth)",
choiceHint: "Browser sign-in",
groupId: "openai",

View File

@@ -3,11 +3,12 @@ import type { OpenClawConfig } from "../config/config.js";
import { resolveManifestProviderAuthChoice } from "./provider-auth-choices.js";
const PREFERRED_PROVIDER_BY_AUTH_CHOICE: Partial<Record<string, string>> = {
chutes: "chutes",
"custom-api-key": "custom",
};
function normalizeLegacyAuthChoice(choice: string): string {
return normalizeLegacyOnboardAuthChoice(choice) ?? choice;
return normalizeLegacyOnboardAuthChoice(choice, { env: process.env }) ?? choice;
}
export async function resolvePreferredProviderForAuthChoice(params: {