Skip to content

docs(python): clarify available_tools/excluded_tools filter all tools, not just built-ins#1180

Open
loganrosen wants to merge 1 commit intogithub:mainfrom
loganrosen:fix/available-tools-docstrings-1179
Open

docs(python): clarify available_tools/excluded_tools filter all tools, not just built-ins#1180
loganrosen wants to merge 1 commit intogithub:mainfrom
loganrosen:fix/available-tools-docstrings-1179

Conversation

@loganrosen
Copy link
Copy Markdown

Summary

Update docstrings in client.py and inline comments in session.py to accurately document that available_tools and excluded_tools apply to the full merged tool catalog (built-in, MCP, and custom tools registered via tools=), not just built-in tools.

Changes

  • python/copilot/client.py: Updated create_session and resume_session docstrings to replace misleading "built-in tools" language with accurate descriptions covering the full tool catalog.
  • python/copilot/session.py: Updated inline comments on CreateSessionConfig and ResumeSessionConfig TypedDicts with the same clarification.

Motivation

The client.py docstrings said:

available_tools: Allowlist of built-in tools to enable.
excluded_tools: List of built-in tools to disable.

But the actual behavior (consistent across all SDKs) applies these filters to the entire merged tool catalog. This caused silent loss of custom tool visibility when using an allowlist without explicitly naming custom tools — a particularly painful gotcha in least-privilege/InfoSec configurations.

Fixes #1179

…, not just built-ins

Update docstrings in client.py and inline comments in session.py to
accurately document that available_tools and excluded_tools apply to
the full merged tool catalog (built-in, MCP, and custom tools registered
via tools=), not just built-in tools.

Fixes github#1179

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 17:26
@loganrosen loganrosen requested a review from a team as a code owner April 30, 2026 17:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Python SDK documentation to correctly describe how available_tools and excluded_tools are applied, aligning docstrings/comments with the runtime’s actual behavior (filtering the full merged tool catalog, not only built-ins).

Changes:

  • Clarified create_session / resume_session docstrings to state that tool allow/deny lists apply to built-in, MCP, and custom tools (including those passed via tools=).
  • Updated SessionConfig / ResumeSessionConfig inline comments with the same clarification.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/copilot/client.py Docstrings updated to accurately document tool filtering semantics across the merged catalog.
python/copilot/session.py TypedDict inline comments updated to match the merged-catalog filtering behavior.

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.

available_tools and excluded_tools filter custom tools registered via tools=, contradicting client.py docstrings

2 participants