docs(python): clarify available_tools/excluded_tools filter all tools, not just built-ins#1180
Open
loganrosen wants to merge 1 commit intogithub:mainfrom
Open
docs(python): clarify available_tools/excluded_tools filter all tools, not just built-ins#1180loganrosen wants to merge 1 commit intogithub:mainfrom
loganrosen wants to merge 1 commit intogithub:mainfrom
Conversation
…, 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>
Contributor
There was a problem hiding this comment.
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_sessiondocstrings to state that tool allow/deny lists apply to built-in, MCP, and custom tools (including those passed viatools=). - Updated
SessionConfig/ResumeSessionConfiginline 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update docstrings in
client.pyand inline comments insession.pyto accurately document thatavailable_toolsandexcluded_toolsapply to the full merged tool catalog (built-in, MCP, and custom tools registered viatools=), not just built-in tools.Changes
python/copilot/client.py: Updatedcreate_sessionandresume_sessiondocstrings to replace misleading "built-in tools" language with accurate descriptions covering the full tool catalog.python/copilot/session.py: Updated inline comments onCreateSessionConfigandResumeSessionConfigTypedDicts with the same clarification.Motivation
The
client.pydocstrings said: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