集成系统通知,并在Agent响应完成后发出通知

This commit is contained in:
xintaofei
2026-03-21 18:39:28 +08:00
parent e41a37cd4f
commit a9e0a742ac
17 changed files with 144 additions and 12 deletions

View File

@@ -42,6 +42,7 @@ import {
CONNECTION_IDLE_TIMEOUT_MS,
IDLE_SWEEP_INTERVAL_MS,
} from "@/lib/constants"
import { notifyTurnComplete } from "@/lib/notification"
import { useAlertContext, type AlertAction } from "@/contexts/alert-context"
// ── Shared types (re-exported for consumers) ──
@@ -1545,6 +1546,17 @@ export function AcpConnectionsProvider({ children }: { children: ReactNode }) {
}
}
}
// Send OS notification when window is not focused
{
const nc = storeRef.current.connections.get(contextKey)
if (nc) {
const agentLabel = AGENT_LABELS[nc.agentType]
notifyTurnComplete(
"Codeg",
t("notificationTurnComplete", { agent: agentLabel }),
).catch(() => {})
}
}
break
}
case "error":