From 2286b4e64a4614fc7452c4afd55ef7975486dd4d Mon Sep 17 00:00:00 2001 From: Ismar <1242091+ichoosetoaccept@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:39:07 +0200 Subject: [PATCH] fix(pulse/telegram): correct canUseTool return schema to match SDK's expected shape MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The canUseTool permission callback in PULSE/modules/telegram.ts returned { result: "allow" | "deny", reason } instead of the shape the installed @anthropic-ai/claude-agent-sdk validates against: { behavior: "allow", updatedInput } | { behavior: "deny", message }. Since neither variant of the return value matched the SDK's Zod union, every tool-permission check threw — allow and deny alike — blocking all Read/Write/Bash calls from the Telegram bot. Conversational replies with no tool use were unaffected, which made this easy to miss. Fixes #1433. --- LifeOS/install/LIFEOS/PULSE/modules/telegram.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts b/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts index 708730b7d..faceff3b0 100644 --- a/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts +++ b/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts @@ -847,10 +847,10 @@ export async function startTelegram(config: TelegramConfig): Promise { : String(input) if (cmd.includes("31337") || cmd.includes("/notify")) { log("warn", "canUseTool blocked /notify curl from SDK subprocess", { cmd: cmd.slice(0, 200) }) - return { result: "deny", reason: "Telegram mode: /notify and port 31337 are blocked. Voice is delivered via Telegram sendVoice, not the desktop speaker." } + return { behavior: "deny", message: "Telegram mode: /notify and port 31337 are blocked. Voice is delivered via Telegram sendVoice, not the desktop speaker." } } } - return { result: "allow" } + return { behavior: "allow", updatedInput: (input as Record) ?? {} } }, systemPrompt: { type: "preset",