Skip to content

Commit f00c04a

Browse files
committed
fix: resolve lint and E2E test failures in tool quarantine PR
- Convert if/else chain to switch statement in handleInspectToolApprovals to fix staticcheck QF1003 lint error - Disable tool-level quarantine in E2E test environment since existing tests don't test this feature (quarantine-specific tests have their own setup). Without this, new tools from mock servers were blocked as "pending" approval, causing 4 E2E test failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e0e687e commit f00c04a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

internal/server/e2e_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func NewTestEnvironment(t *testing.T) *TestEnvironment {
7777
ln.Close()
7878

7979
// Create proxy server with test config
80+
quarantineDisabled := false
8081
cfg := &config.Config{
8182
DataDir: dataDir,
8283
Listen: fmt.Sprintf(":%d", testPort),
@@ -88,6 +89,7 @@ func NewTestEnvironment(t *testing.T) *TestEnvironment {
8889
AllowServerRemove: true,
8990
EnablePrompts: true,
9091
DebugSearch: true,
92+
QuarantineEnabled: &quarantineDisabled, // Disable tool-level quarantine in E2E tests (tested separately)
9193
}
9294

9395
env.proxyServer, err = NewServer(cfg, logger)
@@ -1873,7 +1875,7 @@ func TestE2E_Activity_ExcludeCallToolSuccess(t *testing.T) {
18731875
callRequest := mcp.CallToolRequest{}
18741876
callRequest.Params.Name = "call_tool_read"
18751877
callRequest.Params.Arguments = map[string]interface{}{
1876-
"name": "test-server-fixture:echo_tool",
1878+
"name": "test-server-fixture:echo_tool",
18771879
"args_json": `{"message": "test-activity-filtering"}`,
18781880
"intent": map[string]interface{}{
18791881
"operation_type": "read",

internal/server/mcp.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,12 +2246,13 @@ func (p *MCPProxyServer) handleInspectToolApprovals(request mcp.CallToolRequest)
22462246
"hash": r.CurrentHash,
22472247
"description": r.CurrentDescription,
22482248
}
2249-
if r.Status == "changed" {
2249+
switch r.Status {
2250+
case "changed":
22502251
tool["previous_description"] = r.PreviousDescription
22512252
changedCount++
2252-
} else if r.Status == "pending" {
2253+
case "pending":
22532254
pendingCount++
2254-
} else {
2255+
default:
22552256
approvedCount++
22562257
}
22572258
toolList[i] = tool

0 commit comments

Comments
 (0)