fix(python): use 'is not None' check for excluded_tools in session methods#596
fix(python): use 'is not None' check for excluded_tools in session methods#596
Conversation
…thods Fix truthy check for excluded_tools in create_session and resume_session that silently dropped empty lists ([]), preventing callers from explicitly clearing excluded tools. This is the remaining half of #487 — available_tools was already fixed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the Python SDK where truthy checks for excluded_tools in create_session and resume_session methods would silently drop empty lists ([]), preventing callers from explicitly clearing excluded tools. This is the second half of the fix for #487, as available_tools was already corrected to use is not None checks.
Changes:
- Updated
excluded_toolsconditional checks from truthy (if excluded_tools:) to explicit None checks (if excluded_tools is not None:) in bothcreate_sessionandresume_sessionmethods
Cross-SDK Consistency Review ✅I've reviewed this PR for consistency across all SDK implementations (Node.js, Python, Go, .NET). Finding: No consistency issues detected This PR fixes a Python-specific bug where the truthy check
All SDKs now consistently support the use case from #487: explicitly passing an empty list/array to clear default tools, while also correctly handling Verified locations:
This PR maintains cross-SDK consistency and completes the fix started in #487. 👍
|
Fix truthy check for
excluded_toolsincreate_sessionandresume_sessionthat silently dropped empty lists ([]), preventing callers from explicitly clearing excluded tools.This is the remaining half of #487 —
available_toolswas already fixed on main.Closes #487