Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,8 @@ data/
sessions/
backups/
uploads/
config/mcp.json
config/mcp.json
# Local env backups (ignored)
.env.bak
.env.bak2
.env.kai
12 changes: 8 additions & 4 deletions src/claude/sdk_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,15 @@ def _stderr_callback(line: str) -> None:
path=str(claude_md_path),
)

# When DISABLE_TOOL_VALIDATION=true, pass None for allowed/disallowed
# tools so the SDK does not restrict tool usage (e.g. MCP tools).
# When DISABLE_TOOL_VALIDATION=true, pass [] (not None) for
# allowed/disallowed tools. claude-agent-sdk subprocess_cli.py
# calls list(options.allowed_tools) unconditionally and crashes
# with "'NoneType' object is not iterable". Empty list is treated
# by the CLI as "no --allowedTools flag" → no restriction, which
# is the intent of DISABLE_TOOL_VALIDATION=true.
if self.config.disable_tool_validation:
sdk_allowed_tools = None
sdk_disallowed_tools = None
sdk_allowed_tools = []
sdk_disallowed_tools = []
else:
sdk_allowed_tools = self.config.claude_allowed_tools
sdk_disallowed_tools = self.config.claude_disallowed_tools
Expand Down