feat: enhance session UX and codex defaults

This commit is contained in:
shiyue
2026-05-15 18:35:38 +08:00
parent a6f3ab0485
commit 62ab6f358d
5 changed files with 564 additions and 45 deletions

View File

@@ -6,6 +6,7 @@ function createAgentRuntime(deps) {
MODEL_MAP,
loadModelConfig,
applyCustomTemplateToSettings,
getDefaultCodexModel,
loadCodexConfig,
prepareCodexCustomRuntime,
wsSend,
@@ -96,13 +97,13 @@ function createAgentRuntime(deps) {
break;
}
const effectiveModel = session.model;
const effectiveModel = session.model || getDefaultCodexModel();
if (effectiveModel) {
const raw = String(effectiveModel).trim();
// cc-web UI supports "gpt-5.4(high)" style selection, but Codex CLI expects:
// - model: "gpt-5.4"
// - reasoning effort: config key `model_reasoning_effort = "high"`
const m = raw.match(/^(.*)\((medium|high|xhigh)\)\s*$/i);
const m = raw.match(/^(.*)\((low|medium|high|xhigh)\)\s*$/i);
if (m) {
const base = String(m[1] || '').trim();
const lvl = String(m[2] || '').trim().toLowerCase();