From 8ccb58796595c8be073a9e525a44a21bc0b1d69d Mon Sep 17 00:00:00 2001 From: zeroaltitude Date: Mon, 9 Mar 2026 23:04:26 -0700 Subject: [PATCH] fix: gate privacy warning on !hasCustomContent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The late-set blockSessionSave privacy warning incorrectly fired when custom content was pre-set (transcript was never loaded or sent to LLM). Now only warns when transcript was actually loaded — matching the condition that guards transcript loading at line 304. --- src/hooks/bundled/session-memory/handler.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hooks/bundled/session-memory/handler.ts b/src/hooks/bundled/session-memory/handler.ts index 3057d78f170..6aeb0ddcdda 100644 --- a/src/hooks/bundled/session-memory/handler.ts +++ b/src/hooks/bundled/session-memory/handler.ts @@ -444,14 +444,17 @@ const saveSessionToMemory: HookHandler = async (event) => { if (event.context.blockSessionSave === true && inlineWriteHappened) { // Privacy note: late-set blockSessionSave retracts the file but does NOT // prevent transcript content from having already been sent to the LLM - // provider for slug generation. To prevent transcript processing entirely, - // set blockSessionSave before the session-memory handler runs (pre-set path). - log.warn( - "blockSessionSave was set by a late hook — memory file will be retracted, but " + - "transcript content may have already been sent to the LLM provider for slug generation. " + - "To prevent transcript processing entirely, set blockSessionSave before the " + - "session-memory handler runs.", - ); + // provider for slug generation — but only when the transcript was actually + // loaded (i.e. no custom content was pre-set). When hasCustomContent is + // true, transcript loading and LLM calls were skipped entirely. + if (!hasCustomContent) { + log.warn( + "blockSessionSave was set by a late hook — memory file will be retracted, but " + + "transcript content may have already been sent to the LLM provider for slug generation. " + + "To prevent transcript processing entirely, set blockSessionSave before the " + + "session-memory handler runs.", + ); + } if (preExistingContent !== null) { // Slug collision: another entry already existed at this filename // before our inline write. Restore the original content rather