Amend notification logic to only show for end-of-turn messages without parent_conversation_id
This change modifies the notification logic to only show notifications when:
1. The message has end_of_turn = true (which was already being checked)
2. The message does not have a parent_conversation_id (new condition)
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/webui/src/web-components/sketch-app-shell.ts b/webui/src/web-components/sketch-app-shell.ts
index 221f3b2..7c618aa 100644
--- a/webui/src/web-components/sketch-app-shell.ts
+++ b/webui/src/web-components/sketch-app-shell.ts
@@ -698,8 +698,13 @@
const hasPermission = await this.checkNotificationPermission();
if (!hasPermission) return;
- // Only show notifications for agent messages with end_of_turn=true
- if (message.type !== "agent" || !message.end_of_turn) return;
+ // Only show notifications for agent messages with end_of_turn=true and no parent_conversation_id
+ if (
+ message.type !== "agent" ||
+ !message.end_of_turn ||
+ message.parent_conversation_id
+ )
+ return;
// Create a title that includes the sketch title
const notificationTitle = `Sketch: ${this.title || "untitled"}`;
@@ -765,7 +770,11 @@
// Check for agent messages with end_of_turn=true and show notifications
if (newMessages && newMessages.length > 0 && !isFirstFetch) {
for (const message of newMessages) {
- if (message.type === "agent" && message.end_of_turn) {
+ if (
+ message.type === "agent" &&
+ message.end_of_turn &&
+ !message.parent_conversation_id
+ ) {
this.showEndOfTurnNotification(message);
break; // Only show one notification per batch of messages
}