fix: deduplicate desktop notifications and tighten notification text extraction
Desktop notifications no longer duplicate when native delivery succeeds Reasoning chain-of-thought is excluded from notification body text Untyped message parts are ignored in notification text extraction
This commit is contained in:
@@ -326,11 +326,12 @@ type UiNotificationPayload = {
|
||||
body?: unknown
|
||||
tag?: unknown
|
||||
kind?: unknown
|
||||
sessionId?: unknown
|
||||
directory?: unknown
|
||||
requireHidden?: unknown
|
||||
desktopStdoutActive?: unknown
|
||||
}
|
||||
sessionId?: unknown
|
||||
directory?: unknown
|
||||
requireHidden?: unknown
|
||||
desktopNotificationDelivered?: unknown
|
||||
desktopStdoutActive?: unknown
|
||||
}
|
||||
|
||||
const asOptionalString = (value: unknown): string | undefined => {
|
||||
if (typeof value !== "string") return undefined
|
||||
@@ -349,9 +350,9 @@ const handleUiNotificationEvent = (payload: Event, fallbackDirectory: string): b
|
||||
}
|
||||
|
||||
const notification = properties as UiNotificationPayload
|
||||
if (notification.desktopStdoutActive === true && getRuntimeKey() === "local") {
|
||||
return true
|
||||
}
|
||||
if ((notification.desktopNotificationDelivered === true || notification.desktopStdoutActive === true) && getRuntimeKey() === "local") {
|
||||
return true
|
||||
}
|
||||
|
||||
const notifications = getRegisteredRuntimeAPIs()?.notifications
|
||||
if (!notifications?.notifyAgentCompletion) {
|
||||
|
||||
Reference in New Issue
Block a user