新增: 挂机模式 P1 总装: 设置面板+顶栏徽章+边界卡精简+监控告警推送
- 新增 UnattendedPanel.vue 挂机配置面板(引擎自动认领看板任务,Settings KV 热读即改即生效) - Settings.vue 接入挂机面板;searchIndex.ts 补挂机搜索词条 - TopBar.vue 新增挂机进行中徽章(脉冲动效+透明度过渡) - TaskBoundaryCard.vue 精简边界状态判定(wallState 合并比对,删冗余 watch) - i18n zh-CN/en: settings/ai/aiChat 六文件补挂机词条双语 - unattended.rs 新增 push_monitor_alert 监控告警推送(异常快照+告警头直发 monitor_chat) - feishu_notify.rs push/push_card 出口重构收敛 - lib.rs 注册 unattended_status/unattended_set_enabled 两 IPC - aiShared.ts/useAiStreamingEvents.ts 挂机状态流接入
This commit is contained in:
@@ -532,10 +532,14 @@ export function flushCurrentText(): void {
|
||||
resetDelta()
|
||||
return
|
||||
}
|
||||
// 从末尾向前找最后一个非 isError assistant 气泡写入(跳过重试错误气泡,保留部分回复)
|
||||
// 从末尾向前找最后一个非 isError assistant 气泡写入。skip 模式而非 break:
|
||||
// 尾部可能插着非 assistant 消息(incomplete 系统提示/error 气泡/重试过渡气泡等),
|
||||
// 原 break 会让循环在非 assistant 处提前终止,本轮 LLM 回复文本不写入任何气泡即被
|
||||
// 清空,屏幕只剩空气泡+光标(用户多次反馈的「流式后瞬间清空」主根因)。
|
||||
// continue 跳过非 assistant,继续向前找最近的 assistant 气泡承接。
|
||||
for (let i = s.messages.length - 1; i >= 0; i--) {
|
||||
const m = s.messages[i]
|
||||
if (m.role !== 'assistant') break
|
||||
if (m.role !== 'assistant') continue
|
||||
if (!m.isError) {
|
||||
m.content = s.currentText
|
||||
break
|
||||
|
||||
@@ -49,12 +49,20 @@ export function handleStreamingEvent(event: AiChatEvent): boolean {
|
||||
flushCurrentText()
|
||||
state.currentText = ''
|
||||
clearTextIdleTimer()
|
||||
state.messages.push({
|
||||
id: `ai-${nextMsgId()}` as MessageId,
|
||||
role: 'assistant',
|
||||
content: '',
|
||||
timestamp: Date.now(),
|
||||
})
|
||||
// 防空气泡叠罗汉(BUG-2026-10-07):flush 后若末条仍是「空 content 且非 isError 的
|
||||
// assistant 气泡」,说明上一轮 LLM 只发 tool_calls 无文本(工具结果在 toolCalls 桶不在
|
||||
// content),直接复用该气泡承接本轮,不再新推——否则纯工具轮每轮推一个空气泡,
|
||||
// 折叠后尾泡渲染成「空气泡+光标」(BUG-260624 表症根因之二)。
|
||||
const tail = state.messages[state.messages.length - 1]
|
||||
const reusableTail = tail && tail.role === 'assistant' && !tail.isError && !tail.content?.trim()
|
||||
if (!reusableTail) {
|
||||
state.messages.push({
|
||||
id: `ai-${nextMsgId()}` as MessageId,
|
||||
role: 'assistant',
|
||||
content: '',
|
||||
timestamp: Date.now(),
|
||||
})
|
||||
}
|
||||
// round>0 才更新进度条(round=0 是审批通过后「隔开新一轮」的占位,实际轮次未推进,防闪烁)
|
||||
if (event.round > 0) state.agentRound = event.round
|
||||
// #14 桌面任务卡:per-conv 轮次追踪,前台会话在此写(取 max 防事件乱序回退);
|
||||
|
||||
Reference in New Issue
Block a user