fix(task): 修复任务状态更新和超时处理问题

This commit is contained in:
2026-06-11 11:27:15 +08:00
parent df26329836
commit c22d578e1a

View File

@@ -47,8 +47,11 @@ func buildStructTypeRequest(ctx context.Context, req *dto.ComposeMessagesReq, ch
// compileToProviderRequest 编译为 Provider 请求
func compileToProviderRequest(ctx context.Context, ir *IR, chatModel *gateway.AsynchModel, req *dto.ComposeMessagesReq, customPrompt ...string) (map[string]any, error) {
protocol, err := GetProtocolByProvider(ctx, chatModel.OperatorName)
if err != nil || protocol == nil {
return nil, fmt.Errorf("协议配置不存在或获取失败: %w", err)
if err != nil {
return nil, err
}
if protocol == nil {
return nil, fmt.Errorf("协议配置不存在或获取失败")
}
// 如果传了自定义提示词,替换掉协议模板
if len(customPrompt) > 0 && customPrompt[0] != "" {