diff --git a/core/providers/replicate/images.go b/core/providers/replicate/images.go index 5668f63bb5..d96bcf41d1 100644 --- a/core/providers/replicate/images.go +++ b/core/providers/replicate/images.go @@ -72,10 +72,6 @@ func ToReplicateImageGenerationInput(bifrostReq *schemas.BifrostImageGenerationR input.AspectRatio = params.AspectRatio } - if params.Resolution != nil { - input.Resolution = params.Resolution - } - // Map OutputFormat if params.OutputFormat != nil { input.OutputFormat = params.OutputFormat diff --git a/core/providers/replicate/types.go b/core/providers/replicate/types.go index d1b5cc0bd7..8d5b3ab302 100644 --- a/core/providers/replicate/types.go +++ b/core/providers/replicate/types.go @@ -62,7 +62,6 @@ type ReplicatePredictionRequestInput struct { // Image generation parameters AspectRatio *string `json:"aspect_ratio,omitempty"` OutputFormat *string `json:"output_format,omitempty"` - Resolution *string `json:"resolution,omitempty"` // e.g., "1 MP" InputImages []string `json:"input_images,omitempty"` // Image input for image-to-image models ImagePrompt *string `json:"image_prompt,omitempty"` // Image prompt for image models (flux family) ImageInput []string `json:"image_input,omitempty"` // Image input for chat models (openai family) @@ -155,7 +154,6 @@ func (r *ReplicatePredictionRequestInput) UnmarshalJSON(data []byte) error { "frequency_penalty": true, "aspect_ratio": true, "output_format": true, - "resolution": true, "input_images": true, "image_prompt": true, "input_image": true, diff --git a/core/schemas/images.go b/core/schemas/images.go index 4954df670f..26a9a52391 100644 --- a/core/schemas/images.go +++ b/core/schemas/images.go @@ -47,7 +47,6 @@ type ImageGenerationParameters struct { User *string `json:"user,omitempty"` InputImages []string `json:"input_images,omitempty"` // input images for image generation, base64 encoded or URL AspectRatio *string `json:"aspect_ratio,omitempty"` // aspect ratio of the image - Resolution *string `json:"resolution,omitempty"` // resolution of the image ExtraParams map[string]interface{} `json:"-"` } diff --git a/transports/bifrost-http/handlers/mcp.go b/transports/bifrost-http/handlers/mcp.go index a185ffc971..8233aa7e07 100644 --- a/transports/bifrost-http/handlers/mcp.go +++ b/transports/bifrost-http/handlers/mcp.go @@ -14,6 +14,7 @@ import ( "github.com/fasthttp/router" "github.com/google/uuid" bifrost "github.com/maximhq/bifrost/core" + "github.com/maximhq/bifrost/core/mcp" "github.com/maximhq/bifrost/core/schemas" configstoreTables "github.com/maximhq/bifrost/framework/configstore/tables" "github.com/maximhq/bifrost/transports/bifrost-http/lib" @@ -234,12 +235,33 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) { return } + toolSyncInterval := mcp.DefaultToolSyncInterval + if req.ToolSyncInterval != 0 { + toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute + } else { + config, err := h.store.ConfigStore.GetClientConfig(ctx) + if err != nil { + SendError(ctx, fasthttp.StatusInternalServerError, fmt.Sprintf("failed to get client config: %v", err)) + return + } + if config != nil { + toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute + } + } + + isPingAvailable := true + if req.IsPingAvailable != nil { + isPingAvailable = *req.IsPingAvailable + } + // Store MCP client config in OAuth provider memory (not in database) // It will be stored in database only after OAuth completion pendingConfig := schemas.MCPClientConfig{ ID: req.ClientID, Name: req.Name, IsCodeModeClient: req.IsCodeModeClient, + IsPingAvailable: isPingAvailable, + ToolSyncInterval: toolSyncInterval, ConnectionType: schemas.MCPConnectionType(req.ConnectionType), ConnectionString: req.ConnectionString, StdioConfig: req.StdioConfig, @@ -269,7 +291,7 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) { return } - toolSyncInterval := 10 * time.Minute + toolSyncInterval := mcp.DefaultToolSyncInterval if req.ToolSyncInterval != 0 { toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute } else { @@ -281,8 +303,8 @@ func (h *MCPHandler) addMCPClient(ctx *fasthttp.RequestCtx) { if config != nil { toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute } - } + // Convert to schemas.MCPClientConfig for runtime bifrost client (without tool_pricing) // Dereference IsPingAvailable pointer, defaulting to true if nil (new clients default to ping available) isPingAvailable := true @@ -404,7 +426,7 @@ func (h *MCPHandler) updateMCPClient(ctx *fasthttp.RequestCtx) { return } } - toolSyncInterval := 10 * time.Minute + toolSyncInterval := mcp.DefaultToolSyncInterval if req.ToolSyncInterval != 0 { toolSyncInterval = time.Duration(req.ToolSyncInterval) * time.Minute } else { @@ -416,7 +438,6 @@ func (h *MCPHandler) updateMCPClient(ctx *fasthttp.RequestCtx) { if config != nil { toolSyncInterval = time.Duration(config.MCPToolSyncInterval) * time.Minute } - } // Convert to schemas.MCPClientConfig for runtime bifrost client (without tool_pricing) isPingAvailable := true