replace execution plan with optimized prompt
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-09 22:29:00 +08:00
parent 45aabb9999
commit d62de1d239
2 changed files with 6 additions and 13 deletions

View File

@ -296,18 +296,15 @@ function injectOptimizedPromptSection(params: {
return message.replace(optimizedSectionRegex, optimizedPromptSection);
}
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
if (outputSectionRegex.test(message)) {
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
}
const executionSectionRegex =
/(?:###\s*执行计划|【\s*执行计划\s*】)[\s\S]*?(?=\n(?:###\s*|【\s*[^】]+\s*】)|$)/;
if (executionSectionRegex.test(message)) {
return message.replace(executionSectionRegex, (matchedSection) => {
const trimmedSection = matchedSection.replace(/\s+$/, "");
return `${trimmedSection}\n${optimizedPromptSection}`;
});
return message.replace(executionSectionRegex, optimizedPromptSection);
}
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
if (outputSectionRegex.test(message)) {
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
}
return `${message.trim()}\n\n${optimizedPromptSection}`;

View File

@ -1902,10 +1902,6 @@ const optimizeNode = async (state: AutoAgentStateType) => {
videoPlan,
};
}
if (state.execution.mode === "edit_image" && !state.analysis.subIntent) {
const recommendedImageParams = heuristicImageParams(state.text, state.analysis);
return { recommendedImageParams };
}
if (!state.execution.shouldApplyImagePipeline) {
return {};
}