Webchat: sync thinking level with session
This commit is contained in:
@@ -172,11 +172,17 @@ export async function agentCommand(
|
||||
.filter((val) => val.length > 1);
|
||||
|
||||
const thinkOverride = normalizeThinkLevel(opts.thinking);
|
||||
const thinkOnce = normalizeThinkLevel(opts.thinkingOnce);
|
||||
if (opts.thinking && !thinkOverride) {
|
||||
throw new Error(
|
||||
"Invalid thinking level. Use one of: off, minimal, low, medium, high.",
|
||||
);
|
||||
}
|
||||
if (opts.thinkingOnce && !thinkOnce) {
|
||||
throw new Error(
|
||||
"Invalid one-shot thinking level. Use one of: off, minimal, low, medium, high.",
|
||||
);
|
||||
}
|
||||
const verboseOverride = normalizeVerboseLevel(opts.verbose);
|
||||
if (opts.verbose && !verboseOverride) {
|
||||
throw new Error('Invalid verbose level. Use "on" or "off".');
|
||||
@@ -213,8 +219,9 @@ export async function agentCommand(
|
||||
const sendSystemOnce = sessionCfg?.sendSystemOnce === true;
|
||||
const isFirstTurnInSession = isNewSession || !systemSent;
|
||||
|
||||
// Merge thinking/verbose levels: flag override > persisted > defaults.
|
||||
// Merge thinking/verbose levels: one-shot override > flag override > persisted > defaults.
|
||||
const resolvedThinkLevel: ThinkLevel | undefined =
|
||||
thinkOnce ??
|
||||
thinkOverride ??
|
||||
persistedThinking ??
|
||||
(replyCfg.thinkingDefault as ThinkLevel | undefined);
|
||||
|
||||
Reference in New Issue
Block a user