-
Notifications
You must be signed in to change notification settings - Fork 5
[Bug] /ask mode fails with Claude Code 2.1.80: --allowedTools "" causes prompt argument to be ignored #45
Copy link
Copy link
Open
Description
Description
When using /ask in Discord, the agent always returns:
❌ Error: Input must be provided either through stdin or as a prompt argument when using --print
This happens regardless of what prompt text is entered. /code works fine.
Root Cause
In the source code, askModeArgs is set to ["--allowedTools", ""]. When Claude Code is invoked in auto permission mode, the final command becomes:
claude -p --output-format stream-json --verbose --allowedTools "" "actual prompt here"
Claude Code 2.1.80 treats the empty string "" from --allowedTools as the positional prompt argument, causing the actual prompt to be silently dropped. This results in the "Input must be provided" error.
Reproduction
# This fails:
claude -p --output-format stream-json --verbose --allowedTools "" "hello"
# Error: Input must be provided either through stdin or as a prompt argument when using --print
# This works:
claude -p --output-format stream-json --verbose "hello"
# Returns response correctlyEnvironment
@doctorwu/agent-inbox: 1.2.5- Claude Code: 2.1.80
- Node: v24.14.0
- Platform: macOS (arm64)
- IM: Discord
Workaround
Change all askModeArgs assignments in dist/index.mjs from ["--allowedTools", ""] to [].
Suggested Fix
In the source code, either:
- Remove
--allowedTools ""from ask mode args entirely, or - Only include
--allowedToolswhen a non-empty value is provided
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels