Skip to content

fix(pulse/telegram): correct canUseTool return schema to match SDK's expected shape#1434

Closed
ichoosetoaccept wants to merge 1 commit into
danielmiessler:mainfrom
ichoosetoaccept:fix/telegram-canusetool-schema
Closed

fix(pulse/telegram): correct canUseTool return schema to match SDK's expected shape#1434
ichoosetoaccept wants to merge 1 commit into
danielmiessler:mainfrom
ichoosetoaccept:fix/telegram-canusetool-schema

Conversation

@ichoosetoaccept

Copy link
Copy Markdown

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.

…expected shape

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.
@ichoosetoaccept

Copy link
Copy Markdown
Author

This change is part of the following stack:

Change managed by git-spice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram bot: canUseTool returns wrong schema (result/reason instead of behavior/updatedInput/message) — ZodError blocks every tool call

1 participant