feat(settings): add Enable Fast toggle for Codex service tier
This commit is contained in:
@@ -121,6 +121,7 @@ interface AgentDraft {
|
|||||||
codexReasoningEffort: CodexReasoningEffort
|
codexReasoningEffort: CodexReasoningEffort
|
||||||
codexSupportsWebsockets: boolean
|
codexSupportsWebsockets: boolean
|
||||||
codexSkills: boolean
|
codexSkills: boolean
|
||||||
|
codexServiceTierFast: boolean
|
||||||
claudeMainModel: string
|
claudeMainModel: string
|
||||||
claudeReasoningModel: string
|
claudeReasoningModel: string
|
||||||
claudeDefaultHaikuModel: string
|
claudeDefaultHaikuModel: string
|
||||||
@@ -1147,6 +1148,7 @@ interface CodexTomlImportantValues {
|
|||||||
providerSupportsWebsockets: Record<string, boolean>
|
providerSupportsWebsockets: Record<string, boolean>
|
||||||
featureResponsesWebsocketsV2: boolean
|
featureResponsesWebsocketsV2: boolean
|
||||||
featureSkills: boolean
|
featureSkills: boolean
|
||||||
|
serviceTierFast: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CodexImportantValues {
|
interface CodexImportantValues {
|
||||||
@@ -1158,6 +1160,7 @@ interface CodexImportantValues {
|
|||||||
providerOptions: string[]
|
providerOptions: string[]
|
||||||
supportsWebsockets: boolean
|
supportsWebsockets: boolean
|
||||||
skills: boolean
|
skills: boolean
|
||||||
|
serviceTierFast: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const CODEX_DEFAULT_MODEL_PROVIDER = "codeg"
|
const CODEX_DEFAULT_MODEL_PROVIDER = "codeg"
|
||||||
@@ -1319,6 +1322,7 @@ function extractCodexTomlImportantValues(
|
|||||||
CODEX_DEFAULT_REASONING_EFFORT
|
CODEX_DEFAULT_REASONING_EFFORT
|
||||||
let featureResponsesWebsocketsV2 = false
|
let featureResponsesWebsocketsV2 = false
|
||||||
let featureSkills = false
|
let featureSkills = false
|
||||||
|
let serviceTierFast = false
|
||||||
let currentProviderSection: string | null = null
|
let currentProviderSection: string | null = null
|
||||||
let inFeaturesSection = false
|
let inFeaturesSection = false
|
||||||
|
|
||||||
@@ -1364,6 +1368,14 @@ function extractCodexTomlImportantValues(
|
|||||||
CODEX_DEFAULT_REASONING_EFFORT
|
CODEX_DEFAULT_REASONING_EFFORT
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
!currentProviderSection &&
|
||||||
|
!inFeaturesSection &&
|
||||||
|
assignment.key === "service_tier"
|
||||||
|
) {
|
||||||
|
serviceTierFast = assignment.value.toLowerCase() === "fast"
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const boolAssignment = parseTomlBooleanAssignment(rawLine)
|
const boolAssignment = parseTomlBooleanAssignment(rawLine)
|
||||||
@@ -1452,6 +1464,7 @@ function extractCodexTomlImportantValues(
|
|||||||
providerSupportsWebsockets,
|
providerSupportsWebsockets,
|
||||||
featureResponsesWebsocketsV2,
|
featureResponsesWebsocketsV2,
|
||||||
featureSkills,
|
featureSkills,
|
||||||
|
serviceTierFast,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1547,6 +1560,7 @@ function extractCodexImportantValues(
|
|||||||
),
|
),
|
||||||
supportsWebsockets: providerSupportsWebsockets,
|
supportsWebsockets: providerSupportsWebsockets,
|
||||||
skills: toml.featureSkills,
|
skills: toml.featureSkills,
|
||||||
|
serviceTierFast: toml.serviceTierFast,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1579,7 +1593,11 @@ function preferredTomlRootInsertionIndex(lines: string[], key: string): number {
|
|||||||
const modelIndex = findTomlRootAssignmentIndex(lines, "model")
|
const modelIndex = findTomlRootAssignmentIndex(lines, "model")
|
||||||
return modelIndex >= 0 ? modelIndex + 1 : 0
|
return modelIndex >= 0 ? modelIndex + 1 : 0
|
||||||
}
|
}
|
||||||
return findTomlRootEndIndex(lines)
|
let insertAt = findTomlRootEndIndex(lines)
|
||||||
|
while (insertAt > 0 && lines[insertAt - 1].trim() === "") {
|
||||||
|
insertAt -= 1
|
||||||
|
}
|
||||||
|
return insertAt
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTomlRootStringKey(
|
function updateTomlRootStringKey(
|
||||||
@@ -1952,6 +1970,7 @@ function patchCodexConfigTomlText(
|
|||||||
modelReasoningEffort?: string
|
modelReasoningEffort?: string
|
||||||
supportsWebsockets?: boolean
|
supportsWebsockets?: boolean
|
||||||
skills?: boolean
|
skills?: boolean
|
||||||
|
serviceTierFast?: boolean
|
||||||
}
|
}
|
||||||
): string {
|
): string {
|
||||||
let nextTomlText = configTomlText
|
let nextTomlText = configTomlText
|
||||||
@@ -2052,6 +2071,13 @@ function patchCodexConfigTomlText(
|
|||||||
patch.skills ? true : null
|
patch.skills ? true : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (typeof patch.serviceTierFast === "boolean") {
|
||||||
|
nextTomlText = updateTomlRootStringKey(
|
||||||
|
nextTomlText,
|
||||||
|
"service_tier",
|
||||||
|
patch.serviceTierFast ? "fast" : ""
|
||||||
|
)
|
||||||
|
}
|
||||||
nextTomlText = updateTomlRootBooleanKey(
|
nextTomlText = updateTomlRootBooleanKey(
|
||||||
nextTomlText,
|
nextTomlText,
|
||||||
"disable_response_storage",
|
"disable_response_storage",
|
||||||
@@ -2286,6 +2312,7 @@ function buildAgentDraft(agent: AcpAgentInfo): AgentDraft {
|
|||||||
codexReasoningEffort: codexImportant.reasoningEffort,
|
codexReasoningEffort: codexImportant.reasoningEffort,
|
||||||
codexSupportsWebsockets: codexImportant.supportsWebsockets,
|
codexSupportsWebsockets: codexImportant.supportsWebsockets,
|
||||||
codexSkills: codexImportant.skills,
|
codexSkills: codexImportant.skills,
|
||||||
|
codexServiceTierFast: codexImportant.serviceTierFast,
|
||||||
claudeMainModel: important.claudeMainModel,
|
claudeMainModel: important.claudeMainModel,
|
||||||
claudeReasoningModel: important.claudeReasoningModel,
|
claudeReasoningModel: important.claudeReasoningModel,
|
||||||
claudeDefaultHaikuModel: important.claudeDefaultHaikuModel,
|
claudeDefaultHaikuModel: important.claudeDefaultHaikuModel,
|
||||||
@@ -4519,6 +4546,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: important.reasoningEffort,
|
codexReasoningEffort: important.reasoningEffort,
|
||||||
codexSupportsWebsockets: important.supportsWebsockets,
|
codexSupportsWebsockets: important.supportsWebsockets,
|
||||||
codexSkills: important.skills,
|
codexSkills: important.skills,
|
||||||
|
codexServiceTierFast: important.serviceTierFast,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
[selectedAgent, selectedDraft, updateSelectedDraft]
|
[selectedAgent, selectedDraft, updateSelectedDraft]
|
||||||
@@ -4542,6 +4570,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: important.reasoningEffort,
|
codexReasoningEffort: important.reasoningEffort,
|
||||||
codexSupportsWebsockets: important.supportsWebsockets,
|
codexSupportsWebsockets: important.supportsWebsockets,
|
||||||
codexSkills: important.skills,
|
codexSkills: important.skills,
|
||||||
|
codexServiceTierFast: important.serviceTierFast,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
[selectedAgent, selectedDraft, updateSelectedDraft]
|
[selectedAgent, selectedDraft, updateSelectedDraft]
|
||||||
@@ -4594,6 +4623,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: synced.reasoningEffort,
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
codexSupportsWebsockets: synced.supportsWebsockets,
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
codexSkills: synced.skills,
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
}))
|
}))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -4627,6 +4657,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: synced.reasoningEffort,
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
codexSupportsWebsockets: synced.supportsWebsockets,
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
codexSkills: synced.skills,
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
[selectedAgent, selectedDraft, updateSelectedDraft]
|
[selectedAgent, selectedDraft, updateSelectedDraft]
|
||||||
@@ -4693,6 +4724,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: synced.reasoningEffort,
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
codexSupportsWebsockets: synced.supportsWebsockets,
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
codexSkills: synced.skills,
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
codexAuthJsonText: nextAuth.authJsonText,
|
codexAuthJsonText: nextAuth.authJsonText,
|
||||||
codexConfigTomlText: nextToml,
|
codexConfigTomlText: nextToml,
|
||||||
}))
|
}))
|
||||||
@@ -4729,6 +4761,7 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: synced.reasoningEffort,
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
codexSupportsWebsockets: synced.supportsWebsockets,
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
codexSkills: synced.skills,
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
codexConfigTomlText: nextToml,
|
codexConfigTomlText: nextToml,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@@ -4761,6 +4794,40 @@ export function AcpAgentSettings() {
|
|||||||
codexReasoningEffort: synced.reasoningEffort,
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
codexSupportsWebsockets: synced.supportsWebsockets,
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
codexSkills: synced.skills,
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
|
codexConfigTomlText: nextToml,
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
[selectedAgent, selectedDraft, updateSelectedDraft]
|
||||||
|
)
|
||||||
|
|
||||||
|
const handleCodexServiceTierFastChange = useCallback(
|
||||||
|
(enabled: boolean) => {
|
||||||
|
if (
|
||||||
|
!selectedAgent ||
|
||||||
|
!selectedDraft ||
|
||||||
|
selectedAgent.agent_type !== "codex"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
const nextToml = patchCodexConfigTomlText(
|
||||||
|
selectedDraft.codexConfigTomlText,
|
||||||
|
{ serviceTierFast: enabled }
|
||||||
|
)
|
||||||
|
const synced = extractCodexImportantValues(
|
||||||
|
selectedDraft.codexAuthJsonText,
|
||||||
|
nextToml
|
||||||
|
)
|
||||||
|
updateSelectedDraft((current) => ({
|
||||||
|
...current,
|
||||||
|
apiBaseUrl: synced.apiBaseUrl,
|
||||||
|
apiKey: synced.apiKey ?? current.apiKey,
|
||||||
|
model: synced.model,
|
||||||
|
codexModelProvider: synced.modelProvider,
|
||||||
|
codexProviderOptions: synced.providerOptions,
|
||||||
|
codexReasoningEffort: synced.reasoningEffort,
|
||||||
|
codexSupportsWebsockets: synced.supportsWebsockets,
|
||||||
|
codexSkills: synced.skills,
|
||||||
|
codexServiceTierFast: synced.serviceTierFast,
|
||||||
codexConfigTomlText: nextToml,
|
codexConfigTomlText: nextToml,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@@ -5351,6 +5418,19 @@ export function AcpAgentSettings() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
<div className="flex items-center justify-between rounded-md border px-3 py-2">
|
||||||
|
<label className="text-[11px] text-muted-foreground">
|
||||||
|
{t("codex.enableFast")}
|
||||||
|
</label>
|
||||||
|
<Switch
|
||||||
|
checked={selectedDraft.codexServiceTierFast}
|
||||||
|
onCheckedChange={handleCodexServiceTierFastChange}
|
||||||
|
aria-label={t("codex.enableFastAria")}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="space-y-1.5">
|
<div className="space-y-1.5">
|
||||||
<label className="text-[11px] text-muted-foreground">
|
<label className="text-[11px] text-muted-foreground">
|
||||||
{t("codex.authJsonNative")}
|
{t("codex.authJsonNative")}
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "تفعيل WebSocket لـ Codex Provider",
|
"enableWebsocketAria": "تفعيل WebSocket لـ Codex Provider",
|
||||||
"enableSkills": "تفعيل Skills",
|
"enableSkills": "تفعيل Skills",
|
||||||
"enableSkillsAria": "تفعيل Skills لـ Codex",
|
"enableSkillsAria": "تفعيل Skills لـ Codex",
|
||||||
|
"enableFast": "تفعيل Fast",
|
||||||
|
"enableFastAria": "تفعيل مستوى خدمة Fast لـ Codex",
|
||||||
"authJsonNative": "auth.json (أصلي)",
|
"authJsonNative": "auth.json (أصلي)",
|
||||||
"configTomlNative": "config.toml (أصلي)"
|
"configTomlNative": "config.toml (أصلي)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "WebSocket für Codex Provider aktivieren",
|
"enableWebsocketAria": "WebSocket für Codex Provider aktivieren",
|
||||||
"enableSkills": "Skills aktivieren",
|
"enableSkills": "Skills aktivieren",
|
||||||
"enableSkillsAria": "Skills für Codex aktivieren",
|
"enableSkillsAria": "Skills für Codex aktivieren",
|
||||||
|
"enableFast": "Fast aktivieren",
|
||||||
|
"enableFastAria": "Fast-Servicestufe für Codex aktivieren",
|
||||||
"authJsonNative": "auth.json (nativ)",
|
"authJsonNative": "auth.json (nativ)",
|
||||||
"configTomlNative": "config.toml (nativ)"
|
"configTomlNative": "config.toml (nativ)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Enable WebSocket for Codex Provider",
|
"enableWebsocketAria": "Enable WebSocket for Codex Provider",
|
||||||
"enableSkills": "Enable Skills",
|
"enableSkills": "Enable Skills",
|
||||||
"enableSkillsAria": "Enable Skills for Codex",
|
"enableSkillsAria": "Enable Skills for Codex",
|
||||||
|
"enableFast": "Enable Fast",
|
||||||
|
"enableFastAria": "Enable Fast service tier for Codex",
|
||||||
"authJsonNative": "auth.json (native)",
|
"authJsonNative": "auth.json (native)",
|
||||||
"configTomlNative": "config.toml (native)"
|
"configTomlNative": "config.toml (native)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Habilitar WebSocket para Codex Provider",
|
"enableWebsocketAria": "Habilitar WebSocket para Codex Provider",
|
||||||
"enableSkills": "Habilitar Skills",
|
"enableSkills": "Habilitar Skills",
|
||||||
"enableSkillsAria": "Habilitar Skills para Codex",
|
"enableSkillsAria": "Habilitar Skills para Codex",
|
||||||
|
"enableFast": "Habilitar Fast",
|
||||||
|
"enableFastAria": "Habilitar nivel de servicio Fast para Codex",
|
||||||
"authJsonNative": "auth.json (nativo)",
|
"authJsonNative": "auth.json (nativo)",
|
||||||
"configTomlNative": "config.toml (nativo)"
|
"configTomlNative": "config.toml (nativo)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Activer WebSocket pour Codex Provider",
|
"enableWebsocketAria": "Activer WebSocket pour Codex Provider",
|
||||||
"enableSkills": "Activer Skills",
|
"enableSkills": "Activer Skills",
|
||||||
"enableSkillsAria": "Activer Skills pour Codex",
|
"enableSkillsAria": "Activer Skills pour Codex",
|
||||||
|
"enableFast": "Activer Fast",
|
||||||
|
"enableFastAria": "Activer le niveau de service Fast pour Codex",
|
||||||
"authJsonNative": "auth.json (natif)",
|
"authJsonNative": "auth.json (natif)",
|
||||||
"configTomlNative": "config.toml (natif)"
|
"configTomlNative": "config.toml (natif)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Codex Provider の WebSocket を有効化",
|
"enableWebsocketAria": "Codex Provider の WebSocket を有効化",
|
||||||
"enableSkills": "Skills を有効化",
|
"enableSkills": "Skills を有効化",
|
||||||
"enableSkillsAria": "Codex の Skills を有効化",
|
"enableSkillsAria": "Codex の Skills を有効化",
|
||||||
|
"enableFast": "Fast を有効化",
|
||||||
|
"enableFastAria": "Codex の Fast サービスティアを有効化",
|
||||||
"authJsonNative": "auth.json(ネイティブ)",
|
"authJsonNative": "auth.json(ネイティブ)",
|
||||||
"configTomlNative": "config.toml(ネイティブ)"
|
"configTomlNative": "config.toml(ネイティブ)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Codex Provider용 WebSocket 활성화",
|
"enableWebsocketAria": "Codex Provider용 WebSocket 활성화",
|
||||||
"enableSkills": "Skills 활성화",
|
"enableSkills": "Skills 활성화",
|
||||||
"enableSkillsAria": "Codex용 Skills 활성화",
|
"enableSkillsAria": "Codex용 Skills 활성화",
|
||||||
|
"enableFast": "Fast 활성화",
|
||||||
|
"enableFastAria": "Codex용 Fast 서비스 계층 활성화",
|
||||||
"authJsonNative": "auth.json (네이티브)",
|
"authJsonNative": "auth.json (네이티브)",
|
||||||
"configTomlNative": "config.toml (네이티브)"
|
"configTomlNative": "config.toml (네이티브)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Habilitar WebSocket para Codex Provider",
|
"enableWebsocketAria": "Habilitar WebSocket para Codex Provider",
|
||||||
"enableSkills": "Habilitar Skills",
|
"enableSkills": "Habilitar Skills",
|
||||||
"enableSkillsAria": "Habilitar Skills para Codex",
|
"enableSkillsAria": "Habilitar Skills para Codex",
|
||||||
|
"enableFast": "Habilitar Fast",
|
||||||
|
"enableFastAria": "Habilitar nível de serviço Fast para Codex",
|
||||||
"authJsonNative": "auth.json (nativo)",
|
"authJsonNative": "auth.json (nativo)",
|
||||||
"configTomlNative": "config.toml (nativo)"
|
"configTomlNative": "config.toml (nativo)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Codex Provider 启用 WebSocket",
|
"enableWebsocketAria": "Codex Provider 启用 WebSocket",
|
||||||
"enableSkills": "启用 Skills",
|
"enableSkills": "启用 Skills",
|
||||||
"enableSkillsAria": "Codex 启用 Skills",
|
"enableSkillsAria": "Codex 启用 Skills",
|
||||||
|
"enableFast": "启用 Fast",
|
||||||
|
"enableFastAria": "Codex 启用 Fast 服务等级",
|
||||||
"authJsonNative": "auth.json(原生)",
|
"authJsonNative": "auth.json(原生)",
|
||||||
"configTomlNative": "config.toml(原生)"
|
"configTomlNative": "config.toml(原生)"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -554,6 +554,8 @@
|
|||||||
"enableWebsocketAria": "Codex Provider 啟用 WebSocket",
|
"enableWebsocketAria": "Codex Provider 啟用 WebSocket",
|
||||||
"enableSkills": "啟用 Skills",
|
"enableSkills": "啟用 Skills",
|
||||||
"enableSkillsAria": "Codex 啟用 Skills",
|
"enableSkillsAria": "Codex 啟用 Skills",
|
||||||
|
"enableFast": "啟用 Fast",
|
||||||
|
"enableFastAria": "Codex 啟用 Fast 服務等級",
|
||||||
"authJsonNative": "auth.json(原生)",
|
"authJsonNative": "auth.json(原生)",
|
||||||
"configTomlNative": "config.toml(原生)"
|
"configTomlNative": "config.toml(原生)"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user