Restore generic agent mode messaging
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-27 11:56:06 +08:00
parent a219397344
commit 954d708e30
2 changed files with 6 additions and 21 deletions

View File

@ -4161,16 +4161,6 @@ export async function POST(request: Request) {
.trim();
const autoContextText = typeof autoContext === "string" ? autoContext.trim() : "";
if (composerMode === "agent" && !agentPresetId) {
return NextResponse.json(
{
code: "bad_request:api",
message: "智能体模式缺少生图模式配置,请刷新页面后重新选择生图模式再试",
},
{ status: 400 },
);
}
const now = Date.now();
for (const [key, startedAt] of inFlightChatRequests.entries()) {
if (now - startedAt > IN_FLIGHT_REQUEST_TTL_MS) {

View File

@ -7630,13 +7630,6 @@ export function CanvasChatPanel({
textContent = `请基于当前工作流设定生成方案:${workflowContext.summaryText}`;
}
const effectiveComposerMode = activeComposerModeRef.current || activeComposerMode;
if (effectiveComposerMode === "agent" && !selectedAgentPresetId) {
toast.error("智能体模式缺少生图模式配置,请先选择智能体后再发送");
activeComposerModeRef.current = computedComposerMode;
setComposerModeOverride(null);
return;
}
if (!textContent && hasAgentUploadSlots && selectedAgentPreset) {
textContent = `请按「${selectedAgentPreset.name}」智能体配置顺序处理产品图1、产品图2和模特图。`;
}
@ -8392,13 +8385,15 @@ export function CanvasChatPanel({
renderableVisibleMessages.length === 0 &&
!isLoading &&
!shouldShowImageLoading;
const workspaceEmptyTitle = !selectedAgentPresetId
? "请先在左侧选择智能体"
const workspaceEmptyTitle =
activeComposerMode === "agent" && !selectedAgentPresetId
? "直接输入需求开始对话"
: hasAgentUploadSlots && attachments.length < agentRequiredUploadCount
? `请先补齐图片槽位(${attachments.length}/${agentRequiredUploadCount})`
: "准备开始生成";
const workspaceEmptyDescription = !selectedAgentPresetId
? "切换到 Agent 模式后,请先选择智能体,随后这里会显示生成结果。"
const workspaceEmptyDescription =
activeComposerMode === "agent" && !selectedAgentPresetId
? "可直接上传图片或输入需求;如需套用预设,再选择智能体即可。"
: hasAgentUploadSlots && attachments.length < agentRequiredUploadCount
? "从左侧 SKU / SPU 获取图片,或在下方继续上传替换后,再点击开始生成。"
: "可在下方补充要求后点击开始生成,结果会显示在这里。";