fix(ui): 5 项 E2E 测试 Bug 修复 — Agent 502 / 错误持久化 / 模型标记 / 侧面板 / 记忆页
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
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
- BUG-01: createFromTemplate 在 saas-relay 模式下 try-catch 跳过本地 Kernel - BUG-02: upsertActiveConversation 持久化前剥离 error/streaming/optimistic 字段 - BUG-04: ModelSelector 添加 available 标记,ChatArea 追踪失败模型 ID - BUG-05: VikingPanel 移除 status?.available 门控,不可用时 disabled + 重连按钮 - BUG-06: 侧面板 tooltip 改为"查看产物文件",空状态增加图标和说明
This commit is contained in:
@@ -72,13 +72,27 @@ export function ChatArea({ compact, onOpenDetail }: { compact?: boolean; onOpenD
|
||||
const saasModels = useSaaSStore((s) => s.availableModels);
|
||||
const isLoggedIn = useSaaSStore((s) => s.isLoggedIn);
|
||||
|
||||
// Track models that failed with API key errors in this session
|
||||
const failedModelIds = useRef<Set<string>>(new Set());
|
||||
|
||||
// Scan messages for API key errors to populate failedModelIds
|
||||
useEffect(() => {
|
||||
for (const msg of messages) {
|
||||
if (msg.error && (msg.error.includes('没有可用的 API Key') || msg.error.includes('Key Pool'))) {
|
||||
failedModelIds.current.add(currentModel);
|
||||
}
|
||||
}
|
||||
}, [messages, currentModel]);
|
||||
|
||||
// Merge models: SaaS available models take priority when logged in
|
||||
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),
|
||||
}));
|
||||
}
|
||||
if (configModels.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user