fix(desktop): Tauri 端找碴验证 7 项修复 — 消息泄漏/UUID暴露/错误友好化
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

B15/B11: streamStore onAgentStream 添加 activeRunId 过滤,移除降级匹配,
hand/workflow 消息追加前验证 runId 归属;chatStore 切换/新建对话时
先 cancelStream 终止旧流;ChatArea hand-execution-complete 事件
添加 isStreaming 守卫

B4/B5: ChatArea 模型列表过滤 embedding 模型,provider 设为 undefined
隐藏 UUID

B2/B3: streamStore onError 添加 formatUserError 函数,将原始 JSON
错误转换为中文友好提示

B1: SuggestionChips onSelect 延迟调用 handleSend 自动发送建议

fix(runtime): test_util.rs with_error 添加 mut self,with_stream_chunks
移除多余 mut

fix(saas): lib.rs 添加 Result/SaasError re-export
This commit is contained in:
iven
2026-04-21 20:29:47 +08:00
parent 79e7cd3446
commit b2908791f6
5 changed files with 67 additions and 14 deletions

View File

@@ -88,12 +88,17 @@ export function ChatArea({ compact, onOpenDetail }: { compact?: boolean; onOpenD
const models = useMemo(() => {
const failed = failedModelIds.current;
if (isLoggedIn && saasModels.length > 0) {
return saasModels.map(m => ({
id: m.alias || m.id,
name: m.alias || m.id,
provider: m.provider_id,
available: !failed.has(m.alias || m.id),
}));
return saasModels
.filter(m => {
const name = (m.alias || m.id).toLowerCase();
return !name.includes('embedding');
})
.map(m => ({
id: m.alias || m.id,
name: m.alias || m.id,
provider: undefined,
available: !failed.has(m.alias || m.id),
}));
}
if (configModels.length > 0) {
return configModels;
@@ -210,6 +215,8 @@ export function ChatArea({ compact, onOpenDetail }: { compact?: boolean; onOpenD
'hand-execution-complete',
(event) => {
const { handId, success, error } = event.payload;
const streaming = useChatStore.getState().isStreaming;
if (!streaming) return;
useChatStore.getState().addMessage({
id: crypto.randomUUID(),
role: 'hand',
@@ -502,7 +509,7 @@ export function ChatArea({ compact, onOpenDetail }: { compact?: boolean; onOpenD
{!isStreaming && suggestions.length > 0 && !messages.some(m => m.error) && (
<SuggestionChips
suggestions={suggestions}
onSelect={(text) => { setInput(text); textareaRef.current?.focus(); }}
onSelect={(text) => { setInput(text); textareaRef.current?.focus(); setTimeout(() => handleSend(), 0); }}
className="mb-3"
/>
)}