You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add E2E tests and scenario for tool overrides
Add E2E tests across all 4 SDKs verifying that registering a custom tool
with the same name as a built-in tool (e.g., 'grep') causes the custom
tool to be invoked instead of the built-in. This validates the
mergeExcludedTools feature end-to-end.
- Add 'overrides built-in tool with custom tool' test to Node, Python, Go, .NET
- Add YAML snapshot for the replay proxy
- Add test/scenarios/tools/tool-overrides/ with all 4 language implementations
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Demonstrates how registering a custom tool with the same name as a built-in tool automatically overrides the built-in. The SDK's `mergeExcludedTools` logic adds custom tool names to `excludedTools`, so the CLI uses your implementation instead.
4
+
5
+
## What Each Sample Does
6
+
7
+
1. Creates a session with a custom `grep` tool that returns `"CUSTOM_GREP_RESULT: <query>"`
8
+
2. Sends: _"Use grep to search for the word 'hello'"_
9
+
3. Prints the response — which should contain `CUSTOM_GREP_RESULT` (proving the custom tool ran, not the built-in)
10
+
11
+
## Configuration
12
+
13
+
| Option | Value | Effect |
14
+
|--------|-------|--------|
15
+
|`tools`| Custom `grep` tool | Overrides the built-in `grep` with a custom implementation |
16
+
17
+
Behind the scenes, the SDK automatically adds `"grep"` to `excludedTools` so the CLI's built-in grep is disabled.
18
+
19
+
## Run
20
+
21
+
```bash
22
+
./verify.sh
23
+
```
24
+
25
+
Requires the `copilot` binary (auto-detected or set `COPILOT_CLI_PATH`) and `GITHUB_TOKEN`.
26
+
27
+
## Verification
28
+
29
+
The verify script checks that:
30
+
- The response contains `CUSTOM_GREP_RESULT` (custom tool was invoked)
31
+
- The response does **not** contain typical built-in grep output patterns
0 commit comments