fix: preserve analyzer clarification state
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-06 18:37:39 +08:00
parent 8357e69820
commit 4167f30fce

View File

@ -72,6 +72,7 @@ function applyDirectExecutionPolicy(
const compactText = params.text.replace(/\s+/g, "").trim();
const hasAnyRequestText = compactText.length > 0;
const keepClarification = Boolean(result.needsClarification);
const normalizedIntent = result.intent === "chat" || result.intent === "vision" ? "image_edit" : result.intent;
const normalizedSubIntent =
normalizedIntent === "image_edit"
@ -83,8 +84,8 @@ function applyDirectExecutionPolicy(
intent: normalizedIntent,
subIntent: normalizedSubIntent,
confidence: Math.max(result.confidence, 0.72),
needsClarification: false,
clarifyingQuestions: [],
needsClarification: keepClarification,
clarifyingQuestions: keepClarification ? result.clarifyingQuestions || [] : [],
conversationalReply:
result.conversationalReply ||
(hasAnyRequestText ? "收到,我会按你的描述直接执行生成。" : "收到图片,我先按保真优化策略直接执行生成。"),