From 791e722fcaac9ce96d75af6d7d507065c26942fd Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 12 Mar 2026 21:37:53 -0700 Subject: [PATCH] fix: strip marker in sendToAgent before returning to callers (#584) Co-authored-by: Letta Code --- src/core/bot.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/bot.ts b/src/core/bot.ts index 6efd03d..88947a7 100644 --- a/src/core/bot.ts +++ b/src/core/bot.ts @@ -1955,6 +1955,12 @@ export class LettaBot implements AgentSession { } } + // Strip marker so callers (cron, webhooks) see empty string + if (response.trim() === '') { + log.info('sendToAgent: agent responded with marker, suppressing'); + response = ''; + } + if (isSilent && response.trim()) { if (usedMessageCli || executedDirectives) { log.info(`Silent mode: agent delivered via ${[usedMessageCli && 'CLI', executedDirectives && 'directives'].filter(Boolean).join(' + ')}, remaining text (${response.length} chars) not delivered`);