Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves Copilot-related reliability and configurability by introducing service-specific MCP response-header timeouts (with a longer default for Copilot) and by treating Copilot tool “Error executing tool:” payloads as actual errors (with a single retry for timeout-shaped failures).
Changes:
- Add configurable MCP HTTP response-header timeouts, including a longer default for Copilot and env var overrides.
- Detect Copilot service-returned
Error executing tool:payloads, deduplicate repeated correlation metadata, and retry timeout-shaped failures once. - Add targeted unit tests and documentation for timeout tuning.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new timeout-related environment variables. |
| internal/mcp/client.go | Uses configurable response-header timeout and logs it in verbose mode; derives service from endpoint. |
| internal/mcp/client_test.go | Adds coverage for endpoint->service detection and response-header timeout behavior. |
| internal/config/config.go | Introduces default timeouts and env-based override logic. |
| internal/config/config_test.go | Adds tests for timeout defaults and override precedence/validation. |
| internal/commands/copilot/copilot.go | Adds Copilot service-error detection, sanitization/deduplication, and a single retry for timeout-like failures. |
| internal/commands/copilot/copilot_test.go | Adds tests for retry/error surfacing behavior; adds a Copilot SSE tool server helper. |
| docs/copilot.md | Adds guidance for tuning Copilot timeouts via env vars. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 2
| })+"\n\n") | ||
| case "tools/call": | ||
| idx := *toolCalls | ||
| *toolCalls++ |
Comment on lines
+748
to
+752
| generic := NewClient(server.URL+"/"+config.Servers["teams"]+"/", tokenProvider) | ||
| _, err := generic.doRequest(context.Background(), JSONRPCRequest{JSONRPC: "2.0", ID: 1, Method: "tools/list"}) | ||
| if err == nil { | ||
| t.Fatal("expected generic MCP request to hit response-header timeout") | ||
| } |
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
Error executing tool:payloads as real errors instead of successful chat responsesTesting