fix: enable tool_search for BYOK custom Responses endpoints#319105
fix: enable tool_search for BYOK custom Responses endpoints#319105PenguinDOOM wants to merge 7 commits into
Conversation
- add intentional RED contracts for extension-contributed tool-search exposure - add GREEN BYOK metadata and custom-endpoint runtime invariants
- add supportsToolSearch parity to ExtensionContributedChatEndpoint - keep supported and unsupported non-copilot tool visibility covered by focused tests
- add a prompt/request bridge regression for endpoint tool-search capability - revalidate downstream Responses and Messages tool-search behavior without request-body changes Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class tool-search capability support for extension-contributed and BYOK endpoints, and expands Responses request construction to enable client-side tool_search under BYOK scenarios where the tool may be filtered from the request tool list.
Changes:
- Expose
supportsToolSearchonExtensionContributedChatEndpointbased on model capability matching. - Update Responses request body logic to implicitly enable client
tool_searchfor BYOK (auth-owned) endpoints in more locations. - Extend and add tests covering tool search enablement/forwarding and tool filtering behavior across endpoints and locations.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/endpoint/vscode-node/extChatEndpoint.ts | Adds supportsToolSearch getter for extension-contributed endpoints. |
| extensions/copilot/src/platform/endpoint/node/responsesApi.ts | Adjusts tool-search enablement rules for BYOK Responses endpoints and locations. |
| extensions/copilot/src/platform/endpoint/node/test/responsesApiToolSearch.spec.ts | Adds coverage for BYOK implicit client tool_search behavior when request tools omit it. |
| extensions/copilot/src/extension/tools/node/test/testToolsService.ts | Includes model-specific tools in enabled-tools computation for tests. |
| extensions/copilot/src/extension/test/vscode-node/endpoints.test.ts | Tests supportsToolSearch exposure for vendor-overridden extension-contributed endpoints. |
| extensions/copilot/src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts | Tests forwarding of tool-search support into request model capabilities. |
| extensions/copilot/src/extension/intents/node/test/backgroundTodoEnablement.spec.ts | Tests tool_search enabled-tools presence for supported extension-contributed endpoints. |
| extensions/copilot/src/extension/byok/vscode-node/test/customEndpointProvider.spec.ts | Tests BYOK endpoint supportsToolSearch inheritance from supported metadata. |
| extensions/copilot/src/extension/byok/common/test/byokProvider.spec.ts | Tests preserving model ids/family for tool-search capability matching. |
| get supportsToolSearch(): boolean { | ||
| return modelSupportsToolSearch(this.languageModel); | ||
| } |
There was a problem hiding this comment.
This call is intentional. modelSupportsToolSearch accepts LanguageModelChat | IChatEndpoint | string in chatModelCapabilities.ts, and internally normalizes object inputs via getModelId(model) plus model.family. So passing this.languageModel here is supported and does not evaluate incorrectly.
|
I have confirmed that |
|
chatmock-log-4.txt |
Fixes #313098
Summary
Enable
tool_searchfor BYOK custom OpenAI-compatible endpoints on the Responses API path.This change fixes cases where
tool_searchwas advertised in prompts but was not included in the actual Responses request for BYOK custom endpoints.What changed
tool_searchTesting
npm exec vitest run src/platform/endpoint/node/test/responsesApiToolSearch.spec.ts --pool=forksNotes
This PR is intentionally scoped to the BYOK custom endpoint request path.
It does not address the broader prompt/request condition sync for
tool_search.