Skip to content

Commit 23a9134

Browse files
patnikoCopilot
andauthored
fix(python): use 'is not None' check for excluded_tools in session methods (#596)
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>
1 parent 8e61e9b commit 23a9134

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/copilot/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ async def create_session(self, config: SessionConfig) -> CopilotSession:
497497
if available_tools is not None:
498498
payload["availableTools"] = available_tools
499499
excluded_tools = cfg.get("excluded_tools")
500-
if excluded_tools:
500+
if excluded_tools is not None:
501501
payload["excludedTools"] = excluded_tools
502502

503503
# Always enable permission request callback (deny by default if no handler provided)
@@ -675,7 +675,7 @@ async def resume_session(self, session_id: str, config: ResumeSessionConfig) ->
675675
payload["availableTools"] = available_tools
676676

677677
excluded_tools = cfg.get("excluded_tools")
678-
if excluded_tools:
678+
if excluded_tools is not None:
679679
payload["excludedTools"] = excluded_tools
680680

681681
provider = cfg.get("provider")

0 commit comments

Comments
 (0)