mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 01:25:33 +08:00
feat(codex): expose official routing and restore the built-in provider
Let users switch between the built-in OpenAI provider and third-party Codex providers directly from the provider panel while takeover mode remains active. Centralize the frontend capability predicate so only the fixed codex-official seed receives native-login routing support, and keep copied UUID-based official entries clearly marked as unsupported. Add an idempotent backend command that recreates the deleted official seed, wire it into the add-provider flow, refresh localized guidance, and add mutation and provider-action regression coverage.
This commit is contained in:
@@ -31,6 +31,7 @@ interface AddProviderDialogProps {
|
||||
providerKey?: string;
|
||||
suggestedDefaults?: OpenClawSuggestedDefaults;
|
||||
ensureClaudeDesktopOfficialSeed?: boolean;
|
||||
ensureCodexOfficialSeed?: boolean;
|
||||
},
|
||||
) => Promise<void> | void;
|
||||
}
|
||||
@@ -116,6 +117,7 @@ export function AddProviderDialog({
|
||||
providerKey?: string;
|
||||
suggestedDefaults?: OpenClawSuggestedDefaults;
|
||||
ensureClaudeDesktopOfficialSeed?: boolean;
|
||||
ensureCodexOfficialSeed?: boolean;
|
||||
} = {
|
||||
name: values.name.trim(),
|
||||
notes: values.notes?.trim() || undefined,
|
||||
@@ -137,6 +139,14 @@ export function AddProviderDialog({
|
||||
preset?.category === "official";
|
||||
}
|
||||
|
||||
if (appId === "codex" && values.presetId) {
|
||||
const presetIndex = parseInt(values.presetId.replace("codex-", ""));
|
||||
const preset = codexProviderPresets[presetIndex];
|
||||
providerData.ensureCodexOfficialSeed =
|
||||
values.presetCategory === "official" &&
|
||||
preset?.category === "official";
|
||||
}
|
||||
|
||||
// OpenCode/OpenClaw: pass providerKey for ID generation
|
||||
if (
|
||||
(appId === "opencode" || appId === "openclaw" || appId === "hermes") &&
|
||||
|
||||
Reference in New Issue
Block a user