fix: adapt frontend for legacy Chrome and runtime config

This commit is contained in:
fengxiangdebaozi committed 2026-07-11 16:55:08 +08:00
1 parent db2f21191c
commit 388a9133fc
84 files changed
+1186 -528

No files matched your search

@@ -288,7 +288,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
const hasFiles = !!(files && files.length > 0);
if (!trimmed && !hasFiles) return;
if (!intentThreadId) {
triggerToast("⚠️ 任务理解智能体尚未就绪,请稍候");
triggerToast("任务理解智能体尚未就绪,请稍候");
return;
}
// 重入保护用 ref 而不是 state:isIntentSending 是 React state,
@@ -379,7 +379,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
: m,
),
);
triggerToast(`❌ 文件上传失败: ${(err as Error).message}`);
triggerToast(`文件上传失败: ${(err as Error).message}`);
if (intentAborterRef.current === aborter) {
intentAborterRef.current = null;
}
@@ -517,7 +517,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
: resolvedSummary.objective,
},
]);
triggerToast("✅ 任务理解完成,可进入多智能体圆桌研讨");
triggerToast("任务理解完成,可进入多智能体圆桌研讨");
} else if (res.status === "clarification" && res.clarifications.length > 0) {
setPendingIntentClarificationMsgId(agentMsgId);
setIntentClarificationSelections((prev) => {
@@ -536,7 +536,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
setIntentInitError(res.content);
setIntentInitErrorDetail(null);
}
triggerToast(`❌ 智能体调用失败: ${res.content}`);
triggerToast(`智能体调用失败: ${res.content}`);
}
} catch (err) {
if ((err as Error).name === "AbortError" || aborter.signal.aborted) {
@@ -567,7 +567,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
: m,
),
);
triggerToast(`❌ 发送失败: ${(err as Error).message}`);
triggerToast(`发送失败: ${(err as Error).message}`);
}
} finally {
if (intentAborterRef.current === aborter) {