fix: 修复并行分支续跑输出丢失及模型空指针

合并续跑时各分支独立的 ConfigMap 副本,避免汇合节点输出丢失;并对模型配置缺失和空 responseType 增加保护,防止空指针崩溃。
This commit is contained in:
2026-08-24 16:04:45 +08:00
parent 75fb40274d
commit f0f8724bd9
3 changed files with 44 additions and 6 deletions
@@ -69,6 +69,11 @@ func ModelCallResultLambda(ctx context.Context, modelId int64, sessionId string,
if err != nil {
return nil, nil, false, fmt.Errorf("获取模型配置失败: %w", err)
}
// model-gateway 对不存在的模型返回 modelManage=nullHTTP 仍 200),零值 struct 里 ResponseType 是 nil 指针,
// 直接传入 ModelCallResult 会在 *responseType 处 panic,这里提前报业务错误
if g.IsEmpty(modelInfo.ModelManage.Id) {
return nil, nil, false, fmt.Errorf("模型配置不存在: modelId=%d", modelId)
}
businessParams := make(map[string]any)
if !g.IsEmpty(prompt) {
if modelInfo.ModelManage.ModelType != nil && *modelInfo.ModelManage.ModelType == model.TypeVideo {