From 3a18f6fccab07468bb4f3d1b542e46d065b90ba5 Mon Sep 17 00:00:00 2001 From: chujian <765781379@qq.com> Date: Sat, 7 Mar 2026 18:53:56 +0800 Subject: [PATCH] fix(registry): clone slice fields in model map output --- internal/registry/model_registry.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/registry/model_registry.go b/internal/registry/model_registry.go index 2eb5500d..8f56c43d 100644 --- a/internal/registry/model_registry.go +++ b/internal/registry/model_registry.go @@ -1138,7 +1138,7 @@ func (r *ModelRegistry) convertModelToMap(model *ModelInfo, handlerType string) result["max_completion_tokens"] = model.MaxCompletionTokens } if len(model.SupportedParameters) > 0 { - result["supported_parameters"] = model.SupportedParameters + result["supported_parameters"] = append([]string(nil), model.SupportedParameters...) } return result @@ -1182,13 +1182,13 @@ func (r *ModelRegistry) convertModelToMap(model *ModelInfo, handlerType string) result["outputTokenLimit"] = model.OutputTokenLimit } if len(model.SupportedGenerationMethods) > 0 { - result["supportedGenerationMethods"] = model.SupportedGenerationMethods + result["supportedGenerationMethods"] = append([]string(nil), model.SupportedGenerationMethods...) } if len(model.SupportedInputModalities) > 0 { - result["supportedInputModalities"] = model.SupportedInputModalities + result["supportedInputModalities"] = append([]string(nil), model.SupportedInputModalities...) } if len(model.SupportedOutputModalities) > 0 { - result["supportedOutputModalities"] = model.SupportedOutputModalities + result["supportedOutputModalities"] = append([]string(nil), model.SupportedOutputModalities...) } return result