fix(coding-agent): fixed completion notification to only send when interactive mode is in foreground

- Fixed completion notification to only send when interactive mode is in foreground.
- Improved completion notification message to include session title when available.
This commit is contained in:
can1357
2026-01-10 02:21:54 +01:00
parent 84ca6f96e3
commit f8775c4b0a
2 changed files with 8 additions and 1 deletions
@@ -1484,11 +1484,14 @@ export class InteractiveMode {
}
private sendCompletionNotification(): void {
if (this.isBackgrounded === false) return;
if (isNotificationSuppressed()) return;
const method = this.settingsManager.getNotificationOnComplete();
if (method === "off") return;
const protocol = method === "auto" ? detectNotificationProtocol() : method;
sendNotification(protocol, "Agent complete");
const title = this.sessionManager.getSessionTitle();
const message = title ? `${title}: Complete` : "Complete";
sendNotification(protocol, message);
}
/** Extract text content from a user message */