diff --git a/pkg/cli/audit_expanded.go b/pkg/cli/audit_expanded.go index 1f08924cb8b..110535cd918 100644 --- a/pkg/cli/audit_expanded.go +++ b/pkg/cli/audit_expanded.go @@ -136,7 +136,7 @@ func extractEngineConfig(logsPath string) *EngineConfig { } // Extract MCP server names from aw_info.json steps metadata - if mcpNames, ok := awInfoHasMCPServers(logsPath); ok { + if mcpNames, ok := extractMCPServerNamesFromAwInfo(logsPath); ok { config.MCPServers = mcpNames } @@ -458,10 +458,11 @@ func buildSlowestToolCalls(calls []MCPToolCall, topN int) []MCPSlowestToolCall { return result } -// awInfoHasMCPServers checks if aw_info.json has MCP server configuration in steps. +// extractMCPServerNamesFromAwInfo extracts MCP server names from aw_info.json steps metadata +// and returns them along with a boolean indicating whether any servers were found. // We need to inspect the raw JSON since AwInfoSteps.MCPServers may not be // deserialized as a map for all formats. -func awInfoHasMCPServers(logsPath string) ([]string, bool) { +func extractMCPServerNamesFromAwInfo(logsPath string) ([]string, bool) { awInfoPath := findAwInfoPath(logsPath) if awInfoPath == "" { return nil, false diff --git a/pkg/cli/audit_expanded_test.go b/pkg/cli/audit_expanded_test.go index 874118368fa..e420ef9cb63 100644 --- a/pkg/cli/audit_expanded_test.go +++ b/pkg/cli/audit_expanded_test.go @@ -668,7 +668,7 @@ func TestAwInfoHasMCPServers(t *testing.T) { err := os.WriteFile(filepath.Join(targetDir, "aw_info.json"), []byte(tt.awInfoContent), 0644) require.NoError(t, err, "Should write aw_info.json") - names, hasMCP := awInfoHasMCPServers(tmpDir) + names, hasMCP := extractMCPServerNamesFromAwInfo(tmpDir) assert.Equal(t, tt.expectedHasMCP, hasMCP, "Has MCP servers should match") if tt.expectedHasMCP { assert.Equal(t, tt.expectedNames, names, "MCP server names should match")