mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-03-31 17:12:09 +08:00
chore: upgrade all GPT model references to gpt-5.4
GPT no longer has separate codex variants (gpt-5.x-codex), unified as gpt-5.4. Updated ~26 references across 8 files: - Codex provider presets: default param + 12 vendor configs - Codex custom template default model - Universal provider default Codex model (gpt-4o → gpt-5.4) - OpenCode @ai-sdk/openai: consolidated 7 old models into single gpt-5.4 - OpenCode RightCode: removed gpt-5.2-codex entry - OMO agent/category recommended models (7 references) - Stream check default Codex model - Universal form fallback and placeholder - Codex form placeholder text
This commit is contained in:
@@ -112,7 +112,7 @@ export function CodexFormFields({
|
||||
value={modelName}
|
||||
onChange={(e) => onModelNameChange(e.target.value)}
|
||||
placeholder={t("codexConfig.modelNamePlaceholder", {
|
||||
defaultValue: "例如: gpt-5-codex",
|
||||
defaultValue: "例如: gpt-5.4",
|
||||
})}
|
||||
className="w-full px-3 py-2 border border-border-default bg-background text-foreground rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 transition-colors"
|
||||
/>
|
||||
|
||||
@@ -145,7 +145,7 @@ export function UniversalProviderFormModal({
|
||||
// 计算 Codex 配置 JSON 预览
|
||||
const codexConfigJson = useMemo(() => {
|
||||
if (!codexEnabled) return null;
|
||||
const model = models.codex?.model || "gpt-4o";
|
||||
const model = models.codex?.model || "gpt-5.4";
|
||||
const reasoningEffort = models.codex?.reasoningEffort || "high";
|
||||
// 确保 base_url 以 /v1 结尾(Codex 使用 OpenAI 兼容 API)
|
||||
const codexBaseUrl = baseUrl.endsWith("/v1")
|
||||
@@ -591,7 +591,7 @@ requires_openai_auth = true`;
|
||||
onChange={(e) =>
|
||||
updateModel("codex", "model", e.target.value)
|
||||
}
|
||||
placeholder="gpt-4o"
|
||||
placeholder="gpt-5.4"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
|
||||
@@ -24,7 +24,7 @@ export function ModelTestConfigPanel() {
|
||||
maxRetries: "2",
|
||||
degradedThresholdMs: "6000",
|
||||
claudeModel: "claude-haiku-4-5-20251001",
|
||||
codexModel: "gpt-5.1-codex@low",
|
||||
codexModel: "gpt-5.4@low",
|
||||
geminiModel: "gemini-3-pro-preview",
|
||||
testPrompt: "Who are you?",
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ export function generateThirdPartyAuth(apiKey: string): Record<string, any> {
|
||||
export function generateThirdPartyConfig(
|
||||
providerName: string,
|
||||
baseUrl: string,
|
||||
modelName = "gpt-5.1-codex",
|
||||
modelName = "gpt-5.4",
|
||||
): string {
|
||||
// 清理供应商名称,确保符合TOML键名规范
|
||||
const cleanProviderName =
|
||||
@@ -85,7 +85,7 @@ export const codexProviderPresets: CodexProviderPreset[] = [
|
||||
isOfficial: true,
|
||||
auth: generateThirdPartyAuth(""),
|
||||
config: `model_provider = "azure"
|
||||
model = "gpt-5.2"
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
disable_response_storage = true
|
||||
|
||||
@@ -113,7 +113,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"aihubmix",
|
||||
"https://aihubmix.com/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: [
|
||||
"https://aihubmix.com/v1",
|
||||
@@ -128,7 +128,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"dmxapi",
|
||||
"https://www.dmxapi.cn/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: ["https://www.dmxapi.cn/v1"],
|
||||
isPartner: true, // 合作伙伴
|
||||
@@ -143,7 +143,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"packycode",
|
||||
"https://www.packyapi.com/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: [
|
||||
"https://www.packyapi.com/v1",
|
||||
@@ -161,7 +161,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"cubence",
|
||||
"https://api.cubence.com/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: [
|
||||
"https://api.cubence.com/v1",
|
||||
@@ -184,7 +184,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"aigocode",
|
||||
"https://api.aigocode.com",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: ["https://api.aigocode.com"],
|
||||
isPartner: true, // 合作伙伴
|
||||
@@ -200,7 +200,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"rightcode",
|
||||
"https://right.codes/codex/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
category: "third_party",
|
||||
isPartner: true,
|
||||
@@ -216,7 +216,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"aicodemirror",
|
||||
"https://api.aicodemirror.com/api/codex/backend-api/codex",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: [
|
||||
"https://api.aicodemirror.com/api/codex/backend-api/codex",
|
||||
@@ -235,7 +235,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"aicoding",
|
||||
"https://api.aicoding.sh",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: ["https://api.aicoding.sh"],
|
||||
isPartner: true,
|
||||
@@ -251,7 +251,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"crazyrouter",
|
||||
"https://crazyrouter.com/v1",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: ["https://crazyrouter.com/v1"],
|
||||
isPartner: true,
|
||||
@@ -267,7 +267,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"sssaicode",
|
||||
"https://node-hk.sssaicode.com/api/v1",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.4",
|
||||
),
|
||||
endpointCandidates: [
|
||||
"https://node-hk.sssaicode.com/api/v1",
|
||||
@@ -340,7 +340,7 @@ requires_openai_auth = true`,
|
||||
config: generateThirdPartyConfig(
|
||||
"openrouter",
|
||||
"https://openrouter.ai/api/v1",
|
||||
"gpt-5.2",
|
||||
"gpt-5.4",
|
||||
),
|
||||
category: "aggregator",
|
||||
icon: "openrouter",
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface CodexTemplate {
|
||||
*/
|
||||
export function getCodexCustomTemplate(): CodexTemplate {
|
||||
const config = `model_provider = "custom"
|
||||
model = "gpt-5.2"
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
disable_response_storage = true
|
||||
|
||||
|
||||
@@ -124,174 +124,11 @@ export const OPENCODE_PRESET_MODEL_VARIANTS: Record<
|
||||
],
|
||||
"@ai-sdk/openai": [
|
||||
{
|
||||
id: "gpt-5",
|
||||
name: "GPT-5",
|
||||
id: "gpt-5.4",
|
||||
name: "GPT-5.4",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "low",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "high",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.1",
|
||||
name: "GPT-5.1",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 272000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "low",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "high",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.1-codex",
|
||||
name: "GPT-5.1 Codex",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
options: { include: ["reasoning.encrypted_content"], store: false },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.1-codex-max",
|
||||
name: "GPT-5.1 Codex Max",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
options: { include: ["reasoning.encrypted_content"], store: false },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
xhigh: {
|
||||
reasoningEffort: "xhigh",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.2",
|
||||
name: "GPT-5.2",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
xhigh: {
|
||||
reasoningEffort: "xhigh",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.2-codex",
|
||||
name: "GPT-5.2 Codex",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
options: { include: ["reasoning.encrypted_content"], store: false },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
medium: {
|
||||
reasoningEffort: "medium",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
high: {
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
xhigh: {
|
||||
reasoningEffort: "xhigh",
|
||||
reasoningSummary: "auto",
|
||||
textVerbosity: "medium",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "gpt-5.3-codex",
|
||||
name: "GPT-5.3 Codex",
|
||||
contextLimit: 400000,
|
||||
outputLimit: 128000,
|
||||
modalities: { input: ["text", "image"], output: ["text"] },
|
||||
options: { include: ["reasoning.encrypted_content"], store: false },
|
||||
variants: {
|
||||
low: {
|
||||
reasoningEffort: "low",
|
||||
@@ -1110,11 +947,7 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
|
||||
apiKey: "",
|
||||
},
|
||||
models: {
|
||||
"gpt-5.2": { name: "GPT-5.2" },
|
||||
"gpt-5.2-codex": {
|
||||
name: "GPT-5.2 Codex",
|
||||
options: { include: ["reasoning.encrypted_content"], store: false },
|
||||
},
|
||||
"gpt-5.4": { name: "GPT-5.4" },
|
||||
},
|
||||
},
|
||||
category: "third_party",
|
||||
|
||||
@@ -46,7 +46,7 @@ const NEWAPI_DEFAULT_MODELS: UniversalProviderModels = {
|
||||
opusModel: "claude-sonnet-4-20250514",
|
||||
},
|
||||
codex: {
|
||||
model: "gpt-4o",
|
||||
model: "gpt-5.4",
|
||||
reasoningEffort: "high",
|
||||
},
|
||||
gemini: {
|
||||
|
||||
@@ -37,7 +37,7 @@ export const OMO_BUILTIN_AGENTS: OmoAgentDef[] = [
|
||||
display: "Hephaestus",
|
||||
descKey: "omo.agentDesc.hephaestus",
|
||||
tooltipKey: "omo.agentTooltip.hephaestus",
|
||||
recommended: "gpt-5.3-codex",
|
||||
recommended: "gpt-5.4",
|
||||
group: "main",
|
||||
},
|
||||
{
|
||||
@@ -61,7 +61,7 @@ export const OMO_BUILTIN_AGENTS: OmoAgentDef[] = [
|
||||
display: "Oracle",
|
||||
descKey: "omo.agentDesc.oracle",
|
||||
tooltipKey: "omo.agentTooltip.oracle",
|
||||
recommended: "gpt-5.2",
|
||||
recommended: "gpt-5.4",
|
||||
group: "sub",
|
||||
},
|
||||
{
|
||||
@@ -101,7 +101,7 @@ export const OMO_BUILTIN_AGENTS: OmoAgentDef[] = [
|
||||
display: "Momus",
|
||||
descKey: "omo.agentDesc.momus",
|
||||
tooltipKey: "omo.agentTooltip.momus",
|
||||
recommended: "gpt-5.2",
|
||||
recommended: "gpt-5.4",
|
||||
group: "sub",
|
||||
},
|
||||
{
|
||||
@@ -126,14 +126,14 @@ export const OMO_BUILTIN_CATEGORIES: OmoCategoryDef[] = [
|
||||
display: "Ultrabrain",
|
||||
descKey: "omo.categoryDesc.ultrabrain",
|
||||
tooltipKey: "omo.categoryTooltip.ultrabrain",
|
||||
recommended: "gpt-5.3-codex",
|
||||
recommended: "gpt-5.4",
|
||||
},
|
||||
{
|
||||
key: "deep",
|
||||
display: "Deep",
|
||||
descKey: "omo.categoryDesc.deep",
|
||||
tooltipKey: "omo.categoryTooltip.deep",
|
||||
recommended: "gpt-5.3-codex",
|
||||
recommended: "gpt-5.4",
|
||||
},
|
||||
{
|
||||
key: "artistry",
|
||||
@@ -327,7 +327,7 @@ export const OMO_SLIM_BUILTIN_AGENTS: OmoAgentDef[] = [
|
||||
display: "Oracle",
|
||||
descKey: "omo.slimAgentDesc.oracle",
|
||||
tooltipKey: "omo.slimAgentTooltip.oracle",
|
||||
recommended: "gpt-5.2",
|
||||
recommended: "gpt-5.4",
|
||||
group: "sub",
|
||||
},
|
||||
{
|
||||
@@ -359,7 +359,7 @@ export const OMO_SLIM_BUILTIN_AGENTS: OmoAgentDef[] = [
|
||||
display: "Fixer",
|
||||
descKey: "omo.slimAgentDesc.fixer",
|
||||
tooltipKey: "omo.slimAgentTooltip.fixer",
|
||||
recommended: "gpt-5.3-codex",
|
||||
recommended: "gpt-5.4",
|
||||
group: "sub",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user