fix(background-agent): preserve parent activity across idle events

Cubic caught that clearing recent parent activity on session.idle could reopen the stale-idle race. Keep the fresh activity marker until its normal expiry so background completions still defer while the parent turn is actively reasoning.

Red: parent idle after fresh reasoning delta dispatched an unexpected parent wake. Green: focused parent-wake regression suite passes.
This commit is contained in:
YeonGyu-Kim
2026-05-21 12:07:40 +09:00
parent a8201726ef
commit 0ad4d974f1
3 changed files with 35 additions and 5 deletions
-1
View File
@@ -1625,7 +1625,6 @@ The fallback retry session is now created and can be inspected directly.
if (!props || typeof props !== "object") return
const sessionID = resolveSessionEventID(props)
if (sessionID) {
this.parentWakeNotifier.clearParentSessionActivity(sessionID)
void this.enqueueNotificationForParent(sessionID, () => this.flushPendingParentWake(sessionID)).catch((error) => {
log("[background-agent] Failed to flush pending parent wake:", { sessionID, error })
})