Merge pull request #2111 from code-yeongyu/fix/background-notification-idle-queue

fix(background-agent): queue notifications for idle parent sessions
This commit is contained in:
YeonGyu-Kim
2026-02-25 16:30:09 +09:00
committed by GitHub
5 changed files with 144 additions and 0 deletions
+16
View File
@@ -9,6 +9,14 @@ interface EventInput {
event: Event
}
interface ChatMessageInput {
sessionID: string
}
interface ChatMessageOutput {
parts: Array<{ type: string; text?: string; [key: string]: unknown }>
}
/**
* Background notification hook - handles event routing to BackgroundManager.
*
@@ -20,7 +28,15 @@ export function createBackgroundNotificationHook(manager: BackgroundManager) {
manager.handleEvent(event)
}
const chatMessageHandler = async (
input: ChatMessageInput,
output: ChatMessageOutput,
): Promise<void> => {
manager.injectPendingNotificationsIntoChatMessage(output, input.sessionID)
}
return {
"chat.message": chatMessageHandler,
event: eventHandler,
}
}