fix: codex model thinking + tool grouping

- Default new Codex sessions to gpt-5.4

- Group tool calls at 3 (was 5)

- Keep Codex tool call details collapsed by default

- Add a thinking-effort submenu and map gpt-5.x(high) to model_reasoning_effort
This commit is contained in:
cc-dan
2026-03-16 11:56:55 +00:00
parent 5c89bff357
commit c454cfa0ad
4 changed files with 144 additions and 129 deletions

View File

@@ -37,10 +37,7 @@ function createAgentRuntime(deps) {
args.push('--resume', session.claudeSessionId);
}
if (session.model) {
const validModels = new Set(Object.values(MODEL_MAP));
if (validModels.has(session.model)) {
args.push('--model', session.model);
}
args.push('--model', session.model);
}
const env = { ...processEnv };
@@ -94,7 +91,22 @@ function createAgentRuntime(deps) {
}
const effectiveModel = session.model;
if (effectiveModel) args.push('--model', effectiveModel);
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);
if (m) {
const base = String(m[1] || '').trim();
const lvl = String(m[2] || '').trim().toLowerCase();
if (base) args.push('--model', base);
// Use TOML string literal to avoid parsing ambiguity.
args.push('-c', `model_reasoning_effort="${lvl}"`);
} else {
args.push('--model', raw);
}
}
if (Array.isArray(options.attachments)) {
for (const attachment of options.attachments) {
if (attachment?.path) args.push('--image', attachment.path);