before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
try {
client.delete(collectionName, {
points: ids
})
} catch (e) {
console.error('Failed to delete')
}
... | if no `batchSize` is found, can we just do it without for loop?
I tried upserting 1k+ chunks, it works fine:

Instead of doing this 10 times in for loop, I think its better for other to specify the batch size once ... | points
})
}
} catch (e: any) {
const error = new Error(`${e?.status ?? 'Undefined error code'} ${e?.message}: ${e?.data?.status?.error}`)
throw ... | @@ -257,7 +265,10 @@ class Qdrant_VectorStores implements INode {
return res
} else {
- await QdrantVectorStore.fromDocuments(finalDocs, embeddings, dbConfig)
+ for(let i=0; i<finalDocs.length; i+=batchSize) { | packages/components/nodes/vectorstores/Qdrant/Qdrant.ts | 26 | TypeScript | 0.786 | performance | 402 | 51 | 51 | false | Add batchSize parameter to Qdrant_VectorStores and QdrantUpsert_Vecto… | 2,215 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mrabbah | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Qdrant/Qdrant.ts
PR Title: Add batchSize parameter to Qdrant_VectorStores and QdrantUpsert_Vecto…
BEFORE CODE: try {
client.delete(collectionName, {
... | if no `batchSize` is found, can we just do it without for loop?
I tried upserting 1k+ chunks, it works fine:

Instead of doing this 10 times in for loop, I think its better for other to specify the batch size once ... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
optional: true
},
{
label: 'Qdrant Server URL',
name: 'qdrantServerUrl',
type: 'string',
placeholder: 'http://localhost:6333'
},
{
label: 'Qdrant Collection Name',
... | can we have an `optional: true` | optional: true
},
{
label: 'Qdrant Server URL',
name: 'qdrantServerUrl',
type: 'string',
placeholder: 'http://localhost:6333'
},
{
label: 'Qdrant Collection Name',
... | @@ -86,6 +86,13 @@ class Qdrant_VectorStores implements INode {
default: 1536,
additionalParams: true
},
+ {
+ label: 'Batch Size',
+ name: 'batchSize',
+ type: 'number',
+ default: 100,
+ ... | packages/components/nodes/vectorstores/Qdrant/Qdrant.ts | 26 | TypeScript | 0.214 | suggestion | 31 | 51 | 51 | false | Add batchSize parameter to Qdrant_VectorStores and QdrantUpsert_Vecto… | 2,215 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mrabbah | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Qdrant/Qdrant.ts
PR Title: Add batchSize parameter to Qdrant_VectorStores and QdrantUpsert_Vecto…
BEFORE CODE: optional: true
},
{
label: 'Qdrant Server URL',
... | can we have an `optional: true` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// constant
export const gridSpacing = 3
export const drawerWidth = 260
export const appDrawerWidth = 320
export const headerHeight = 80
export const maxScroll = 100000
export const baseURL =
import.meta.env.PROD === true
? window.location.origin
: window.location.origin.replace(`:${import.meta.env.... | @mokeyish just noticed there are 2 urls:
`baseURL` and `uiBaseURL` with same value `window.location.origin`, do we need both?
Also when running `pnpm dev` on `localhost:8080`, the `baseURL` becomes `localhost:8080`. This makes the `ChatMessage.jsx` not able to receive streaming because the server is `localhost:3000... | // constant
export const gridSpacing = 3
export const drawerWidth = 260
export const appDrawerWidth = 320
export const headerHeight = 80
export const maxScroll = 100000
export const baseURL = window.location.origin
export const uiBaseURL = window.location.origin
export const FLOWISE_CREDENTIAL_ID = 'FLOWISE_CREDENTIAL_... | @@ -4,10 +4,7 @@ export const drawerWidth = 260
export const appDrawerWidth = 320
export const headerHeight = 80
export const maxScroll = 100000
-export const baseURL =
- import.meta.env.PROD === true
- ? window.location.origin
- : window.location.origin.replace(`:${import.meta.env.VITE_PORT ?? '808... | packages/ui/src/store/constant.js | 8 | JavaScript | 0.643 | suggestion | 425 | 14 | 11 | false | feat(ui): auto proxy backend | 2,238 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mokeyish | Review this pull request change.
Language: JavaScript
File: packages/ui/src/store/constant.js
PR Title: feat(ui): auto proxy backend
BEFORE CODE: // constant
export const gridSpacing = 3
export const drawerWidth = 260
export const appDrawerWidth = 320
export const headerHeight = 80
export const maxScroll = 100000
e... | @mokeyish just noticed there are 2 urls:
`baseURL` and `uiBaseURL` with same value `window.location.origin`, do we need both?
Also when running `pnpm dev` on `localhost:8080`, the `baseURL` becomes `localhost:8080`. This makes the `ChatMessage.jsx` not able to receive streaming because the server is `localhost:3000... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions, OpenAIClient } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
export const SpeechToTextType = {
OPENAI_WHISPER: 'op... | the name we usually make it camelcase, `localAISTT` | import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions, OpenAIClient } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
const SpeechToTextType = {
OPENAI_WHISPER: 'openAIWhi... | @@ -4,40 +4,69 @@ import { type ClientOptions, OpenAIClient } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
+export const SpeechToTextType = {
+ OPENAI_WHISPER: 'openAIWhisper',
+ ASSEMBLYAI_TRANSCRIBE: 'assemblyAiTranscribe',
+ LOCALAI... | packages/components/src/speechToText.ts | 10 | TypeScript | 0.357 | style | 51 | 35 | 35 | false | [FEATURE] Added support for LocalAI Speech To Text configuration | 2,376 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | clates | Review this pull request change.
Language: TypeScript
File: packages/components/src/speechToText.ts
PR Title: [FEATURE] Added support for LocalAI Speech To Text configuration
BEFORE CODE: import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions... | the name we usually make it camelcase, `localAISTT` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import PropTypes from 'prop-types'
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackbarAction, SET_CHATFLOW } from '@/store/actions'
// material-ui
import { Typography, Box, Button, FormControl, ListItem, ListItemAvatar, ListItemText, MenuItem, Select } from '@mui/material'
import { IconX ... | in ui we dont have `flowise-components` dep installed, so we can't import it. for now, yeah we probably have to duplicate it | import PropTypes from 'prop-types'
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackbarAction, SET_CHATFLOW } from '@/store/actions'
// material-ui
import { Typography, Box, Button, FormControl, ListItem, ListItemAvatar, ListItemText, MenuItem, Select } from '@mui/material'
import { IconX ... | @@ -16,17 +16,27 @@ import { StyledButton } from '@/ui-component/button/StyledButton'
import { Dropdown } from '@/ui-component/dropdown/Dropdown'
import openAISVG from '@/assets/images/openai.svg'
import assemblyAIPng from '@/assets/images/assemblyai.png'
+import localAISVG from '@/assets/images/robot.png'
// sto... | packages/ui/src/ui-component/extended/SpeechToText.jsx | 26 | JavaScript | 0.5 | refactor | 124 | 51 | 51 | false | [FEATURE] Added support for LocalAI Speech To Text configuration | 2,376 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | clates | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/extended/SpeechToText.jsx
PR Title: [FEATURE] Added support for LocalAI Speech To Text configuration
BEFORE CODE: import PropTypes from 'prop-types'
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnack... | in ui we dont have `flowise-components` dep installed, so we can't import it. for now, yeah we probably have to duplicate it | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { useDispatch } from 'react-redux'
import { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackbarAction, SET_CHATFLOW } from '@/store/actions'
// material-ui
import { Typography, Box, Button, FormControl, ListItem,... | there is a LocalAI png we can copy from `packages/components/nodes/chatmodels/LocalAI` | import { useDispatch } from 'react-redux'
import { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackbarAction, SET_CHATFLOW } from '@/store/actions'
// material-ui
import { Typography, Box, Button, FormControl, ListItem,... | @@ -16,17 +16,27 @@ import { StyledButton } from '@/ui-component/button/StyledButton'
import { Dropdown } from '@/ui-component/dropdown/Dropdown'
import openAISVG from '@/assets/images/openai.svg'
import assemblyAIPng from '@/assets/images/assemblyai.png'
+import localAISVG from '@/assets/images/robot.png' | packages/ui/src/ui-component/extended/SpeechToText.jsx | 19 | JavaScript | 0.357 | suggestion | 86 | 44 | 44 | false | [FEATURE] Added support for LocalAI Speech To Text configuration | 2,376 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | clates | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/extended/SpeechToText.jsx
PR Title: [FEATURE] Added support for LocalAI Speech To Text configuration
BEFORE CODE: import { useDispatch } from 'react-redux'
import { useState, useEffect } from 'react'
import PropTypes from 'prop... | there is a LocalAI png we can copy from `packages/components/nodes/chatmodels/LocalAI` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
label: 'Connect Credential',
name: 'credential',
type: 'credential',
credentialNames: ['localAIApi']
},
{
label: 'Base URL',
name: 'baseUrl',
type: 'string',
descriptio... | we can have the `default : whisper-1` as well if thats the default model that is going to be used by LocalAI if nothing if specified. Also to be clearer, we can add description saying if not specified, which model will be used by default. We should get rid of `rows: 4` | label: 'Connect Credential',
name: 'credential',
type: 'credential',
credentialNames: ['localAIApi']
},
{
label: 'Base URL',
name: 'baseUrl',
type: 'string',
descriptio... | @@ -76,6 +86,60 @@ const speechToTextProviders = {
credentialNames: ['assemblyAIApi']
}
]
+ },
+ [SpeechToTextType.LOCALAI_STT]: {
+ label: 'LocalAi STT',
+ name: SpeechToTextType.LOCALAI_STT,
+ icon: localAISVG,
+ url: 'https://localai.io/feature... | packages/ui/src/ui-component/extended/SpeechToText.jsx | 26 | JavaScript | 0.643 | suggestion | 269 | 51 | 51 | false | [FEATURE] Added support for LocalAI Speech To Text configuration | 2,376 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | clates | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/extended/SpeechToText.jsx
PR Title: [FEATURE] Added support for LocalAI Speech To Text configuration
BEFORE CODE: label: 'Connect Credential',
name: 'credential',
type: 'credentia... | we can have the `default : whisper-1` as well if thats the default model that is going to be used by LocalAI if nothing if specified. Also to be clearer, we can add description saying if not specified, which model will be used by default. We should get rid of `rows: 4` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { flatten } from 'lodash'
import { Client } from '@opensearch-project/opensearch'
import { Document } from '@langchain/core/documents'
import { OpenSearchVectorStore } from '@langchain/community/vectorstores/opensearch'
import { Embeddings } from '@langchain/core/embeddings'
import { ICommonObject, INode, INodeD... | curious: why the need to move the URL into credential? | import { flatten } from 'lodash'
import { Client } from '@opensearch-project/opensearch'
import { Document } from '@langchain/core/documents'
import { OpenSearchVectorStore } from '@langchain/community/vectorstores/opensearch'
import { Embeddings } from '@langchain/core/embeddings'
import { ICommonObject, INode, INodeD... | @@ -3,8 +3,9 @@ import { Client } from '@opensearch-project/opensearch'
import { Document } from '@langchain/core/documents' | packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts | 3 | TypeScript | 0.286 | security | 54 | 28 | 28 | false | Added Opensearch credential | 2,458 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | patrickreinan | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts
PR Title: Added Opensearch credential
BEFORE CODE: import { flatten } from 'lodash'
import { Client } from '@opensearch-project/opensearch'
import { Document } from '@langchain/core/documents'... | curious: why the need to move the URL into credential? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return initializeDynamoDB(nodeData, options)
}
}
const initializeDynamoDB = async (nodeData: INodeData, options: ICommonObject): Promise<BufferMemory> => {
const tableName = nodeData.inputs?.tableName as string
const partitionKey = nodeData.inputs?.partitionKey as string
const region = nodeData... | Curious if the credentials is undefined, what do we use? IAM role specified from your local env variables? | return initializeDynamoDB(nodeData, options)
}
}
const initializeDynamoDB = async (nodeData: INodeData, options: ICommonObject): Promise<BufferMemory> => {
const tableName = nodeData.inputs?.tableName as string
const partitionKey = nodeData.inputs?.partitionKey as string
const region = nodeData... | @@ -102,13 +103,18 @@ const initializeDynamoDB = async (nodeData: INodeData, options: ICommonObject):
const accessKeyId = getCredentialParam('accessKey', credentialData, nodeData)
const secretAccessKey = getCredentialParam('secretAccessKey', credentialData, nodeData)
- const config: DynamoDBClientConfig ... | packages/components/nodes/memory/DynamoDb/DynamoDb.ts | 26 | TypeScript | 0.571 | security | 107 | 51 | 51 | false | Feature: Support role-based authentication for AWS | 2,470 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | danieldabate | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/memory/DynamoDb/DynamoDb.ts
PR Title: Feature: Support role-based authentication for AWS
BEFORE CODE: return initializeDynamoDB(nodeData, options)
}
}
const initializeDynamoDB = async (nodeData: INodeData, options: IC... | Curious if the credentials is undefined, what do we use? IAM role specified from your local env variables? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return JSON.stringify(obj, null, spaces)
} catch (err) {
return fallback
}
}
function elapsed(run: Run): string {
if (!run.end_time) return ''
const elapsed = run.end_time - run.start_time
if (elapsed < 1000) {
return `${elapsed}ms`
}
return `${(elapsed / 1000).toFix... | we might not need to specify this, as its already specified [here](https://github.com/FlowiseAI/Flowise/blob/bugfix/Remove-Doc-Store-File/packages/server/src/utils/config.ts#L12) | } catch (err) {
return fallback
}
}
function elapsed(run: Run): string {
if (!run.end_time) return ''
const elapsed = run.end_time - run.start_time
if (elapsed < 1000) {
return `${elapsed}ms`
}
return `${(elapsed / 1000).toFixed(2)}s`
}
export class ConsoleCallbackHandler e... | @@ -49,6 +58,7 @@ export class ConsoleCallbackHandler extends BaseTracer {
constructor(logger: Logger) {
super()
this.logger = logger
+ logger.level = getEnvironmentVariable('LOG_LEVEL') ?? 'info' | packages/components/src/handler.ts | 26 | TypeScript | 0.571 | bug | 178 | 51 | 51 | false | Added LOG_JSON_SPACES to control json beautify | 2,483 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | patrickreinan | Review this pull request change.
Language: TypeScript
File: packages/components/src/handler.ts
PR Title: Added LOG_JSON_SPACES to control json beautify
BEFORE CODE: return JSON.stringify(obj, null, spaces)
} catch (err) {
return fallback
}
}
function elapsed(run: Run): string {
if (!run... | we might not need to specify this, as its already specified [here](https://github.com/FlowiseAI/Flowise/blob/bugfix/Remove-Doc-Store-File/packages/server/src/utils/config.ts#L12) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { INodeParams, INodeCredential } from '../src/Interface'
class OpenSearchUrl implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'OpenSearch'
this.name = 'openSearchUrl'
th... | it is better to have `user` and `password` on `this.credential`, example [here](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts#L35) |
class OpenSearchUrl implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'OpenSearch'
this.name = 'openSearchUrl'
this.version = 2.0
this.inputs = [
{
... | @@ -10,12 +10,26 @@ class OpenSearchUrl implements INodeCredential {
constructor() {
this.label = 'OpenSearch'
this.name = 'openSearchUrl'
- this.version = 1.0
+ this.version = 2.0
this.inputs = [
{
label: 'OpenSearch Url',
nam... | packages/components/credentials/OpenSearchUrl.credential.ts | 25 | TypeScript | 0.571 | security | 191 | 25 | 38 | false | Improve OpenSearchURL credential storing user and password in separate fields from the URL | 2,549 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | danieldabate | Review this pull request change.
Language: TypeScript
File: packages/components/credentials/OpenSearchUrl.credential.ts
PR Title: Improve OpenSearchURL credential storing user and password in separate fields from the URL
BEFORE CODE: import { INodeParams, INodeCredential } from '../src/Interface'
class OpenSearchU... | it is better to have `user` and `password` on `this.credential`, example [here](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts#L35) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
isSameOverrideConfig,
getEndingNodes,
constructGraphs
} from '../utils'
import { utilValidateKey } from './validateKey'
import { databaseEntities } from '.'
import { v4 as uuidv4 } from 'uuid'
import { omit } from 'lodash'
import * as fs from 'fs'
import logger from './logger'
import { utilAddChatMessage } ... | this doesn't fix it no? `req.get('x-forwarded-proto')` will always be `http` behind proxy, and we want `htttps` | isSameOverrideConfig,
getEndingNodes,
constructGraphs
} from '../utils'
import { utilValidateKey } from './validateKey'
import { databaseEntities } from '.'
import { v4 as uuidv4 } from 'uuid'
import { omit } from 'lodash'
import * as fs from 'fs'
import logger from './logger'
import { utilAddChatMessage } ... | @@ -54,7 +54,9 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter
try {
const appServer = getRunningExpressApp()
const chatflowid = req.params.id
- const baseURL = `${req.protocol}://${req.get('host')}`
+
+ const httpProtocol = req.get('x-forwarded-p... | packages/server/src/utils/buildChatflow.ts | 26 | TypeScript | 0.5 | suggestion | 111 | 51 | 51 | false | Bugfix - Add x-forwarded-proto as source for http protocol for base url and add base url field to ChatflowTool | 2,592 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | danieldabate | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/buildChatflow.ts
PR Title: Bugfix - Add x-forwarded-proto as source for http protocol for base url and add base url field to ChatflowTool
BEFORE CODE: isSameOverrideConfig,
getEndingNodes,
constructGraphs
} from '../ut... | this doesn't fix it no? `req.get('x-forwarded-proto')` will always be `http` behind proxy, and we want `htttps` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
baseClasses: string[]
credential: INodeParams
inputs: INodeParams[]
constructor() {
this.label = 'ChatFireworks'
this.name = 'chatFireworks'
this.version = 1.0
this.type = 'ChatFireworks'
this.icon = 'Fireworks.png'
this.category = 'Chat Models'
t... | We need to have the model field parameter, example - https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts#L41
Since there are so many models, we can just make it as a `type: 'string` field, and get rid of the `listModels` method | credential: INodeParams
inputs: INodeParams[]
constructor() {
this.label = 'ChatFireworks'
this.name = 'chatFireworks'
this.version = 1.0
this.type = 'ChatFireworks'
this.icon = 'Fireworks.png'
this.category = 'Chat Models'
this.description = 'Wrapper... | @@ -0,0 +1,77 @@
+import { BaseCache } from '@langchain/core/caches'
+import { ChatFireworks } from '@langchain/community/chat_models/fireworks'
+import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } fro... | packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts | 26 | TypeScript | 0.714 | suggestion | 297 | 51 | 51 | false | Fireworks ai chat model | 2,596 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mingxin0607 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts
PR Title: Fireworks ai chat model
BEFORE CODE: baseClasses: string[]
credential: INodeParams
inputs: INodeParams[]
constructor() {
this.label = 'ChatFireworks'
... | We need to have the model field parameter, example - https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts#L41
Since there are so many models, we can just make it as a `type: 'string` field, and get rid of the `listModels` method | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
this.inputs = [
{
label: 'Cache',
name: 'cache',
type: 'BaseCache',
optional: true
},
{
label: 'Model',
name: 'model',
type: 'string'
},
{
... | we can remove the whole `loadMethods` | {
label: 'Cache',
name: 'cache',
type: 'BaseCache',
optional: true
},
{
label: 'Model',
name: 'modelName',
type: 'string',
default: 'accounts/fireworks/mode... | @@ -0,0 +1,82 @@
+import { BaseCache } from '@langchain/core/caches'
+import { ChatFireworks } from '@langchain/community/chat_models/fireworks'
+import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } fro... | packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts | 26 | TypeScript | 0.286 | suggestion | 37 | 50 | 47 | false | Fireworks ai chat model | 2,596 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mingxin0607 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts
PR Title: Fireworks ai chat model
BEFORE CODE: this.inputs = [
{
label: 'Cache',
name: 'cache',
type: 'BaseCache',
... | we can remove the whole `loadMethods` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
{
label: 'Cache',
name: 'cache',
type: 'BaseCache',
optional: true
},
{
label: 'Model',
name: 'model',
type: 'string'
},
{
label: 'T... | we need to get the model from the input as well | label: 'Cache',
name: 'cache',
type: 'BaseCache',
optional: true
},
{
label: 'Model',
name: 'modelName',
type: 'string',
default: 'accounts/fireworks/models/llama-v2-13... | @@ -0,0 +1,82 @@
+import { BaseCache } from '@langchain/core/caches'
+import { ChatFireworks } from '@langchain/community/chat_models/fireworks'
+import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } fro... | packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts | 26 | TypeScript | 0.071 | suggestion | 47 | 49 | 46 | false | Fireworks ai chat model | 2,596 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mingxin0607 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatFireworks/ChatFireworks.ts
PR Title: Fireworks ai chat model
BEFORE CODE: {
label: 'Cache',
name: 'cache',
type: 'BaseCache',
optional: tru... | we need to get the model from the input as well | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
import { BaseCache } from '@langchain/core/caches'
class Fireworks_LLMs implements INode {
label: string
name: string
version: number
type: string
icon: string
category: string
description: string
baseClasses: string[]
... | We need to have the model field parameter, example - https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts#L41
Since there are so many models, we can just make it as a type: 'string field, and get rid of the listModels method | description: string
baseClasses: string[]
credential: INodeParams
inputs: INodeParams[]
constructor() {
this.label = 'Fireworks'
this.name = 'fireworks'
this.version = 1.0
this.type = 'Fireworks'
this.icon = 'fireworks.png'
this.category = 'LLMs'
... | @@ -0,0 +1,74 @@
+import {
+ getBaseClasses,
+ getCredentialData,
+ getCredentialParam,
+ ICommonObject,
+ INode,
+ INodeData,
+ INodeOptionsValue,
+ INodeParams
+} from '../../../src'
+import { Fireworks } from '@langchain/community/llms/fireworks'
+import { getModels, MODEL_TYPE } from '../../... | packages/components/nodes/llms/Fireworks/Fireworks.ts | 26 | TypeScript | 0.571 | suggestion | 293 | 51 | 51 | false | add Fireworks LLM | 2,597 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | jiabaow | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/llms/Fireworks/Fireworks.ts
PR Title: add Fireworks LLM
BEFORE CODE: import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
import { BaseCache } from '@langchain/core/caches'
class Fireworks_LLMs implements INode {
... | We need to have the model field parameter, example - https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts#L41
Since there are so many models, we can just make it as a type: 'string field, and get rid of the listModels method | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
undefined,
undefined,
config.runName
)
let result
try {
result = await this._call(parsed, runManager, flowConfig)
} catch (e) {
await runManager?.handleToolError(e)
throw e
}
await runManager?.handleT... | might need to replace `chatId` with a new uuid as well | undefined,
undefined,
config.runName
)
let result
try {
result = await this._call(parsed, runManager, flowConfig)
} catch (e) {
await runManager?.handleToolError(e)
throw e
}
await runManager?.handleT... | @@ -242,7 +260,7 @@ class ChatflowTool extends StructuredTool {
question: inputQuestion,
chatId: flowConfig?.chatId, | packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts | 26 | TypeScript | 0.429 | suggestion | 54 | 51 | 51 | false | Feature - Add option to start a new session with each interaction with the Chatflow tool | 2,633 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | danieldabate | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts
PR Title: Feature - Add option to start a new session with each interaction with the Chatflow tool
BEFORE CODE: undefined,
undefined,
config.runName
)
... | might need to replace `chatId` with a new uuid as well | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
}}
>
<ListItemButton
sx={{ borderRadius: `${customization.borderRadius}px`... | By hardcoding `Export Chatflows`, even if user is on Tools page, they will sstill see this. Should we have a conditon check and only display this import export when user is on `/chatflow` or the main `/` page? | <List
component='nav'
sx={{
width: '100%',
maxWidth: 250,
... | @@ -135,6 +242,29 @@ const ProfileSection = ({ username, handleLogout }) => {
}
}}
>
+ <ListItemButton
+ ... | packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx | 26 | JavaScript | 0.643 | question | 210 | 51 | 51 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: JavaScript
File: packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx
PR Title: Feature/extract import all
BEFORE CODE: }
}}
... | By hardcoding `Export Chatflows`, even if user is on Tools page, they will sstill see this. Should we have a conditon check and only display this import export when user is on `/chatflow` or the main `/` page? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const chatflow = appServer.AppDataSource.getRepository(ChatFlow).create(newChatFlow)
const step1Results = await appServer.AppDataSource.getRepository(ChatFlow).save(chatflow)
// step 2 - convert base64 to file paths and update the chatflow
step1Results.flowData = await u... | should we rename to `importChatflows`? `saveChatflows` sounds like updating existing chatflows | const chatflow = appServer.AppDataSource.getRepository(ChatFlow).create(newChatFlow)
const step1Results = await appServer.AppDataSource.getRepository(ChatFlow).save(chatflow)
// step 2 - convert base64 to file paths and update the chatflow
step1Results.flowData = await u... | @@ -198,6 +197,60 @@ const saveChatflow = async (newChatFlow: ChatFlow): Promise<any> => {
}
}
+const saveChatflows = async (newChatflows: Partial<ChatFlow>[]): Promise<any> => { | packages/server/src/services/chatflows/index.ts | 26 | TypeScript | 0.429 | question | 94 | 51 | 51 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/services/chatflows/index.ts
PR Title: Feature/extract import all
BEFORE CODE: const chatflow = appServer.AppDataSource.getRepository(ChatFlow).create(newChatFlow)
const step1Results = await appServer.AppDataSourc... | should we rename to `importChatflows`? `saveChatflows` sounds like updating existing chatflows | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import client from './client'
const getAllChatflows = () => client.get('/chatflows')
const getAllAgentflows = () => client.get('/chatflows?type=MULTIAGENT')
const getSpecificChatflow = (id) => client.get(`/chatflows/${id}`)
const getSpecificChatflowFromPublicEndpoint = (id) => client.get(`/public-chatflows/${id}`)
... | will `importChatflows` a better name? | import client from './client'
const getAllChatflows = () => client.get('/chatflows')
const getAllAgentflows = () => client.get('/chatflows?type=MULTIAGENT')
const getSpecificChatflow = (id) => client.get(`/chatflows/${id}`)
const getSpecificChatflowFromPublicEndpoint = (id) => client.get(`/public-chatflows/${id}`)
... | @@ -10,6 +10,8 @@ const getSpecificChatflowFromPublicEndpoint = (id) => client.get(`/public-chatfl
const createNewChatflow = (body) => client.post(`/chatflows`, body)
+const createNewChatflows = (body) => client.post(`/chatflows/all`, body) | packages/ui/src/api/chatflows.js | 13 | JavaScript | 0.286 | question | 37 | 35 | 35 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: JavaScript
File: packages/ui/src/api/chatflows.js
PR Title: Feature/extract import all
BEFORE CODE: import client from './client'
const getAllChatflows = () => client.get('/chatflows')
const getAllAgentflows = () => client.get('/chatflows?type=MULTIAGENT')
const getSpec... | will `importChatflows` a better name? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import express from 'express'
import chatflowsController from '../../controllers/chatflows'
const router = express.Router()
// CREATE
router.post('/', chatflowsController.saveChatflow)
router.post('/all', chatflowsController.saveChatflows)
// READ
router.get('/', chatflowsController.getAllChatflows)
router.get(['/', ... | is `/import` better naming? not sure whats the standard best practices | import express from 'express'
import chatflowsController from '../../controllers/chatflows'
const router = express.Router()
// CREATE
router.post('/', chatflowsController.saveChatflow)
router.post('/importchatflows', chatflowsController.importChatflows)
// READ
router.get('/', chatflowsController.getAllChatflows)
rou... | @@ -4,6 +4,7 @@ const router = express.Router()
// CREATE
router.post('/', chatflowsController.saveChatflow)
+router.post('/all', chatflowsController.saveChatflows) | packages/server/src/routes/chatflows/index.ts | 7 | TypeScript | 0.429 | style | 70 | 21 | 21 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/routes/chatflows/index.ts
PR Title: Feature/extract import all
BEFORE CODE: import express from 'express'
import chatflowsController from '../../controllers/chatflows'
const router = express.Router()
// CREATE
router.post('/', chatflow... | is `/import` better naming? not sure whats the standard best practices | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
message: `Import chatflows successful`,
options: {
key: new Date().getTime() + Math.random(),
variant: 'success',
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
... | lint issue? might need to add this `// eslint-disable-next-line react-hooks/exhaustive-deps` | message: `Import chatflows successful`,
options: {
key: new Date().getTime() + Math.random(),
variant: 'success',
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
... | @@ -55,6 +75,104 @@ const ProfileSection = ({ username, handleLogout }) => {
setOpen((prevOpen) => !prevOpen)
}
+ const errorFailed = (message) => {
+ enqueueSnackbar({
+ message: message,
+ options: {
+ key: new Date().getTime() + Math.random(),
+ ... | packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx | 26 | JavaScript | 0.357 | style | 92 | 51 | 51 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: JavaScript
File: packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx
PR Title: Feature/extract import all
BEFORE CODE: message: `Import chatflows successful`,
options: {
key: new Date().getTime() + Math.random(),
... | lint issue? might need to add this `// eslint-disable-next-line react-hooks/exhaustive-deps` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
</Button>
)
}
})
}
useEffect(() => {
if (getAllChatflowsApi.error) errorFailed(`Failed to export Chatflows: ${getAllChatfl... | `// eslint-disable-next-line react-hooks/exhaustive-deps` | action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
</Button>
)
}
})
}
useEffect(() => {
if (getAllChatflowsApi.error) errorFailed(`Failed ... | @@ -55,6 +75,104 @@ const ProfileSection = ({ username, handleLogout }) => {
setOpen((prevOpen) => !prevOpen)
}
+ const errorFailed = (message) => {
+ enqueueSnackbar({
+ message: message,
+ options: {
+ key: new Date().getTime() + Math.random(),
+ ... | packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx | 26 | JavaScript | 0.357 | style | 57 | 51 | 51 | false | Feature/extract import all | 2,796 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: JavaScript
File: packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx
PR Title: Feature/extract import all
BEFORE CODE: <Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
... | `// eslint-disable-next-line react-hooks/exhaustive-deps` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { PromptTemplateInput } from '@langchain/core/prompts'
import { Langfuse } from "langfuse";
class PromptLangfuse_Prompts implements INode {
label: string
name: string
version: number
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: ... | Hey! thanks for the contribution!
I've just added this [PR](https://github.com/FlowiseAI/Flowise/pull/2902) that allow users to add nodes created by community.
Can you add this `this.author = 'your name'` to here, so as we can differentiate that this is a node created by community, and will be shown on UI as well | import { PromptTemplateInput } from '@langchain/core/prompts'
import { Langfuse } from 'langfuse'
class PromptLangfuse_Prompts implements INode {
label: string
name: string
version: number
description: string
type: string
icon: string
category: string
author: string
baseClasses: str... | @@ -0,0 +1,77 @@
+import { ICommonObject, INode, INodeData, INodeParams, PromptTemplate } from '../../../src/Interface'
+import { getBaseClasses, getInputVariables } from '../../../src/utils'
+import { PromptTemplateInput } from '@langchain/core/prompts'
+import { Langfuse } from "langfuse";
+
+class PromptLangfuse_Pro... | packages/components/nodes/prompts/PromptLangfuse/PromptLangfuse.ts | 26 | TypeScript | 0.643 | security | 320 | 51 | 51 | false | Add prompt template from langfuse | 2,883 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | cruz-lucas | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/prompts/PromptLangfuse/PromptLangfuse.ts
PR Title: Add prompt template from langfuse
BEFORE CODE: import { PromptTemplateInput } from '@langchain/core/prompts'
import { Langfuse } from "langfuse";
class PromptLangfuse_Prompts imp... | Hey! thanks for the contribution!
I've just added this [PR](https://github.com/FlowiseAI/Flowise/pull/2902) that allow users to add nodes created by community.
Can you add this `this.author = 'your name'` to here, so as we can differentiate that this is a node created by community, and will be shown on UI as well | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
secretAccessKey: credentialApiSecret,
sessionToken: credentialApiSession
}
}
const client = new BedrockRuntimeClient({
region: obj.region,
credentials: obj.credentials
})
const model = new BedrockEmbeddings(obj)
... | if we have proven the new approach works, we can go ahead and delete this | secretAccessKey: credentialApiSecret,
sessionToken: credentialApiSession
}
}
const client = new BedrockRuntimeClient({
region: obj.region,
credentials: obj.credentials
})
const model = new BedrockEmbeddings(obj)
... | @@ -144,7 +162,10 @@ class AWSBedrockEmbedding_Embeddings implements INode {
if (iModel.startsWith('cohere')) {
return await embedTextCohere(documents, client, iModel, inputType)
} else {
- return Promise.all(documents.map((document) => embedTextTitan(document, ... | packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts | 26 | TypeScript | 0.214 | suggestion | 73 | 51 | 51 | false | AWS Bedrock embeddings call retry extension | 2,917 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | RPKosec | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts
PR Title: AWS Bedrock embeddings call retry extension
BEFORE CODE: secretAccessKey: credentialApiSecret,
sessionToken: credentialApiSession
... | if we have proven the new approach works, we can go ahead and delete this | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { Embeddings } from '@langchain/core/embeddings';
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface';
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils';
interface InsertRow {
[x: string]: string | ... | can we increment the version to `2.0`? | import { Embeddings } from '@langchain/core/embeddings'
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { howToUseFileUpload } from '... | @@ -1,45 +1,45 @@
-import { flatten } from 'lodash'
-import { DataType, ErrorCode, MetricType, IndexType } from '@zilliz/milvus2-sdk-node'
-import { Document } from '@langchain/core/documents'
-import { MilvusLibArgs, Milvus } from '@langchain/community/vectorstores/milvus'
-import { Embeddings } from '@langchain/core/... | packages/components/nodes/vectorstores/Milvus/Milvus.ts | 26 | TypeScript | 0.214 | question | 38 | 51 | 51 | false | added tls support to milvus | 3,068 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | Eyalm321 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Milvus/Milvus.ts
PR Title: added tls support to milvus
BEFORE CODE: import { Embeddings } from '@langchain/core/embeddings';
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } f... | can we increment the version to `2.0`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// embeddings
const docs = nodeData.inputs?.document as Document[]
const embeddings = nodeData.inputs?.embeddings as Embeddings
const isFileUploadEnabled = nodeData.inputs?.fileUpload as boolean
// credential
const credentialData = await getCreden... | question: if user dont have secure SSL and the pem path, does it still works? | // embeddings
const docs = nodeData.inputs?.document as Document[]
const embeddings = nodeData.inputs?.embeddings as Embeddings
const isFileUploadEnabled = nodeData.inputs?.fileUpload as boolean
// credential
const credentialData = await getCreden... | @@ -136,10 +183,31 @@ class Milvus_VectorStores implements INode {
const milvusUser = getCredentialParam('milvusUser', credentialData, nodeData)
const milvusPassword = getCredentialParam('milvusPassword', credentialData, nodeData)
+ // tls
+ const secure = nodeData.inpu... | packages/components/nodes/vectorstores/Milvus/Milvus.ts | 26 | TypeScript | 0.286 | question | 77 | 51 | 51 | false | added tls support to milvus | 3,068 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | Eyalm321 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Milvus/Milvus.ts
PR Title: added tls support to milvus
BEFORE CODE: // embeddings
const docs = nodeData.inputs?.document as Document[]
const embeddings = nodeData.inputs?.embeddings... | question: if user dont have secure SSL and the pem path, does it still works? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
label: 'Select Chatflow',
name: 'selectedChatflow',
type: 'asyncOptions',
loadMethod: 'listChatflows'
},
{
label: 'Tool Name',
name: 'name',
type: 'string'
},
{... | think we dont need to have `acceptVariable` | label: 'Select Chatflow',
name: 'selectedChatflow',
type: 'asyncOptions',
loadMethod: 'listChatflows'
},
{
label: 'Tool Name',
name: 'name',
type: 'string'
},
{... | @@ -57,6 +57,15 @@ class ChatflowTool_Tools implements INode {
placeholder:
'State of the Union QA - useful for when you need to ask questions about the most recent state of the union address.'
},
+ {
+ label: 'Override Config',
+ ... | packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts | 26 | TypeScript | 0.214 | suggestion | 43 | 51 | 51 | false | feat: add support for custom overrideConfig for ChatflowTool | 3,168 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | mokeyish | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts
PR Title: feat: add support for custom overrideConfig for ChatflowTool
BEFORE CODE: label: 'Select Chatflow',
name: 'selectedChatflow',
type: 'asyn... | think we dont need to have `acceptVariable` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
configurationId?: string
/**
* The host URL of the Nemo server.
* @default "http://localhost:8000"
*/
baseUrl?: string
}
class ChatNemoGuardrailsModel extends BaseChatModel<ChatNemoGuardrailsCallOptions, AIMessageChunk> implements ChatNemoGuardrailsInput {
configurationId: string
id:... | can we add `await runManager?.handleLLMNewToken(token ?? '')` so that we can trace it for analytic as well | configurationId?: string
/**
* The host URL of the Nemo server.
* @default "http://localhost:8000"
*/
baseUrl?: string
}
class ChatNemoGuardrailsModel extends BaseChatModel<ChatNemoGuardrailsCallOptions, AIMessageChunk> implements ChatNemoGuardrailsInput {
configurationId: string
id:... | @@ -0,0 +1,119 @@
+import { BaseChatModel, type BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AIMessageChunk, BaseMessage } from '@langchain/core/messages'
+import { BaseChatModelCallOptions } from '@langchain/core/language_models/chat_models'
+import { NemoClient } from './NemoClie... | packages/components/nodes/chatmodels/ChatNemoGuardrails/ChatNemoGuardrails.ts | 26 | TypeScript | 0.643 | question | 106 | 51 | 51 | false | Added NeMo Guardrails Chat component | 3,331 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | patrickreinan | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatNemoGuardrails/ChatNemoGuardrails.ts
PR Title: Added NeMo Guardrails Chat component
BEFORE CODE: configurationId?: string
/**
* The host URL of the Nemo server.
* @default "http://localhost:8000"
... | can we add `await runManager?.handleLLMNewToken(token ?? '')` so that we can trace it for analytic as well | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
constructor() {
this.label = 'Chat Nemo Guardrails'
this.name = 'chatNemoGuardrails'
this.version = 1.0
this.type = 'ChatNemoGuardrails'
this.icon = 'nemo.svg'
this.category = 'Chat Models'
this.description = 'Access models through the Nemo Guardrails API'
... | we can just have `async init(nodeData: INodeData)` | inputs: INodeParams[]
constructor() {
this.label = 'Chat Nemo Guardrails'
this.name = 'chatNemoGuardrails'
this.version = 1.0
this.type = 'ChatNemoGuardrails'
this.icon = 'nemo.svg'
this.category = 'Chat Models'
this.description = 'Access models through t... | @@ -0,0 +1,119 @@
+import { BaseChatModel, type BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AIMessageChunk, BaseMessage } from '@langchain/core/messages'
+import { BaseChatModelCallOptions } from '@langchain/core/language_models/chat_models'
+import { NemoClient } from './NemoClie... | packages/components/nodes/chatmodels/ChatNemoGuardrails/ChatNemoGuardrails.ts | 26 | TypeScript | 0.357 | suggestion | 50 | 39 | 41 | false | Added NeMo Guardrails Chat component | 3,331 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | patrickreinan | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatNemoGuardrails/ChatNemoGuardrails.ts
PR Title: Added NeMo Guardrails Chat component
BEFORE CODE: constructor() {
this.label = 'Chat Nemo Guardrails'
this.name = 'chatNemoGuardrails'
this.... | we can just have `async init(nodeData: INodeData)` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/*** Get chatflows and prepare data ***/
const flowData = chatflow.flowData
const parsedFlowData: IReactFlowObject = JSON.parse(flowData)
const nodes = parsedFlowData.nodes
const edges = parsedFlowData.edges
const apiMessageId = uuidv4()
/*** Get session ID ***... | the ordering of the params are incorrect for the function, should be:
```
...
chatId,
apiMessageId,
memoryType ?? '',
...
```
```
const utilBuildAgentResponse = async (
agentflow: IChatFlow,
isInternal: boolean,
chatId: string,
apiMessageId: string,
...
)
``` | }
}
/*** Get chatflows and prepare data ***/
const flowData = chatflow.flowData
const parsedFlowData: IReactFlowObject = JSON.parse(flowData)
const nodes = parsedFlowData.nodes
const edges = parsedFlowData.edges
const apiMessageId = uuidv4()
... | @@ -216,6 +218,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
chatId,
memoryType ?? '',
sessionId,
+ apiMessageId, | packages/server/src/utils/buildChatflow.ts | 26 | TypeScript | 1 | bug | 297 | 51 | 51 | false | Lunary: feedback tracking | 3,332 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | vincelwt | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/buildChatflow.ts
PR Title: Lunary: feedback tracking
BEFORE CODE: /*** Get chatflows and prepare data ***/
const flowData = chatflow.flowData
const parsedFlowData: IReactFlowObject = JSON.parse(flowData)
... | the ordering of the params are incorrect for the function, should be:
```
...
chatId,
apiMessageId,
memoryType ?? '',
...
```
```
const utilBuildAgentResponse = async (
agentflow: IChatFlow,
isInternal: boolean,
chatId: string,
apiMessageId: string,
...
)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
step: 1,
optional: true,
additionalParams: true
},
{
label: 'BasePath',
name: 'basepath',
type: 'string',
optional: true,
additionalParams: true
},
... | Can we do like:
```
{
label: 'Stop Sequence',
name: 'stopSequence',
type: 'string',
rows: 4,
optional: true,
description: 'List of stop words to use when generating. Use comma to separate multiple stop words.',
additionalParams: true
}
```
And at the bottom place, we can split by `(',')` and... | step: 1,
optional: true,
additionalParams: true
},
{
label: 'BasePath',
name: 'basepath',
type: 'string',
optional: true,
additionalParams: true
},
... | @@ -111,6 +111,13 @@ class ChatOpenAI_ChatModels implements INode {
optional: true,
additionalParams: true
},
+ {
+ label: 'Stop Sequence',
+ name: 'stopSequence',
+ type: 'string',
+ optional: true,
+ ... | packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts | 26 | TypeScript | 1 | suggestion | 344 | 51 | 51 | false | Refactor ChatOpenAI_ChatModels to include stopSequence parameter | 3,388 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | definitelynotchirag | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts
PR Title: Refactor ChatOpenAI_ChatModels to include stopSequence parameter
BEFORE CODE: step: 1,
optional: true,
additionalParams: true
... | Can we do like:
```
{
label: 'Stop Sequence',
name: 'stopSequence',
type: 'string',
rows: 4,
optional: true,
description: 'List of stop words to use when generating. Use comma to separate multiple stop words.',
additionalParams: true
}
```
And at the bottom place, we can split by `(',')` and... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads.
botMessage: {
backgroundColor: "#f7f8ff",
textColor: "#303235",
showAvatar: true,
avatarSrc... | do we need a follow up PR on Embed (https://github.com/FlowiseAI/FlowiseChatEmbed) for this functionality?
Currently it only works for Flowise UI right? | clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads.
botMessage: {
backgroundColor: "#f7f8ff",
textColor: "#303235",
showAvatar: true,
avatarSrc... | @@ -173,6 +173,15 @@ const chatwindowConfig = (isReact = false) => {
// sendSoundLocation: "send_message.mp3", // If this is not used, the default sound effect will be played if sendSoundMessage is true.
receiveMessageSound: true,
// receiveSoun... | packages/ui/src/views/chatflows/EmbedChat.jsx | 26 | JavaScript | 0.357 | question | 155 | 51 | 51 | false | Add Up and Down arrow functionality to chat messages | 3,440 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | tgmerritt | Review this pull request change.
Language: JavaScript
File: packages/ui/src/views/chatflows/EmbedChat.jsx
PR Title: Add Up and Down arrow functionality to chat messages
BEFORE CODE: clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads.
b... | do we need a follow up PR on Embed (https://github.com/FlowiseAI/FlowiseChatEmbed) for this functionality?
Currently it only works for Flowise UI right? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { INodeParams, INodeCredential } from '../src/Interface'
class FireCrawlApiCredential implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'FireCrawl API'
this.name = 'fireCrawlApi'... | we might want to increase the version above to 2.0 | import { INodeParams, INodeCredential } from '../src/Interface'
class FireCrawlApiCredential implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'FireCrawl API'
this.name = 'fireCrawlApi'... | @@ -18,6 +18,12 @@ class FireCrawlApiCredential implements INodeCredential {
label: 'FireCrawl API',
name: 'firecrawlApiToken',
type: 'password'
+ }, | packages/components/credentials/FireCrawlApi.credential.ts | 21 | TypeScript | 0.214 | suggestion | 50 | 33 | 33 | false | feat: Add Custom Api Url Param for Self-hosted FireCrawl endpoint | 3,480 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | ZacharyQin | Review this pull request change.
Language: TypeScript
File: packages/components/credentials/FireCrawlApi.credential.ts
PR Title: feat: Add Custom Api Url Param for Self-hosted FireCrawl endpoint
BEFORE CODE: import { INodeParams, INodeCredential } from '../src/Interface'
class FireCrawlApiCredential implements INo... | we might want to increase the version above to 2.0 | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
llm,
agent,
name,
abortControllerSignal,
nodeData,
input,
options
}: {
state: ISeqAgentsState
llm: BaseChatModel
agent: AgentExecutor | RunnableSequence
name: string
abortControllerSignal: AbortController
nodeDat... | I dont we can pass empty array, perhaps we need to take the last message:

| prompt = await checkMessageHistory(nodeData, options, prompt, promptArrays, systemPrompt)
if (multiModalMessageContent.length) {
const msg = HumanMessagePromptTemplate.fromTemplate([...multiModalMessageContent])
prompt.promptMessages.splice(1, 0, msg)
}
let chain
if (!llmNodeInput... | @@ -535,7 +543,7 @@ async function agentNode(
}
// @ts-ignore
- state.messages = restructureMessages(llm, state)
+ state.messages = nodeData.inputs?.disableConversationHistory | false ? [] : restructureMessages(llm, state) | packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts | 26 | TypeScript | 0.429 | suggestion | 167 | 51 | 51 | false | feat: Add options to filter conversation history messages used in sequential LLM and Agent nodes | 3,653 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | jeanibarz | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts
PR Title: feat: Add options to filter conversation history messages used in sequential LLM and Agent nodes
BEFORE CODE: llm,
agent,
name,
abortControllerSignal,
... | I dont we can pass empty array, perhaps we need to take the last message:

| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions, OpenAIClient, toFile } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
import axios from 'axios'
import FormData from 'fo... | i think this is probably redundant, I've always just directly use the built in `FormData`, can you try to remove this and see if it works fine? | import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions, OpenAIClient, toFile } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
import axios from 'axios'
import Groq from 'groq-s... | @@ -3,12 +3,15 @@ import { getCredentialData } from './utils'
import { type ClientOptions, OpenAIClient, toFile } from '@langchain/openai'
import { AssemblyAI } from 'assemblyai'
import { getFileFromStorage } from './storageUtils'
+import axios from 'axios'
+import FormData from 'form-data' | packages/components/src/speechToText.ts | 7 | TypeScript | 0.571 | refactor | 143 | 32 | 32 | false | Feature/Add Azure Cognitive speech-to-text functionality | 3,718 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | ghondar | Review this pull request change.
Language: TypeScript
File: packages/components/src/speechToText.ts
PR Title: Feature/Add Azure Cognitive speech-to-text functionality
BEFORE CODE: import { ICommonObject, IFileUpload } from './Interface'
import { getCredentialData } from './utils'
import { type ClientOptions, OpenAI... | i think this is probably redundant, I've always just directly use the built in `FormData`, can you try to remove this and see if it works fine? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
label: 'Stop Sequence',
name: 'stopSequence',
type: 'string',
rows: 4,
optional: true,
description: 'List of stop words to use when generating. Use comma to separate multiple stop words.',
additionalPar... | i dont think its capable of image input yet, we can remove this | label: 'Stop Sequence',
name: 'stopSequence',
type: 'string',
rows: 4,
optional: true,
description: 'List of stop words to use when generating. Use comma to separate multiple stop words.',
additionalPar... | @@ -0,0 +1,235 @@
+import { BaseCache } from '@langchain/core/caches'
+import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AzureOpenAIInput, ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
+import type { ClientOptions } from 'openai'
+import { ICommo... | packages/components/nodes/chatmodels/Deepseek/Deepseek.ts | 26 | TypeScript | 0.286 | refactor | 63 | 51 | 51 | false | Feat/deepseek chat node | 3,732 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | nguyenhung10012003 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/Deepseek/Deepseek.ts
PR Title: Feat/deepseek chat node
BEFORE CODE: label: 'Stop Sequence',
name: 'stopSequence',
type: 'string',
rows: 4,
... | i dont think its capable of image input yet, we can remove this | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
{
label: 'Timeout',
name: 'timeout',
type: 'number',
step: 1,
optional: true,
additionalParams: true
},
{
label: 'Stop Sequence',
name: 'stopSeque... | i dont think its capable of image input yet, we can remove this | {
label: 'Timeout',
name: 'timeout',
type: 'number',
step: 1,
optional: true,
additionalParams: true
},
{
label: 'Stop Sequence',
name: 'stopSeque... | @@ -0,0 +1,235 @@
+import { BaseCache } from '@langchain/core/caches'
+import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AzureOpenAIInput, ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
+import type { ClientOptions } from 'openai'
+import { ICommo... | packages/components/nodes/chatmodels/Deepseek/Deepseek.ts | 26 | TypeScript | 0.286 | refactor | 63 | 51 | 51 | false | Feat/deepseek chat node | 3,732 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | nguyenhung10012003 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/Deepseek/Deepseek.ts
PR Title: Feat/deepseek chat node
BEFORE CODE: {
label: 'Timeout',
name: 'timeout',
type: 'number',
step: 1,
... | i dont think its capable of image input yet, we can remove this | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
optional: false,
additionalParams: true
}
]
}
//@ts-ignore
loadMethods = {
async listModels(): Promise<INodeOptionsValue[]> {
return await getModels(MODEL_TYPE.CHAT, 'deepseek')
}
}
async init(nodeData: IN... | i dont think its capable of image input yet, we can remove this | const cache = nodeData.inputs?.cache as BaseCache
const obj: Partial<OpenAIChatInput> & BaseChatModelParams & { configuration?: ClientOptions & LegacyOpenAIInput } = {
temperature: parseFloat(temperature),
modelName,
openAIApiKey,
streaming: streami... | @@ -0,0 +1,235 @@
+import { BaseCache } from '@langchain/core/caches'
+import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AzureOpenAIInput, ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
+import type { ClientOptions } from 'openai'
+import { ICommo... | packages/components/nodes/chatmodels/Deepseek/Deepseek.ts | 26 | TypeScript | 0.286 | refactor | 63 | 51 | 47 | false | Feat/deepseek chat node | 3,732 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | nguyenhung10012003 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/Deepseek/Deepseek.ts
PR Title: Feat/deepseek chat node
BEFORE CODE: optional: false,
additionalParams: true
}
]
}
//@ts-ignore
loadMethods = {
... | i dont think its capable of image input yet, we can remove this | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
openAIApiKey,
streaming: streaming ?? true
}
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
if (topP) obj.topP = parseFloat(topP)
if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty)
if (presencePenalty) obj.presencePen... | i dont think its capable of image input yet, we can remove this | import { BaseCache } from '@langchain/core/caches'
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
import { ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
import type { ClientOptions } from 'openai'
import { ICommonObject, INode, INodeData, INodeOptionsVa... | @@ -0,0 +1,235 @@
+import { BaseCache } from '@langchain/core/caches'
+import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AzureOpenAIInput, ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
+import type { ClientOptions } from 'openai'
+import { ICommo... | packages/components/nodes/chatmodels/Deepseek/Deepseek.ts | 26 | TypeScript | 0.286 | refactor | 63 | 44 | 198 | false | Feat/deepseek chat node | 3,732 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | nguyenhung10012003 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/Deepseek/Deepseek.ts
PR Title: Feat/deepseek chat node
BEFORE CODE: openAIApiKey,
streaming: streaming ?? true
}
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
... | i dont think its capable of image input yet, we can remove this | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (stopSequence) {
const stopSequenceArray = stopSequence.split(',').map((item) => item.trim())
obj.stop = stopSequenceArray
}
let parsedBaseOptions: any | undefined = undefined
if (baseOptions) {
try {
parsedBaseOptions = t... | missing `baseOptions: parsedBaseOptions` | import { BaseCache } from '@langchain/core/caches'
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
import { ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
import type { ClientOptions } from 'openai'
import { ICommonObject, INode, INodeData, INodeOptionsVa... | @@ -0,0 +1,235 @@
+import { BaseCache } from '@langchain/core/caches'
+import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
+import { AzureOpenAIInput, ChatOpenAI, LegacyOpenAIInput, OpenAIChatInput } from '@langchain/openai'
+import type { ClientOptions } from 'openai'
+import { ICommo... | packages/components/nodes/chatmodels/Deepseek/Deepseek.ts | 26 | TypeScript | 0.214 | suggestion | 40 | 34 | 198 | false | Feat/deepseek chat node | 3,732 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | nguyenhung10012003 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/Deepseek/Deepseek.ts
PR Title: Feat/deepseek chat node
BEFORE CODE: if (stopSequence) {
const stopSequenceArray = stopSequence.split(',').map((item) => item.trim())
obj.stop = stopSeque... | missing `baseOptions: parsedBaseOptions` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
case 'Less Than or Equal To':
return numericCompare((a, b) => a <= b)
default:
return false
}
}
export const transformObjectPropertyToFunction = (obj: ICommonObject, state: ISeqAgentsState) => {
const transformedObject: ICommonObject = {}
for (const key in obj) {
... | should we also check if the array is not empty? | case 'Less Than or Equal To':
return numericCompare((a, b) => a <= b)
default:
return false
}
}
export const transformObjectPropertyToFunction = (obj: ICommonObject, state: ISeqAgentsState) => {
const transformedObject: ICommonObject = {}
for (const key in obj) {
... | @@ -99,7 +99,22 @@ export const transformObjectPropertyToFunction = (obj: ICommonObject, state: ISe
(message) => message.additional_kwargs && message.additional_kwargs?.nodeId === parsedValue.id
)
const messageOutput = messageOutputs[messageOutputs.length - 1]
- ... | packages/components/nodes/sequentialagents/commonUtils.ts | 26 | TypeScript | 0.143 | question | 47 | 51 | 51 | false | [BUGFIX] Fix value.startsWith is not a function error | 3,747 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | simsketch | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/sequentialagents/commonUtils.ts
PR Title: [BUGFIX] Fix value.startsWith is not a function error
BEFORE CODE: case 'Less Than or Equal To':
return numericCompare((a, b) => a <= b)
default:
r... | should we also check if the array is not empty? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
const removeAllChatMessages = async (req: Request, res: Response, next: NextFunction) => {
try {
const appServer = getRunningExpressApp()
if (typeof req.params === 'undefined' || !req.params.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
... | why do we need `startDateTime` and `endDateTime` since we already have `startDate` and `endDate`? wouldnt that be confusing which to use? | 'Error: chatMessagesController.removeAllChatMessages - id not provided!'
)
}
const chatflowid = req.params.id
const chatflow = await chatflowsService.getChatflowById(req.params.id)
if (!chatflow) {
return res.status(404).send(`Chatflow ${req.params... | @@ -158,6 +166,8 @@ const removeAllChatMessages = async (req: Request, res: Response, next: NextFunc
const _chatType = req.query?.chatType as string | undefined
const startDate = req.query?.startDate as string | undefined
const endDate = req.query?.endDate as string | undefined
+ const... | packages/server/src/controllers/chat-messages/index.ts | 26 | TypeScript | 0.571 | question | 137 | 51 | 51 | false | Get/Delete ChatMessage based on startDateTime / endDateTime | 3,867 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | ryanhalliday | Review this pull request change.
Language: TypeScript
File: packages/server/src/controllers/chat-messages/index.ts
PR Title: Get/Delete ChatMessage based on startDateTime / endDateTime
BEFORE CODE: }
const removeAllChatMessages = async (req: Request, res: Response, next: NextFunction) => {
try {
const ... | why do we need `startDateTime` and `endDateTime` since we already have `startDate` and `endDate`? wouldnt that be confusing which to use? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} else if (endingNodeData.category === 'Engine') {
// Engines that are available to stream
const whitelistEngine = ['contextChatEngine', 'simpleChatEngine', 'queryEngine', 'subQuestionQueryEngine']
isValidChainOrAgent = whitelistEngine.includes(endingNodeData.name)
}
// If no output... | lint error, 'PutSecretValueCommand' is defined but never used | // Engines that are available to stream
const whitelistEngine = ['contextChatEngine', 'simpleChatEngine', 'queryEngine', 'subQuestionQueryEngine']
isValidChainOrAgent = whitelistEngine.includes(endingNodeData.name)
}
// If no output parser, flow is available to stream
let isOutputPa... | @@ -1394,6 +1394,29 @@ export const getEncryptionKey = async (): Promise<string> => {
if (process.env.FLOWISE_SECRETKEY_OVERWRITE !== undefined && process.env.FLOWISE_SECRETKEY_OVERWRITE !== '') {
return process.env.FLOWISE_SECRETKEY_OVERWRITE
}
+ if (USE_AWS_SECRETS_MANAGER && secretsManagerClien... | packages/server/src/utils/index.ts | 26 | TypeScript | 0.429 | security | 61 | 51 | 51 | false | Update how credential data is saved in db when using aws secrets manager | 4,271 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/index.ts
PR Title: Update how credential data is saved in db when using aws secrets manager
BEFORE CODE: } else if (endingNodeData.category === 'Engine') {
// Engines that are available to stream
const whitelis... | lint error, 'PutSecretValueCommand' is defined but never used | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
)
const [nodeOverrides, setNodeOverrides] = useState(apiConfig?.overrideConfig?.nodes !== undefined ? apiConfig.overrideConfig.nodes : {})
const [variableOverrides, setVariableOverrides] = useState(
apiConfig?.overrideConfig?.variables !== undefined ? apiConfig.overrideConfig.variables : []
)
... | we dont have to filter out the enabled ones? | )
const [nodeOverrides, setNodeOverrides] = useState(apiConfig?.overrideConfig?.nodes !== undefined ? apiConfig.overrideConfig.nodes : {})
const [variableOverrides, setVariableOverrides] = useState(
apiConfig?.overrideConfig?.variables !== undefined ? apiConfig.overrideConfig.variables : []
)
... | @@ -116,25 +116,22 @@ const OverrideConfig = ({ dialogProps }) => {
}
const formatObj = () => {
- const obj = {
- overrideConfig: { status: overrideConfigStatus }
+ let apiConfig = JSON.parse(dialogProps.chatflow.apiConfig)
+ if (apiConfig === null || apiConfig === undefined)... | packages/ui/src/ui-component/extended/OverrideConfig.jsx | 26 | JavaScript | 0.071 | question | 44 | 51 | 51 | false | changes & fixes for various issues in chatflow config | 4,314 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | vinodkiran | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/extended/OverrideConfig.jsx
PR Title: changes & fixes for various issues in chatflow config
BEFORE CODE: )
const [nodeOverrides, setNodeOverrides] = useState(apiConfig?.overrideConfig?.nodes !== undefined ? apiConfig.ov... | we dont have to filter out the enabled ones? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return redisClient
}
}
const getRedisClient = async (nodeData: INodeData, options: ICommonObject) => {
let client: Redis
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const redisUrl = getCredentialParam('redisUrl', credentialData, nodeData)
if (!redisU... | instead of hardcoding the values, can we have:
`REDIS_KEEP_ALIVE` env variable? `keepAlive: process.env.REDIS_KEEP_ALIVE ?? undefined,` |
return redisClient
}
}
const getRedisClient = async (nodeData: INodeData, options: ICommonObject) => {
let client: Redis
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const redisUrl = getCredentialParam('redisUrl', credentialData, nodeData)
if (!redisU... | @@ -126,10 +126,15 @@ const getRedisClient = async (nodeData: INodeData, options: ICommonObject) => {
host,
username,
password,
- ...tlsOptions
+ ...tlsOptions,
+ keepAlive: 60000, | packages/components/nodes/cache/RedisCache/RedisCache.ts | 26 | TypeScript | 0.714 | suggestion | 138 | 51 | 51 | false | Fix: Add keep-alive options to Redis clients to prevent idle timeouts and socket closing. | 4,377 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | Nek-11 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/cache/RedisCache/RedisCache.ts
PR Title: Fix: Add keep-alive options to Redis clients to prevent idle timeouts and socket closing.
BEFORE CODE:
return redisClient
}
}
const getRedisClient = async (nodeData: INodeData,... | instead of hardcoding the values, can we have:
`REDIS_KEEP_ALIVE` env variable? `keepAlive: process.env.REDIS_KEEP_ALIVE ?? undefined,` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const redisUrl = getCredentialParam('redisUrl', credentialData, nodeData)
if (!redisUrl || redisUrl === '') {
const username = getCredentialParam('redisCacheUser', credentialData, nodeData)
const password = ... | is the retry strategy a must? because we dont have the same when `createClient` |
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const redisUrl = getCredentialParam('redisUrl', credentialData, nodeData)
if (!redisUrl || redisUrl === '') {
const username = getCredentialParam('redisCacheUser', credentialData, nodeData)
const password = ... | @@ -126,10 +126,15 @@ const getRedisClient = async (nodeData: INodeData, options: ICommonObject) => {
host,
username,
password,
- ...tlsOptions
+ ...tlsOptions,
+ keepAlive: 60000,
+ retryStrategy: (times) => Math.min(times * 100, 3000),... | packages/components/nodes/cache/RedisCache/RedisCache.ts | 26 | TypeScript | 0.429 | suggestion | 79 | 51 | 51 | false | Fix: Add keep-alive options to Redis clients to prevent idle timeouts and socket closing. | 4,377 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | Nek-11 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/cache/RedisCache/RedisCache.ts
PR Title: Fix: Add keep-alive options to Redis clients to prevent idle timeouts and socket closing.
BEFORE CODE:
const credentialData = await getCredentialData(nodeData.credential ?? '', options... | is the retry strategy a must? because we dont have the same when `createClient` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
{
label: 'Model',
name: 'conditionAgentModel',
type: 'asyncOptions',
loadMethod: 'listModels',
loadConfig: true
},
{
label: 'Instructions',
name: 'conditionAgentInstruction... | I'd prefer not to have this option as changing this alter not just the node behaviour, but also the flow logic in `buildAgentflow` | {
label: 'Model',
name: 'conditionAgentModel',
type: 'asyncOptions',
loadMethod: 'listModels',
loadConfig: true
},
{
label: 'Instructions',
name: 'conditionAgentInstruction... | @@ -59,6 +59,16 @@ class ConditionAgent_Agentflow implements INode {
acceptVariable: true,
default: '<p><span class="variable" data-type="mention" data-id="question" data-label="question">{{ question }}</span> </p>'
},
+ { | packages/components/nodes/agentflow/ConditionAgent/ConditionAgent.ts | 26 | TypeScript | 0.571 | suggestion | 130 | 51 | 51 | false | feat: Add configurable system prompt to Condition Agent | 4,587 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | toi500 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/agentflow/ConditionAgent/ConditionAgent.ts
PR Title: feat: Add configurable system prompt to Condition Agent
BEFORE CODE: {
label: 'Model',
name: 'conditionAgentModel',
t... | I'd prefer not to have this option as changing this alter not just the node behaviour, but also the flow logic in `buildAgentflow` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
is_premium_domain: boolean
}
interface OxylabsLoaderParameters {
username: string
password: string
query: string
source: string
geo_location: string
render: boolean
parse: boolean
user_agent_type: string
}
export class OxylabsLoader extends BaseDocumentLoader {
private params: ... | Using btoa may not work in Node.js environments; consider using `Buffer.from(\`\${this.params.username}:\${this.params.password}\`).toString('base64')` for server-side base64 encoding.
```suggestion
const auth = Buffer.from(`${this.params.username}:${this.params.password}`).toString('base64')
``` | is_premium_domain: boolean
}
interface OxylabsLoaderParameters {
username: string
password: string
query: string
source: string
geo_location: string
render: boolean
parse: boolean
user_agent_type: string
}
export class OxylabsLoader extends BaseDocumentLoader {
private params: ... | @@ -0,0 +1,381 @@
+import { TextSplitter } from 'langchain/text_splitter'
+import { DocumentInterface } from '@langchain/core/documents'
+import { BaseDocumentLoader } from 'langchain/document_loaders/base'
+import { INode, INodeData, INodeParams, ICommonObject, INodeOutputsValue } from '../../../src/Interface'
+import... | packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts | 26 | TypeScript | 0.857 | security | 305 | 51 | 51 | false | Add Oxylabs Document Loader | 4,625 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | oxy-rostyslav | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts
PR Title: Add Oxylabs Document Loader
BEFORE CODE: is_premium_domain: boolean
}
interface OxylabsLoaderParameters {
username: string
password: string
query: string
source: st... | Using btoa may not work in Node.js environments; consider using `Buffer.from(\`\${this.params.username}:\${this.params.password}\`).toString('base64')` for server-side base64 encoding.
```suggestion
const auth = Buffer.from(`${this.params.username}:${this.params.password}`).toString('base64')
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
geo_location: this.params.geo_location,
render: this.params.render,
parse: this.params.parse,
user_agent_type: this.params.user_agent_type
})
}
public async load(): Promise<DocumentInterface[]> {
let response
if (this.params.source === 'go... | Only the first result is converted into a document. To support multiple pages or results, map over `response.data.results` and create a document for each entry.
```suggestion
const docs: OxylabsDocument[] = response.data.results.map((result, index) => ({
id: `${response.data.job.id.toString()}-${ind... | this.icon = 'oxylabs.svg'
this.version = 1.0
this.category = 'Document Loaders'
this.description = 'Extract data from URLs using Oxylabs'
this.baseClasses = [this.type]
this.credential = {
label: 'Oxylabs API',
name: 'credential',
type:... | @@ -0,0 +1,381 @@
+import { TextSplitter } from 'langchain/text_splitter'
+import { DocumentInterface } from '@langchain/core/documents'
+import { BaseDocumentLoader } from 'langchain/document_loaders/base'
+import { INode, INodeData, INodeParams, ICommonObject, INodeOutputsValue } from '../../../src/Interface'
+import... | packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts | 26 | TypeScript | 0.786 | suggestion | 407 | 51 | 51 | false | Add Oxylabs Document Loader | 4,625 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | oxy-rostyslav | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts
PR Title: Add Oxylabs Document Loader
BEFORE CODE: geo_location: this.params.geo_location,
render: this.params.render,
parse: this.params.parse,
us... | Only the first result is converted into a document. To support multiple pages or results, map over `response.data.results` and create a document for each entry.
```suggestion
const docs: OxylabsDocument[] = response.data.results.map((result, index) => ({
id: `${response.data.job.id.toString()}-${ind... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
constructor(loaderParams: OxylabsLoaderParameters) {
super()
this.params = loaderParams
}
private async sendAPIRequest<R>(params: any): Promise<AxiosResponse<R, any>> {
params = Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== null && value !== '' && value ... | [nitpick] The `getUniversal`, `getGoogleSearch`, `getAmazonProduct`, and `getAmazonSearch` methods are almost identical. Consider unifying them into a single method that accepts `source` as an argument to reduce duplication. | constructor(loaderParams: OxylabsLoaderParameters) {
super()
this.params = loaderParams
}
private async sendAPIRequest<R>(params: any): Promise<AxiosResponse<R, any>> {
params = Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== null && value !== '' && value ... | @@ -0,0 +1,381 @@
+import { TextSplitter } from 'langchain/text_splitter'
+import { DocumentInterface } from '@langchain/core/documents'
+import { BaseDocumentLoader } from 'langchain/document_loaders/base'
+import { INode, INodeData, INodeParams, ICommonObject, INodeOutputsValue } from '../../../src/Interface'
+import... | packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts | 26 | TypeScript | 0.643 | suggestion | 224 | 51 | 51 | false | Add Oxylabs Document Loader | 4,625 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | oxy-rostyslav | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts
PR Title: Add Oxylabs Document Loader
BEFORE CODE: constructor(loaderParams: OxylabsLoaderParameters) {
super()
this.params = loaderParams
}
private async sendAPIRequ... | [nitpick] The `getUniversal`, `getGoogleSearch`, `getAmazonProduct`, and `getAmazonSearch` methods are almost identical. Consider unifying them into a single method that accepts `source` as an argument to reduce duplication. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
workspaceId: activeWorkspaceId
}
})
).map((chatflow) => chatflow.id)
chatmessageChatflowIds.forEach((item) => {
if (databaseChatflowIds.includes(item.id)) {
item.qty += 1
}
})
const missingChatflowId... | Using Array.includes for each item results in O(n^2) behavior for large batches; consider converting dbExistingIds to a Set for O(1) lookups (e.g., `const existingIdsSet = new Set(dbExistingIds)`).
```suggestion
const dbExistingIds = new Set(records.map((record) => record.id))
originalData.ChatMessage =... | workspaceId: activeWorkspaceId
}
})
).map((chatflow) => chatflow.id)
chatmessageChatflowIds.forEach((item) => {
if (databaseChatflowIds.includes(item.id)) {
item.qty += 1
}
})
const missingChatflowId... | @@ -255,11 +255,15 @@ async function replaceDuplicateIdsForChatMessage(
where: { id: In(ids) }
})
if (records.length < 0) return originalData
- for (let record of records) {
- const oldId = record.id
- const newId = uuidv4()
- originalData = JSON.pa... | packages/server/src/services/export-import/index.ts | 26 | TypeScript | 0.857 | performance | 411 | 51 | 51 | false | Optimize export import | 4,795 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/services/export-import/index.ts
PR Title: Optimize export import
BEFORE CODE: workspaceId: activeWorkspaceId
}
})
).map((chatflow) => chatflow.id)
chatmessageChatflowIds.fo... | Using Array.includes for each item results in O(n^2) behavior for large batches; consider converting dbExistingIds to a Set for O(1) lookups (e.g., `const existingIdsSet = new Set(dbExistingIds)`).
```suggestion
const dbExistingIds = new Set(records.map((record) => record.id))
originalData.ChatMessage =... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return () => {
setIsExporting(false)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [show])
const component = show ? (
<Dialog
onClose={!isExporting ? onCancel : undefined}
open={show}
fullWidth
maxWidth=... | [nitpick] When using CSS grid here, add a `gap` (e.g. `gap: 1` or `gridGap: '16px'`) to the `sx` so the grid items aren’t flush against each other.
```suggestion
gridTemplateColumns: 'repeat(2, 1fr)',
gap: '16px'
``` | return () => {
setIsExporting(false)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [show])
const component = show ? (
<Dialog
onClose={!isExporting ? onCancel : undefined}
open={show}
fullWidth
maxWidth=... | @@ -101,7 +101,13 @@ const ExportDialog = ({ show, onCancel, onExport }) => {
</DialogTitle>
<DialogContent>
{!isExporting && (
- <Stack direction='row' sx={{ gap: 1, flexWrap: 'wrap' }}>
+ <Stack
+ direction='row'
+... | packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx | 26 | JavaScript | 0.786 | suggestion | 272 | 51 | 51 | false | Marketplace page UI/ UX enhancements | 4,819 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | anoopw3bdev | Review this pull request change.
Language: JavaScript
File: packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx
PR Title: Marketplace page UI/ UX enhancements
BEFORE CODE: return () => {
setIsExporting(false)
}
// eslint-disable-next-line react-hooks/exhaustive-dep... | [nitpick] When using CSS grid here, add a `gap` (e.g. `gap: 1` or `gridGap: '16px'`) to the `sx` so the grid items aren’t flush against each other.
```suggestion
gridTemplateColumns: 'repeat(2, 1fr)',
gap: '16px'
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Request,
redirect?: boolean,
isSSO?: boolean
) => {
const token = generateJwtAuthToken(user)
let refreshToken: string = ''
if (regenerateRefreshToken) {
refreshToken = gener... | Remove commented out code. Dead code should be cleaned up to improve maintainability.
```suggestion
``` | })
})
} catch (error: any) {
return next ? next(error) : res.status(401).json(error)
}
})(req, res, next)
})
}
export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Requ... | @@ -291,8 +292,16 @@ export const setTokenOrCookies = (
returnUser.isSSO = !isSSO ? false : isSSO
if (redirect) {
+ // 1. Generate a random token
+ const ssoToken = uuidv4()
+
// Send user data as part of the redirect URL (using query parameters)
- const dashboardUrl = `/sso-su... | packages/server/src/enterprise/middleware/passport/index.ts | 26 | TypeScript | 0.786 | suggestion | 104 | 51 | 51 | false | SSO token caching and retrieval in CachePool | 4,931 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | vinodkiran | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/middleware/passport/index.ts
PR Title: SSO token caching and retrieval in CachePool
BEFORE CODE: }
export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Request,
... | Remove commented out code. Dead code should be cleaned up to improve maintainability.
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Request,
redirect?: boolean,
isSSO?: boolean
) => {
const token = generateJwtAuthToken(user)
let refreshToken: string = ''
if (regenerateRefreshToken) {
refreshToken = generate... | Remove the comment '// implement this function' as the function is already implemented below in the same file.
```suggestion
storeSSOUserPayload(ssoToken, returnUser)
``` | } catch (error: any) {
return next ? next(error) : res.status(401).json(error)
}
})(req, res, next)
})
}
export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Request,
redirect?: boolean,
isSSO?: b... | @@ -291,8 +292,16 @@ export const setTokenOrCookies = (
returnUser.isSSO = !isSSO ? false : isSSO
if (redirect) {
+ // 1. Generate a random token
+ const ssoToken = uuidv4()
+
// Send user data as part of the redirect URL (using query parameters)
- const dashboardUrl = `/sso-su... | packages/server/src/enterprise/middleware/passport/index.ts | 26 | TypeScript | 0.786 | suggestion | 178 | 51 | 51 | false | SSO token caching and retrieval in CachePool | 4,931 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | vinodkiran | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/middleware/passport/index.ts
PR Title: SSO token caching and retrieval in CachePool
BEFORE CODE: export const setTokenOrCookies = (
res: Response,
user: any,
regenerateRefreshToken: boolean,
req?: Request,
... | Remove the comment '// implement this function' as the function is already implemented below in the same file.
```suggestion
storeSSOUserPayload(ssoToken, returnUser)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp'
const getAllPermissions = async (req: Request, res: Response, next: NextFunction) => {
try {
const appServer = getRunningExpressApp()
return res.json(appServer.identi... | Missing input validation for the SSO token parameter. The token should be validated for format and length before processing to prevent potential security issues.
```suggestion
const ssoToken = req.query.token as string
// Validate the SSO token
if (!isValidSSOToken(ssoToken)) {
... | import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp'
const getAllPermissions = async (req: Request, res: Response, next: NextFunction) => {
try {
const appServer = getRunningExpressApp()
return res.json(appServer.identi... | @@ -10,6 +10,20 @@ const getAllPermissions = async (req: Request, res: Response, next: NextFunction
}
}
+const ssoSuccess = async (req: Request, res: Response, next: NextFunction) => {
+ try {
+ const appServer = getRunningExpressApp()
+ const ssoToken = req.query.token as string | packages/server/src/enterprise/controllers/auth/index.ts | 16 | TypeScript | 1 | security | 425 | 30 | 29 | false | SSO token caching and retrieval in CachePool | 4,931 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | vinodkiran | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/controllers/auth/index.ts
PR Title: SSO token caching and retrieval in CachePool
BEFORE CODE: import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp... | Missing input validation for the SSO token parameter. The token should be validated for format and length before processing to prevent potential security issues.
```suggestion
const ssoToken = req.query.token as string
// Validate the SSO token
if (!isValidSSOToken(ssoToken)) {
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp'
const getAllPermissions = async (req: Request, res: Response, next: NextFunction) => {
try {
const appServer = getRunningExpressApp()
return res.json(appServer.identi... | After successfully retrieving user data with the SSO token, the token should be deleted from the cache to prevent reuse and improve security.
```suggestion
}
await appServer.cachePool.deleteSSOTokenCache(ssoToken)
``` | import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp'
const getAllPermissions = async (req: Request, res: Response, next: NextFunction) => {
try {
const appServer = getRunningExpressApp()
return res.json(appServer.identi... | @@ -10,6 +10,20 @@ const getAllPermissions = async (req: Request, res: Response, next: NextFunction
}
}
+const ssoSuccess = async (req: Request, res: Response, next: NextFunction) => {
+ try {
+ const appServer = getRunningExpressApp()
+ const ssoToken = req.query.token as string
+ const... | packages/server/src/enterprise/controllers/auth/index.ts | 20 | TypeScript | 1 | security | 233 | 30 | 29 | false | SSO token caching and retrieval in CachePool | 4,931 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | vinodkiran | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/controllers/auth/index.ts
PR Title: SSO token caching and retrieval in CachePool
BEFORE CODE: import { NextFunction, Request, Response } from 'express'
import { getRunningExpressApp } from '../../../utils/getRunningExpressApp... | After successfully retrieving user data with the SSO token, the token should be deleted from the cache to prevent reuse and improve security.
```suggestion
}
await appServer.cachePool.deleteSSOTokenCache(ssoToken)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const apiResponse = await chatflowsService.importChatflows(chatflows, orgId, workspaceId, subscriptionId)
return res.json(apiResponse)
} catch (error) {
next(error)
}
}
const updateChatflow = async (req: Request, res: Response, next: NextFunction) => {
try {
if (typeof req.p... | since its not being used anywhere else, can we remove that? | StatusCodes.NOT_FOUND,
`Error: chatflowsController.saveChatflow - workspace ${workspaceId} not found!`
)
}
const subscriptionId = req.user?.activeOrganizationSubscriptionId || ''
const body = req.body
const updateChatFlow = new ChatFlow()
... | @@ -223,17 +226,31 @@ const updateChatflow = async (req: Request, res: Response, next: NextFunction) =
}
const getSinglePublicChatflow = async (req: Request, res: Response, next: NextFunction) => {
+ let queryRunner: QueryRunner | undefined
try {
if (typeof req.params === 'undefined' || !req.params... | packages/server/src/controllers/chatflows/index.ts | 26 | TypeScript | 0.286 | question | 59 | 51 | 51 | false | Feature update public-chatflow access control | 4,978 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/controllers/chatflows/index.ts
PR Title: Feature update public-chatflow access control
BEFORE CODE: const apiResponse = await chatflowsService.importChatflows(chatflows, orgId, workspaceId, subscriptionId)
return res.jso... | since its not being used anywhere else, can we remove that? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
additionalParams: true
},
{
label: 'Wait for selector to load',
name: 'waitForSelector',
type: 'string',
optional: true,
additionalParams: true,
description: 'CSS selectors like .div o... | can get get rid of this, but instead use a process.env to allow user to specify if needed. For example: `process.env.PLAYWRIGHT_EXECUTABLE_FILE_PATH` | additionalParams: true
},
{
label: 'Wait for selector to load',
name: 'waitForSelector',
type: 'string',
optional: true,
additionalParams: true,
description: 'CSS selectors like .div o... | @@ -121,6 +129,14 @@ class Playwright_DocumentLoaders implements INode {
optional: true,
additionalParams: true
},
+ { | packages/components/nodes/documentloaders/Playwright/Playwright.ts | 26 | TypeScript | 0.571 | suggestion | 149 | 51 | 51 | false | Puppeteer / Playwright web crawler bug fixes/improvements | 4,998 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | Mewyii | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/documentloaders/Playwright/Playwright.ts
PR Title: Puppeteer / Playwright web crawler bug fixes/improvements
BEFORE CODE: additionalParams: true
},
{
label: 'Wait for selecto... | can get get rid of this, but instead use a process.env to allow user to specify if needed. For example: `process.env.PLAYWRIGHT_EXECUTABLE_FILE_PATH` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { INodeParams, INodeCredential } from '../src/Interface'
class TeradataBearerTokenCredential implements INodeCredential {
label: string
name: string
version: number
inputs: INodeParams[]
constructor() {
this.label = 'Teradata Bearer Token'
this.name = 'teradataBearerToken'
... | can we add description where to get the token?
```
this.description = 'Refer to <a target="_blank" href="https://docs.teradata.com">official guide</a> on how to get Teradata Bearer Token'
``` | import { INodeParams, INodeCredential } from '../src/Interface'
class TeradataBearerTokenCredential implements INodeCredential {
label: string
name: string
description: string
version: number
inputs: INodeParams[]
constructor() {
this.label = 'Teradata Bearer Token'
this.name =... | @@ -0,0 +1,23 @@
+import { INodeParams, INodeCredential } from '../src/Interface'
+
+class TeradataBearerTokenCredential implements INodeCredential {
+ label: string
+ name: string
+ version: number
+ inputs: INodeParams[]
+
+ constructor() {
+ this.label = 'Teradata Bearer Token'
+ this.na... | packages/components/credentials/TeradataBearerToken.credential.ts | 13 | TypeScript | 0.714 | question | 194 | 24 | 27 | false | Feature - add Teradata MCP server | 5,002 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | vilashjagani | Review this pull request change.
Language: TypeScript
File: packages/components/credentials/TeradataBearerToken.credential.ts
PR Title: Feature - add Teradata MCP server
BEFORE CODE: import { INodeParams, INodeCredential } from '../src/Interface'
class TeradataBearerTokenCredential implements INodeCredential {
... | can we add description where to get the token?
```
this.description = 'Refer to <a target="_blank" href="https://docs.teradata.com">official guide</a> on how to get Teradata Bearer Token'
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export enum UserPlan {
STARTER = 'STARTER',
PRO = 'PRO',
FREE = 'FREE'
}
/**
* Databases
*/
export interface IChatFlow {
id: string
name: string
flowData: string
updatedDate: Date
createdDate: Date
deployed?: boolean
isPublic?: boolean
apikeyid?: string
analytic?: str... | why to string not ChatflowType? |
export enum UserPlan {
STARTER = 'STARTER',
PRO = 'PRO',
FREE = 'FREE'
}
/**
* Databases
*/
export interface IChatFlow {
id: string
name: string
flowData: string
updatedDate: Date
createdDate: Date
deployed?: boolean
isPublic?: boolean
apikeyid?: string
analytic?: str... | @@ -68,7 +68,7 @@ export interface IChatFlow {
followUpPrompts?: string
apiConfig?: string
category?: string
- type?: ChatflowType
+ type?: string | packages/server/src/Interface.ts | 26 | TypeScript | 0.214 | question | 31 | 51 | 51 | false | Fix chatflow's type null or blank | 5,065 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/Interface.ts
PR Title: Fix chatflow's type null or blank
BEFORE CODE:
export enum UserPlan {
STARTER = 'STARTER',
PRO = 'PRO',
FREE = 'FREE'
}
/**
* Databases
*/
export interface IChatFlow {
id: string
name: stri... | why to string not ChatflowType? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return dbResponse
} catch (error) {
throw new InternalFlowiseError(
StatusCodes.INTERNAL_SERVER_ERROR,
`Error: chatflowsService.getChatflowById - ${getErrorMessage(error)}`
)
}
}
const saveChatflow = async (
newChatFlow: ChatFlow,
orgId: string,
works... | try catch block is not needed? | const getChatflowById = async (chatflowId: string): Promise<any> => {
try {
const appServer = getRunningExpressApp()
const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow).findOneBy({
id: chatflowId
})
if (!dbResponse) {
throw new InternalFlo... | @@ -254,57 +263,51 @@ const saveChatflow = async (
subscriptionId: string,
usageCacheManager: UsageCacheManager
): Promise<any> => {
- try {
- const appServer = getRunningExpressApp()
-
- let dbResponse: ChatFlow
- if (containsBase64File(newChatFlow)) {
- // we need a 2-ste... | packages/server/src/services/chatflows/index.ts | 26 | TypeScript | 0.071 | question | 30 | 51 | 51 | false | Fix chatflow's type null or blank | 5,065 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/services/chatflows/index.ts
PR Title: Fix chatflow's type null or blank
BEFORE CODE: return dbResponse
} catch (error) {
throw new InternalFlowiseError(
StatusCodes.INTERNAL_SERVER_ERROR,
`Err... | try catch block is not needed? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
public async addJob(jobData: any): Promise<Job> {
const jobId = jobData.id || uuidv4()
let removeOnFail: number | boolean | KeepJobs | undefined = true
let removeOnComplete: number | boolean | KeepJobs | undefined = undefined
// Only override removal options if age or count ... | Hey! Don't have the whole context, but consider replacing with `logger.debug`, so it will be hidden in prod (if minimum logging level is set to info there). But would be much easier to enable it back if need to debug some weird connectivity issue. | }
public async addJob(jobData: any): Promise<Job> {
const jobId = jobData.id || uuidv4()
let removeOnFail: number | boolean | KeepJobs | undefined = true
let removeOnComplete: number | boolean | KeepJobs | undefined = undefined
// Only override removal options if age or count ... | @@ -57,8 +57,6 @@ export abstract class BaseQueue {
}
public createWorker(concurrency: number = WORKER_CONCURRENCY): Worker {
- logger.info(`[BaseQueue] Creating worker for queue "${this.queue.name}" with concurrency: ${concurrency}`) | packages/server/src/queue/BaseQueue.ts | 26 | TypeScript | 0.786 | bug | 247 | 51 | 51 | false | Chore/remove redundant loggers | 5,067 | FlowiseAI/Flowise | 45,241 | TypeScript | anatolyburtsev | HenryHengZJ | Review this pull request change.
Language: TypeScript
File: packages/server/src/queue/BaseQueue.ts
PR Title: Chore/remove redundant loggers
BEFORE CODE: }
public async addJob(jobData: any): Promise<Job> {
const jobId = jobData.id || uuidv4()
let removeOnFail: number | boolean | KeepJobs | ... | Hey! Don't have the whole context, but consider replacing with `logger.debug`, so it will be hidden in prod (if minimum logging level is set to info there). But would be much easier to enable it back if need to debug some weird connectivity issue. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} catch (err) {
if (process.env.DEBUG === 'true') console.error(`Error setting up Arize tracer: ${err.message}`)
return undefined
}
}
interface PhoenixTracerOptions {
apiKey: string
baseUrl: string
projectName: string
sdkIntegration?: string
sessionId?: string
enableCall... | can you add a few tests for all of the following:
`http://localhost:6006`
`http://localhost:6006/v1/traces`
`https://app.phoenix.arize.com`
`https://app.phoenix.arize.com/v1/traces`
`https://app.phoenix.arize.com/s/my-space`
`https://app.phoenix.arize.com/s/my-space/v1/traces`
`https://my-phoenix.com/my-slug`
... | } catch (err) {
if (process.env.DEBUG === 'true') console.error(`Error setting up Arize tracer: ${err.message}`)
return undefined
}
}
interface PhoenixTracerOptions {
apiKey: string
baseUrl: string
projectName: string
sdkIntegration?: string
sessionId?: string
enableCall... | @@ -94,10 +95,14 @@ interface PhoenixTracerOptions {
function getPhoenixTracer(options: PhoenixTracerOptions): Tracer | undefined {
const SEMRESATTRS_PROJECT_NAME = 'openinference.project.name'
try {
+ const parsed = new URL(options.baseUrl)
+ const baseEndpoint = `${parsed.protocol}//${parsed.... | packages/components/src/handler.ts | 26 | TypeScript | 0.571 | suggestion | 363 | 51 | 51 | false | feat: Enable Tracing Support For Self-Hosted & Cloud Phoenix Instance | 5,114 | FlowiseAI/Flowise | 45,241 | TypeScript | mikeldking | ialisaleh | Review this pull request change.
Language: TypeScript
File: packages/components/src/handler.ts
PR Title: feat: Enable Tracing Support For Self-Hosted & Cloud Phoenix Instance
BEFORE CODE: } catch (err) {
if (process.env.DEBUG === 'true') console.error(`Error setting up Arize tracer: ${err.message}`)
... | can you add a few tests for all of the following:
`http://localhost:6006`
`http://localhost:6006/v1/traces`
`https://app.phoenix.arize.com`
`https://app.phoenix.arize.com/v1/traces`
`https://app.phoenix.arize.com/s/my-space`
`https://app.phoenix.arize.com/s/my-space/v1/traces`
`https://my-phoenix.com/my-slug`
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
serverAdapter
})
logger.info('✅ [Queue]: All queues setup successfully')
this.redisSubscriber = new RedisEventSubscriber(this.sseStreamer)
await this.redisSubscriber.connect()
logger.info('🔗 [server]: Redis event subsc... | The change mostly looks great. The trust proxy value isn't binary, though. It also supports more complex networking configurations:
https://expressjs.com/en/guide/behind-proxies.html
You could support the full range of values with this:
```
const trust_proxy: string = process.env.TRUST_PROXY || "true" // Defaul... | serverAdapter
})
logger.info('✅ [Queue]: All queues setup successfully')
this.redisSubscriber = new RedisEventSubscriber(this.sseStreamer)
await this.redisSubscriber.connect()
logger.info('🔗 [server]: Redis event subsc... | @@ -163,7 +163,8 @@ export class App {
this.app.use(express.urlencoded({ limit: flowise_file_size_limit, extended: true }))
// Enhanced trust proxy settings for load balancer
- this.app.set('trust proxy', true) // Trust all proxies
+ const trust_proxy: boolean = process.env.TRUST_PROXY... | packages/server/src/index.ts | 26 | TypeScript | 0.857 | suggestion | 509 | 51 | 51 | false | Add environment variable control for trust proxy setting | 5,226 | FlowiseAI/Flowise | 45,241 | TypeScript | hob | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/server/src/index.ts
PR Title: Add environment variable control for trust proxy setting
BEFORE CODE: serverAdapter
})
logger.info('✅ [Queue]: All queues setup successfully')
this.... | The change mostly looks great. The trust proxy value isn't binary, though. It also supports more complex networking configurations:
https://expressjs.com/en/guide/behind-proxies.html
You could support the full range of values with this:
```
const trust_proxy: string = process.env.TRUST_PROXY || "true" // Defaul... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { z } from 'zod'
/**
* This parser safely handles Zod schema strings without allowing arbitrary code execution
*/
export class SecureZodSchemaParser {
private static readonly ALLOWED_TYPES = [
'string',
'number',
'int',
'boolean',
'date',
'object',
'... | The parsing logic only handles integers but not floating-point numbers. Consider using parseFloat() or Number() to handle decimal values, or add a separate check for floating-point patterns like /^\d+\.\d+$/.
```suggestion
} else if (valueStr.match(/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/)) {
// Num... | const obj: any = {}
const content = objStr.slice(1, -1).trim() // Remove { }
if (!content) return obj
// Split by comma at depth 0
const props = this.splitProperties(content)
for (const prop of props) {
const colonIndex = prop.indexOf(':')
if (c... | @@ -329,6 +358,191 @@ export class SecureZodSchemaParser {
return items
}
+ private static extractArrayWithModifiers(typeStr: string): { arrayPart: string; modifiers: any[]; hasModifiers: boolean } {
+ // Find the matching closing parenthesis for z.array(
+ let depth = 0
+ let ar... | packages/components/src/secureZodParser.ts | 26 | TypeScript | 1 | suggestion | 405 | 434 | 51 | false | Add support for .default() on nested objects and arrays in SecureZodSchemaParser | 5,269 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/components/src/secureZodParser.ts
PR Title: Add support for .default() on nested objects and arrays in SecureZodSchemaParser
BEFORE CODE: import { z } from 'zod'
/**
* This parser safely handles Zod schema strings without allowing arbitrary code... | The parsing logic only handles integers but not floating-point numbers. Consider using parseFloat() or Number() to handle decimal values, or add a separate check for floating-point patterns like /^\d+\.\d+$/.
```suggestion
} else if (valueStr.match(/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/)) {
// Num... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export function expressRequestLogger(req: Request, res: Response, next: NextFunction): void {
const unwantedLogURLs = ['/api/v1/node-icon/', '/api/v1/components-credentials-icon/', '/api/v1/ping']
if (/\/api\/v1\//i.test(req.url) && !unwantedLogURLs.some((url) => new RegExp(url, 'i').test(req.url))) {
... | Even with redaction, logging HTTP request bodies, params and query strings is generally a bad idea because it significantly increases the risk of accidental exposure of sensitive data due to misconfigurations, broken redaction logic, or logs being improperly secured. It also creates a massive compliance burden under re... | export function expressRequestLogger(req: Request, res: Response, next: NextFunction): void {
const unwantedLogURLs = ['/api/v1/node-icon/', '/api/v1/components-credentials-icon/', '/api/v1/ping']
if (/\/api\/v1\//i.test(req.url) && !unwantedLogURLs.some((url) => new RegExp(url, 'i').test(req.url))) {
... | @@ -193,25 +193,63 @@ requestLogger = createLogger({
]
})
+function getSensitiveBodyFields(): string[] {
+ return (process.env.LOG_SANITIZE_BODY_FIELDS as string)
+ .toLowerCase()
+ .split(',')
+ .map((f) => f.trim())
+}
+
+function getSensitiveHeaderFields(): string[] {
+ return (pro... | packages/server/src/utils/logger.ts | 26 | TypeScript | 0.643 | bug | 630 | 51 | 51 | false | Sanitize sensitive fields in request header and body in logger | 5,279 | FlowiseAI/Flowise | 45,241 | TypeScript | hob | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/logger.ts
PR Title: Sanitize sensitive fields in request header and body in logger
BEFORE CODE: export function expressRequestLogger(req: Request, res: Response, next: NextFunction): void {
const unwantedLogURLs = ['/api/v1/no... | Even with redaction, logging HTTP request bodies, params and query strings is generally a bad idea because it significantly increases the risk of accidental exposure of sensitive data due to misconfigurations, broken redaction logic, or logs being improperly secured. It also creates a massive compliance burden under re... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419216034 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
if (!columnExists) q... | Missing `await` keyword before `queryRunner.query()`. This will cause the query to execute asynchronously without waiting for completion, potentially causing race conditions or migration failures.
```suggestion
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEX... | import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419216034 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
if (!columnExists) a... | @@ -0,0 +1,12 @@
+import { MigrationInterface, QueryRunner } from 'typeorm'
+
+export class AddTextToSpeechToChatFlow1759419216034 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
+ ... | packages/server/src/database/migrations/mysql/1759419216034-AddTextToSpeechToChatFlow.ts | 6 | TypeScript | 1 | bug | 328 | 13 | 13 | false | fix: migration errors for text to speech and chatflow name index | 5,287 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/database/migrations/mysql/1759419216034-AddTextToSpeechToChatFlow.ts
PR Title: fix: migration errors for text to speech and chatflow name index
BEFORE CODE: import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddText... | Missing `await` keyword before `queryRunner.query()`. This will cause the query to execute asynchronously without waiting for completion, potentially causing race conditions or migration failures.
```suggestion
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEX... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419231100 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
if (!columnExists) q... | Missing `await` keyword before `queryRunner.query()`. This will cause the query to execute asynchronously without waiting for completion, potentially causing race conditions or migration failures.
```suggestion
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEX... | import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419231100 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
if (!columnExists) a... | @@ -0,0 +1,12 @@
+import { MigrationInterface, QueryRunner } from 'typeorm'
+
+export class AddTextToSpeechToChatFlow1759419231100 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
+ ... | packages/server/src/database/migrations/mariadb/1759419231100-AddTextToSpeechToChatFlow.ts | 6 | TypeScript | 1 | bug | 328 | 13 | 13 | false | fix: migration errors for text to speech and chatflow name index | 5,287 | FlowiseAI/Flowise | 45,241 | TypeScript | Copilot | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/database/migrations/mariadb/1759419231100-AddTextToSpeechToChatFlow.ts
PR Title: fix: migration errors for text to speech and chatflow name index
BEFORE CODE: import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTe... | Missing `await` keyword before `queryRunner.query()`. This will cause the query to execute asynchronously without waiting for completion, potentially causing race conditions or migration failures.
```suggestion
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEX... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419136055 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const tableInfo = await queryRunner.query(`PRAGMA table_info("chat_flow");`)
const columnExists = ... | This migration **will partially work** with SQLite and TypeORM, but there are some caveats:
### The `up` Method
- **Adding a column:**
```typescript
await queryRunner.query(`ALTER TABLE "chat_flow" ADD COLUMN "textToSpeech" TEXT;`)
```
This works in SQLite. Adding a new column to an existing table i... | import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTextToSpeechToChatFlow1759419136055 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const tableInfo = await queryRunner.query(`PRAGMA table_info("chat_flow");`)
const columnExists = ... | @@ -0,0 +1,15 @@
+import { MigrationInterface, QueryRunner } from 'typeorm'
+
+export class AddTextToSpeechToChatFlow1759419136055 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ const tableInfo = await queryRunner.query(`PRAGMA table_info("chat_flow");`)
+ ... | packages/server/src/database/migrations/sqlite/1759419136055-AddTextToSpeechToChatFlow.ts | 12 | TypeScript | 1 | suggestion | 1,976 | 16 | 23 | false | fix: migration errors for text to speech and chatflow name index | 5,287 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/database/migrations/sqlite/1759419136055-AddTextToSpeechToChatFlow.ts
PR Title: fix: migration errors for text to speech and chatflow name index
BEFORE CODE: import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddTex... | This migration **will partially work** with SQLite and TypeORM, but there are some caveats:
### The `up` Method
- **Adding a column:**
```typescript
await queryRunner.query(`ALTER TABLE "chat_flow" ADD COLUMN "textToSpeech" TEXT;`)
```
This works in SQLite. Adding a new column to an existing table i... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { Request, Response, NextFunction } from 'express'
import sanitizeHtml from 'sanitize-html'
import { isPredictionRequest, extractChatflowId, validateChatflowDomain } from './domainValidation'
export function sanitizeMiddleware(req: Request, res: Response, next: NextFunction): void {
// decoding is necessary... | process.env.CORS_ORIGINS can be null/undefined if the environment variable is not set. | import { Request, Response, NextFunction } from 'express'
import sanitizeHtml from 'sanitize-html'
import { isPredictionRequest, extractChatflowId, validateChatflowDomain } from './domainValidation'
export function sanitizeMiddleware(req: Request, res: Response, next: NextFunction): void {
// decoding is necessary... | @@ -21,21 +22,64 @@ export function sanitizeMiddleware(req: Request, res: Response, next: NextFuncti
export function getAllowedCorsOrigins(): string {
// Expects FQDN separated by commas, otherwise nothing or * for all.
- return process.env.CORS_ORIGINS ?? '*'
+ // return process.env.CORS_ORIGINS ?? '*'
+... | packages/server/src/utils/XSS.ts | 26 | TypeScript | 0.357 | suggestion | 87 | 51 | 51 | false | Fix: CORS-related issues | 5,310 | FlowiseAI/Flowise | 45,241 | TypeScript | vasunous | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/XSS.ts
PR Title: Fix: CORS-related issues
BEFORE CODE: import { Request, Response, NextFunction } from 'express'
import sanitizeHtml from 'sanitize-html'
import { isPredictionRequest, extractChatflowId, validateChatflowDomain } fr... | process.env.CORS_ORIGINS can be null/undefined if the environment variable is not set. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import chatflowsService from '../services/chatflows'
import logger from './logger'
/**
* Validates if the origin is allowed for a specific chatflow
* @param chatflowId - The chatflow ID to validate against
* @param origin - The origin URL to validate
* @param workspaceId - Optional workspace ID for enterprise feat... | Do we need all the logs for production environment? | import { isValidUUID } from 'flowise-components'
import chatflowsService from '../services/chatflows'
import logger from './logger'
/**
* Validates if the origin is allowed for a specific chatflow
* @param chatflowId - The chatflow ID to validate against
* @param origin - The origin URL to validate
* @param worksp... | @@ -0,0 +1,103 @@
+import chatflowsService from '../services/chatflows'
+import logger from './logger'
+
+/**
+ * Validates if the origin is allowed for a specific chatflow
+ * @param chatflowId - The chatflow ID to validate against
+ * @param origin - The origin URL to validate
+ * @param workspaceId - Optional worksp... | packages/server/src/utils/domainValidation.ts | 17 | TypeScript | 0.214 | question | 51 | 42 | 42 | false | Fix: CORS-related issues | 5,310 | FlowiseAI/Flowise | 45,241 | TypeScript | vasunous | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/domainValidation.ts
PR Title: Fix: CORS-related issues
BEFORE CODE: import chatflowsService from '../services/chatflows'
import logger from './logger'
/**
* Validates if the origin is allowed for a specific chatflow
* @param ch... | Do we need all the logs for production environment? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
logger.warn(`Invalid domain format in allowedOrigins: ${domain}`)
return false
}
})
logger.info(`Domain validation for ${origin} against chatflow ${chatflowId}: ${isAllowed}`)
return isAllowed
} catch (error) {
logger.error(`Error validati... | This split logic may break in future if any additional query parameter or routing path format is changed. Make sure it is documented. | try {
const allowedOrigin = new URL(domain).host
return originHost === allowedOrigin
} catch (error) {
logger.warn(`Invalid domain format in allowedOrigins: ${domain}`)
return false
}
})
return isAllowed... | @@ -0,0 +1,103 @@
+import chatflowsService from '../services/chatflows'
+import logger from './logger'
+
+/**
+ * Validates if the origin is allowed for a specific chatflow
+ * @param chatflowId - The chatflow ID to validate against
+ * @param origin - The origin URL to validate
+ * @param workspaceId - Optional worksp... | packages/server/src/utils/domainValidation.ts | 26 | TypeScript | 0.429 | style | 134 | 51 | 51 | false | Fix: CORS-related issues | 5,310 | FlowiseAI/Flowise | 45,241 | TypeScript | vasunous | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/domainValidation.ts
PR Title: Fix: CORS-related issues
BEFORE CODE: logger.warn(`Invalid domain format in allowedOrigins: ${domain}`)
return false
}
})
logger.info(`Doma... | This split logic may break in future if any additional query parameter or routing path format is changed. Make sure it is documented. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
this.label = 'ChatCerebras'
this.name = 'chatCerebras'
this.version = 3.0
this.type = 'ChatCerebras'
this.icon = 'cerebras.png'
this.category = 'Chat Models'
this.description = 'Wrapper around Cerebras Inference API'
this.baseClasses = [this.type, ...getBa... | since Cerebras support many models, we prefer to make it a `type: string` so users can type in any name they want | constructor() {
this.label = 'ChatCerebras'
this.name = 'chatCerebras'
this.version = 3.0
this.type = 'ChatCerebras'
this.icon = 'cerebras.png'
this.category = 'Chat Models'
this.description = 'Wrapper around Cerebras Inference API'
this.baseClasses = ... | @@ -41,8 +41,35 @@ class ChatCerebras_ChatModels implements INode {
{
label: 'Model Name',
name: 'modelName',
- type: 'string',
- placeholder: 'llama3.1-8b'
+ type: 'options', | packages/components/nodes/chatmodels/ChatCerebras/ChatCerebras.ts | 26 | TypeScript | 0.714 | suggestion | 113 | 51 | 51 | false | feat: Enhance ChatCerebras integration (v3.0) | 5,508 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | sebastiand-cerebras | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatCerebras/ChatCerebras.ts
PR Title: feat: Enhance ChatCerebras integration (v3.0)
BEFORE CODE: this.label = 'ChatCerebras'
this.name = 'chatCerebras'
this.version = 3.0
this.type = 'Ch... | since Cerebras support many models, we prefer to make it a `type: string` so users can type in any name they want | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
type ExportData = {
AgentFlow: ChatFlow[]
AgentFlowV2: ChatFlow[]
AssistantCustom: Assistant[]
AssistantFlow: ChatFlow[]
AssistantOpenAI: Assistant[]
AssistantAzure: Assistant[]
ChatFlow: ChatFlow[]
ChatMessage: ChatMessage[]
ChatMessageFeedback: ChatMessageFeedback[]
CustomTe... | there is a method called `parseJsonBody` from `flowise-components` | }
type ExportData = {
AgentFlow: ChatFlow[]
AgentFlowV2: ChatFlow[]
AssistantCustom: Assistant[]
AssistantFlow: ChatFlow[]
AssistantOpenAI: Assistant[]
AssistantAzure: Assistant[]
ChatFlow: ChatFlow[]
ChatMessage: ChatMessage[]
ChatMessageFeedback: ChatMessageFeedback[]
CustomTe... | @@ -62,6 +63,22 @@ type ExportData = {
Variable: Variable[]
}
+/**
+ * Safely parses a JSON string, returning the original value if parsing fails
+ * @param value - The value to parse (can be string or any other type)
+ * @returns Parsed JSON object if value is a valid JSON string, otherwise returns the origina... | packages/server/src/services/export-import/index.ts | 26 | TypeScript | 0.357 | suggestion | 67 | 51 | 51 | false | Fix: Disclosures | 5,562 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/services/export-import/index.ts
PR Title: Fix: Disclosures
BEFORE CODE: }
type ExportData = {
AgentFlow: ChatFlow[]
AgentFlowV2: ChatFlow[]
AssistantCustom: Assistant[]
AssistantFlow: ChatFlow[]
AssistantOpenAI: Ass... | there is a method called `parseJsonBody` from `flowise-components` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { validateMimeTypeAndExtensionMatch } from './validator'
describe('validateMimeTypeAndExtensionMatch', () => {
describe('valid cases', () => {
it.each([
['document.txt', 'text/plain'],
['page.html', 'text/html'],
['data.json', 'application/json'],
['do... | ## Environment
OS: WIN
Node: v20.19.1
## Result
```
FAIL src/validator.test.ts (15.632 s)
validateMimeTypeAndExtensionMatch
valid cases
√ should pass validation for matching MIME type and extension - document.txt with text/plain (9 ms)
√ should pass validation for matching MIME type and ... | import { validateMimeTypeAndExtensionMatch } from './validator'
describe('validateMimeTypeAndExtensionMatch', () => {
describe('valid cases', () => {
it.each([
['document.txt', 'text/plain'],
['page.html', 'text/html'],
['data.json', 'application/json'],
['do... | packages/components/src/validator.test.ts | 1 | TypeScript | 1 | bug | 20,615 | 26 | 26 | false | Add MIME type and extension validation for file uploads | 5,596 | FlowiseAI/Flowise | 45,241 | TypeScript | yau-wd | jocelynlin-wd | Review this pull request change.
Language: TypeScript
File: packages/components/src/validator.test.ts
PR Title: Add MIME type and extension validation for file uploads
BEFORE CODE: import { validateMimeTypeAndExtensionMatch } from './validator'
describe('validateMimeTypeAndExtensionMatch', () => {
describe('va... | ## Environment
OS: WIN
Node: v20.19.1
## Result
```
FAIL src/validator.test.ts (15.632 s)
validateMimeTypeAndExtensionMatch
valid cases
√ should pass validation for matching MIME type and extension - document.txt with text/plain (9 ms)
√ should pass validation for matching MIME type and ... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import { Request } from 'express'
import * as path from 'path'
import { DataSource } from 'typeorm'
import { v4 as uuidv4 } from 'uuid'
import { omit, cloneDeep } from 'lodash'
import {
IFileUpload,
convertSpeechToText,
convertTextToSpeechStream,
ICommonObject,
addSingleFileToStorage,
generateFo... | ## Environment
Platform Type: Open Source
Node Version: v20.19.1
OS: Win
## UI Test
| Conversation Chain Upload |
| --- |
|<img width="2559" height="1271" alt="chat_file_upload" src="https://github.com/user-attachments/assets/302d05bf-f15a-482b-83f0-fa3e575ce9f2" /> | | import { Request } from 'express'
import * as path from 'path'
import { DataSource } from 'typeorm'
import { v4 as uuidv4 } from 'uuid'
import { omit, cloneDeep } from 'lodash'
import {
IFileUpload,
convertSpeechToText,
convertTextToSpeechStream,
ICommonObject,
addSingleFileToStorage,
generateFo... | packages/server/src/utils/buildChatflow.ts | 1 | TypeScript | 0.643 | suggestion | 279 | 26 | 26 | false | Add MIME type and extension validation for file uploads | 5,596 | FlowiseAI/Flowise | 45,241 | TypeScript | yau-wd | jocelynlin-wd | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/buildChatflow.ts
PR Title: Add MIME type and extension validation for file uploads
BEFORE CODE: import { Request } from 'express'
import * as path from 'path'
import { DataSource } from 'typeorm'
import { v4 as uuidv4 } from 'uuid... | ## Environment
Platform Type: Open Source
Node Version: v20.19.1
OS: Win
## UI Test
| Conversation Chain Upload |
| --- |
|<img width="2559" height="1271" alt="chat_file_upload" src="https://github.com/user-attachments/assets/302d05bf-f15a-482b-83f0-fa3e575ce9f2" /> | | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import { Request } from 'express'
import * as path from 'path'
import { cloneDeep, omit } from 'lodash'
import {
IMessage,
addArrayFilesToStorage,
mapMimeTypeToInputField,
mapExtToInputField,
getFileFromUpload,
removeSpecificFileFromUpload,
validateMimeTypeAndExtensionMatch
} from 'flowise-c... | ## Environment
Platform Type: Open Source
Node Version: v20.19.1
OS: Win
## UI Test
|Conversational Retrieval QA Chain| Document Store Upsert |
| --- | --- |
|<img width="2559" height="1266" alt="chatflow_upsert_1" src="https://github.com/user-attachments/assets/f56aebf4-fb25-4272-aedf-87991a8142ca" /> <img w... | import { Request } from 'express'
import * as path from 'path'
import { cloneDeep, omit } from 'lodash'
import {
IMessage,
addArrayFilesToStorage,
mapMimeTypeToInputField,
mapExtToInputField,
getFileFromUpload,
removeSpecificFileFromUpload
} from 'flowise-components'
import logger from '../utils... | packages/server/src/utils/upsertVector.ts | 1 | TypeScript | 0.643 | suggestion | 761 | 26 | 26 | false | Add MIME type and extension validation for file uploads | 5,596 | FlowiseAI/Flowise | 45,241 | TypeScript | yau-wd | jocelynlin-wd | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/upsertVector.ts
PR Title: Add MIME type and extension validation for file uploads
BEFORE CODE: import { Request } from 'express'
import * as path from 'path'
import { cloneDeep, omit } from 'lodash'
import {
IMessage,
addA... | ## Environment
Platform Type: Open Source
Node Version: v20.19.1
OS: Win
## UI Test
|Conversational Retrieval QA Chain| Document Store Upsert |
| --- | --- |
|<img width="2559" height="1266" alt="chatflow_upsert_1" src="https://github.com/user-attachments/assets/f56aebf4-fb25-4272-aedf-87991a8142ca" /> <img w... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
['data.json', 'application/json'],
['document.pdf', 'application/pdf'],
['script.js', 'text/javascript'],
['script.js', 'application/javascript'],
['readme.md', 'text/markdown'],
['readme.md', 'text/x-markdown'],
['DOCUMENT.TXT', 'text/... | nit: should it be `as string` instead of `as any`? | ['data.json', 'application/json'],
['document.pdf', 'application/pdf'],
['script.js', 'text/javascript'],
['script.js', 'application/javascript'],
['readme.md', 'text/markdown'],
['readme.md', 'text/x-markdown'],
['DOCUMENT.TXT', 'text/... | @@ -0,0 +1,114 @@
+import { validateMimeTypeAndExtensionMatch } from './validator'
+
+describe('validateMimeTypeAndExtensionMatch', () => {
+ describe('valid cases', () => {
+ it.each([
+ ['document.txt', 'text/plain'],
+ ['page.html', 'text/html'],
+ ['data.json', 'applicatio... | packages/components/src/validator.test.ts | 26 | TypeScript | 0.429 | question | 50 | 51 | 51 | false | Add MIME type and extension validation for file uploads | 5,596 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | jocelynlin-wd | Review this pull request change.
Language: TypeScript
File: packages/components/src/validator.test.ts
PR Title: Add MIME type and extension validation for file uploads
BEFORE CODE: ['data.json', 'application/json'],
['document.pdf', 'application/pdf'],
['script.js', 'text/javascr... | nit: should it be `as string` instead of `as any`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
validateFilename(filename)
if (!mimetype || typeof mimetype !== 'string') {
throw new Error('Invalid MIME type: MIME type is required and must be a string')
}
const normalizedExt = extractFileExtension(filename)
if (!normalizedExt) {
// Files without extensions are rejected for se... | I'm still learning through the `mapMimeTypeToExt` function. Should it support image or media types? Ignore this comment if it's not related to this PR. | * Validates that file extension matches the declared MIME type
*
* This function addresses CVE-2025-61687 by preventing MIME type spoofing attacks.
* It ensures that the file extension matches the declared MIME type, preventing
* attackers from uploading malicious files (e.g., .js file with text/plain MIME type).
... | @@ -69,3 +71,68 @@ export const isUnsafeFilePath = (filePath: string): boolean => {
return dangerousPatterns.some((pattern) => pattern.test(filePath))
}
+
+/**
+ * Validates filename format and security
+ * @param {string} filename The filename to validate
+ * @returns {void} Throws an error if validation fails... | packages/components/src/validator.ts | 26 | TypeScript | 0.714 | suggestion | 151 | 29 | 40 | false | Add MIME type and extension validation for file uploads | 5,596 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | jocelynlin-wd | Review this pull request change.
Language: TypeScript
File: packages/components/src/validator.ts
PR Title: Add MIME type and extension validation for file uploads
BEFORE CODE: validateFilename(filename)
if (!mimetype || typeof mimetype !== 'string') {
throw new Error('Invalid MIME type: MIME type i... | I'm still learning through the `mapMimeTypeToExt` function. Should it support image or media types? Ignore this comment if it's not related to this PR. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import crypto from 'crypto'
import { BaseChatModel } from '@langchain/core/language_models/chat_models'
import {
ICommonObject,
IDatabaseEntity,
IHumanInput,
IMessage,
INode,
INodeData,
INodeOptionsValue,
INodeParams,
IServerSideEventStreamer,
IUsedTool
} from '../../../src/Inter... | nit: `import { randomBytes } from 'crypto'` | import { BaseChatModel } from '@langchain/core/language_models/chat_models'
import {
ICommonObject,
IDatabaseEntity,
IHumanInput,
IMessage,
INode,
INodeData,
INodeOptionsValue,
INodeParams,
IServerSideEventStreamer,
IUsedTool
} from '../../../src/Interface'
import { AIMessageChun... | @@ -1,3 +1,4 @@
+import crypto from 'crypto' | packages/components/nodes/agentflow/Agent/Agent.ts | 1 | TypeScript | 0.214 | nitpick | 43 | 26 | 26 | false | fix: allow Unicode characters in document store tool names | 5,599 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | doubleclip118 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/agentflow/Agent/Agent.ts
PR Title: fix: allow Unicode characters in document store tool names
BEFORE CODE: import crypto from 'crypto'
import { BaseChatModel } from '@langchain/core/language_models/chat_models'
import {
ICommo... | nit: `import { randomBytes } from 'crypto'` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
interface ISimpliefiedTool {
name: string
description: string
schema: any
toolNode: {
label: string
name: string
}
}
/**
* Sanitizes a string to be used as a tool name.
* Restricts to ASCII characters [a-z0-9_-] for LLM API compatibility (OpenAI, Anthropic, Gemini).
* Non-ASCII ... | I noticed you already used `Math.random()` below. I think it should be enough for the random name.
```return `tool_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;```
This can avoid importing the crypto library just for generating a random name, since it doesn't require cryptographic security.
It seems th... |
interface ISimpliefiedTool {
name: string
description: string
schema: any
toolNode: {
label: string
name: string
}
}
/**
* Sanitizes a string to be used as a tool name.
* Restricts to ASCII characters [a-z0-9_-] for LLM API compatibility (OpenAI, Anthropic, Gemini).
* Non-ASCII ... | @@ -65,6 +66,27 @@ interface ISimpliefiedTool {
}
}
+/**
+ * Sanitizes a string to be used as a tool name.
+ * Restricts to ASCII characters [a-z0-9_-] for LLM API compatibility (OpenAI, Anthropic, Gemini).
+ * Non-ASCII titles (Korean, Chinese, Japanese, etc.) will use auto-generated fallback names.
+ * This p... | packages/components/nodes/agentflow/Agent/Agent.ts | 26 | TypeScript | 1 | security | 395 | 51 | 51 | false | fix: allow Unicode characters in document store tool names | 5,599 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | doubleclip118 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/agentflow/Agent/Agent.ts
PR Title: fix: allow Unicode characters in document store tool names
BEFORE CODE:
interface ISimpliefiedTool {
name: string
description: string
schema: any
toolNode: {
label: strin... | I noticed you already used `Math.random()` below. I think it should be enough for the random name.
```return `tool_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;```
This can avoid importing the crypto library just for generating a random name, since it doesn't require cryptographic security.
It seems th... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (inputParam.type === 'credential') {
updatedData.credential = newValue
updatedData.inputs = { ...updatedData.inputs, [FLOWISE_CREDENTIAL_ID]: newValue }
} else {
updatedData.inputs = { ...updatedData.inputs, [inputParam.name]: newValue }
... | Use JSDoc format
```suggestion
/**
* Check Mandatory Fields
* @returns { isValid: boolean, missingFields: string[] }
*/
``` | if (inputParam.type === 'credential') {
updatedData.credential = newValue
updatedData.inputs = { ...updatedData.inputs, [FLOWISE_CREDENTIAL_ID]: newValue }
} else {
updatedData.inputs = { ...updatedData.inputs, [inputParam.name]: newValue }
... | @@ -58,12 +58,75 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
const handleChatModelDataChange = ({ inputParam, newValue }) => {
setSelectedChatModel((prevData) => {
const updatedData = { ...prevData }
- updatedData.inputs[inputParam.name] = ne... | packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx | 26 | JavaScript | 0.786 | suggestion | 142 | 51 | 51 | false | Add validation for Agentflow generation | 5,607 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | VanRitzOwen | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx
PR Title: Add validation for Agentflow generation
BEFORE CODE: if (inputParam.type === 'credential') {
updatedData.credential = newValue
updatedDat... | Use JSDoc format
```suggestion
/**
* Check Mandatory Fields
* @returns { isValid: boolean, missingFields: string[] }
*/
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const getChatModelsApi = useApi(assistantsApi.getChatModels)
const { reactFlowInstance } = useContext(flowContext)
const theme = useTheme()
// ==============================|| Snackbar ||============================== //
const dispatch = useDispatch()
useNotifier()
const enqueueSnackbar = ... | Use JSDoc format
```suggestion
/**
* Check if all mandatory fields are filled for the selected chat model.
*
* @param value
* @returns {boolean}
*/
``` |
const getChatModelsApi = useApi(assistantsApi.getChatModels)
const { reactFlowInstance } = useContext(flowContext)
const theme = useTheme()
// ==============================|| Snackbar ||============================== //
const dispatch = useDispatch()
useNotifier()
const enqueueSnackbar = ... | @@ -58,12 +58,75 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
const handleChatModelDataChange = ({ inputParam, newValue }) => {
setSelectedChatModel((prevData) => {
const updatedData = { ...prevData }
- updatedData.inputs[inputParam.name] = ne... | packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx | 26 | JavaScript | 0.786 | suggestion | 181 | 51 | 51 | false | Add validation for Agentflow generation | 5,607 | FlowiseAI/Flowise | 45,241 | TypeScript | tianwei-liu | VanRitzOwen | Review this pull request change.
Language: JavaScript
File: packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx
PR Title: Add validation for Agentflow generation
BEFORE CODE:
const getChatModelsApi = useApi(assistantsApi.getChatModels)
const { reactFlowInstance } = useContext(flowContext)
... | Use JSDoc format
```suggestion
/**
* Check if all mandatory fields are filled for the selected chat model.
*
* @param value
* @returns {boolean}
*/
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Handle method changes for redirects according to HTTP specs
if (response.status === 301 || response.status === 302 || response.status === 303) {
// For 303, or when redirecting POST/PUT/PATCH requests, change to GET
if (response.status === 303 || (currentInit.method && ['POST... | By forcing every users to specify `HTTP_DENY_LIST`, its not user/begineer friendly.
The decision we took is to allow users to have the option to specify if needed, otherwise its not blocking by default. Its not secured by default. We have also documented [here](https://docs.flowiseai.com/configuration/environment-vari... |
// Handle method changes for redirects according to HTTP specs
if (response.status === 301 || response.status === 302 || response.status === 303) {
// For 303, or when redirecting POST/PUT/PATCH requests, change to GET
if (response.status === 303 || (currentInit.method && ['POST... | @@ -219,3 +177,55 @@ export async function secureFetch(url: string, init?: RequestInit, maxRedirects:
throw new Error('Too many redirects')
}
+
+type ResolvedTarget = {
+ hostname: string
+ ip: string
+ family: 4 | 6
+ protocol: 'http' | 'https'
+}
+
+async function resolveAndValidate(url: string): ... | packages/components/src/httpSecurity.ts | 26 | TypeScript | 0.643 | suggestion | 359 | 51 | 51 | false | Fix: Fix DNS Rebinding/TOCTOU Vulernability | 5,653 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | christopherholland-workday | Review this pull request change.
Language: TypeScript
File: packages/components/src/httpSecurity.ts
PR Title: Fix: Fix DNS Rebinding/TOCTOU Vulernability
BEFORE CODE:
// Handle method changes for redirects according to HTTP specs
if (response.status === 301 || response.status === 302 || response.st... | By forcing every users to specify `HTTP_DENY_LIST`, its not user/begineer friendly.
The decision we took is to allow users to have the option to specify if needed, otherwise its not blocking by default. Its not secured by default. We have also documented [here](https://docs.flowiseai.com/configuration/environment-vari... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { NextFunction, Request, Response } from 'express'
import { StatusCodes } from 'http-status-codes'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
import { Platform } from '../../Interface'
import { GeneralErrorMessage } from '../../utils/constants'
import { getRunningExpressApp } from '... | nit: duplicated code that could be extracted and re-used | import { NextFunction, Request, Response } from 'express'
import { StatusCodes } from 'http-status-codes'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
import { Platform } from '../../Interface'
import { GeneralErrorMessage } from '../../utils/constants'
import { getRunningExpressApp } from '... | @@ -16,6 +16,12 @@ import { decrypt } from '../utils/encryption.util'
export class LoginMethodController {
public async create(req: Request, res: Response, next: NextFunction) {
try {
+ if (
+ getRunningExpressApp().identityManager.getPlatformType() === Platform.CLOUD ||
+ ... | packages/server/src/enterprise/controllers/login-method.controller.ts | 24 | TypeScript | 0.286 | refactor | 56 | 49 | 49 | false | fix: update loginmethod endpoints | 5,681 | FlowiseAI/Flowise | 45,241 | TypeScript | christopherholland-workday | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/controllers/login-method.controller.ts
PR Title: fix: update loginmethod endpoints
BEFORE CODE: import { NextFunction, Request, Response } from 'express'
import { StatusCodes } from 'http-status-codes'
import { InternalFlowis... | nit: duplicated code that could be extracted and re-used | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { DataSource, QueryRunner } from 'typeorm'
import { getRunningExpressApp } from '../../utils/getRunningExpressApp'
import { isInvalidName, isInvalidUUID } from '../utils/validation.util'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
import { StatusCodes } from 'http-status-codes'
impor... | nit: we can remove these if they are not used, right? | import { DataSource, QueryRunner } from 'typeorm'
import { getRunningExpressApp } from '../../utils/getRunningExpressApp'
import { isInvalidName, isInvalidUUID } from '../utils/validation.util'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
import { StatusCodes } from 'http-status-codes'
impor... | @@ -8,6 +8,8 @@ import { decrypt, encrypt } from '../utils/encryption.util'
import { UserErrorMessage, UserService } from './user.service'
import { OrganizationErrorMessage, OrganizationService } from './organization.service'
import { IsNull } from 'typeorm'
+import { Platform } from '../../Interface'
+import { Gene... | packages/server/src/enterprise/services/login-method.service.ts | 12 | TypeScript | 0.286 | question | 53 | 37 | 37 | false | fix: update loginmethod endpoints | 5,681 | FlowiseAI/Flowise | 45,241 | TypeScript | christopherholland-workday | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/services/login-method.service.ts
PR Title: fix: update loginmethod endpoints
BEFORE CODE: import { DataSource, QueryRunner } from 'typeorm'
import { getRunningExpressApp } from '../../utils/getRunningExpressApp'
import { isIn... | nit: we can remove these if they are not used, right? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { getOrCreateStoredSecret } from '../../utils'
/**
* Weak default values that were previously hardcoded when env vars were not set.
* If the user has set a var to one of these, we treat it as "not set" and use file/AWS storage instead.
*/
const WEAK_DEFAULTS: Record<string, string> = {
JWT_AUTH_TOKEN_SEC... | Is there a reason we’re not including `EXPRESS_SESSION_SECRET` and `TOKEN_HASH_SECRET` in this configuration?
```ts
EXPRESS_SESSION_SECRET: 'flowise'
TOKEN_HASH_SECRET: 'popcorn'
```
| import { getOrCreateStoredSecret } from '../../utils'
/**
* Weak default values that were previously hardcoded when env vars were not set.
* If the user has set a var to one of these, we treat it as "not set" and use file/AWS storage instead.
*/
const WEAK_DEFAULTS: Record<string, string> = {
JWT_AUTH_TOKEN_SEC... | @@ -0,0 +1,96 @@
+import { getOrCreateStoredSecret } from '../../utils'
+
+/**
+ * Weak default values that were previously hardcoded when env vars were not set.
+ * If the user has set a var to one of these, we treat it as "not set" and use file/AWS storage instead.
+ */
+const WEAK_DEFAULTS: Record<string, string> = ... | packages/server/src/enterprise/utils/authSecrets.ts | 9 | TypeScript | 0.714 | security | 191 | 34 | 34 | false | Updates to environment and initialization logic | 5,683 | FlowiseAI/Flowise | 45,241 | TypeScript | yau-wd | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/utils/authSecrets.ts
PR Title: Updates to environment and initialization logic
BEFORE CODE: import { getOrCreateStoredSecret } from '../../utils'
/**
* Weak default values that were previously hardcoded when env vars were n... | Is there a reason we’re not including `EXPRESS_SESSION_SECRET` and `TOKEN_HASH_SECRET` in this configuration?
```ts
EXPRESS_SESSION_SECRET: 'flowise'
TOKEN_HASH_SECRET: 'popcorn'
```
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let jwtIssuer: string | undefined
let jwtAudience: string | undefined
const NOT_INITIALIZED = 'Auth secrets not initialized. Call initAuthSecrets() first.'
/**
* Initialize auth secrets from env (backwards compat) → AWS Secrets Manager → filesystem.
* Each secret is generated with crypto.randomBytes(32) when create... | Is there a reason we’re not including `weakDefault` in `getOrCreateStoredSecret` and `getOrCreateStoredSecret` functions? | let jwtAuthTokenSecret: string | undefined
let jwtRefreshTokenSecret: string | undefined
let jwtIssuer: string | undefined
let jwtAudience: string | undefined
const NOT_INITIALIZED = 'Auth secrets not initialized. Call initAuthSecrets() first.'
/**
* Initialize auth secrets from env (backwards compat) → AWS Secrets ... | @@ -0,0 +1,96 @@
+import { getOrCreateStoredSecret } from '../../utils'
+
+/**
+ * Weak default values that were previously hardcoded when env vars were not set.
+ * If the user has set a var to one of these, we treat it as "not set" and use file/AWS storage instead.
+ */
+const WEAK_DEFAULTS: Record<string, string> = ... | packages/server/src/enterprise/utils/authSecrets.ts | 26 | TypeScript | 0.5 | security | 121 | 51 | 51 | false | Updates to environment and initialization logic | 5,683 | FlowiseAI/Flowise | 45,241 | TypeScript | yau-wd | 0xi4o | Review this pull request change.
Language: TypeScript
File: packages/server/src/enterprise/utils/authSecrets.ts
PR Title: Updates to environment and initialization logic
BEFORE CODE: let jwtIssuer: string | undefined
let jwtAudience: string | undefined
const NOT_INITIALIZED = 'Auth secrets not initialized. Call in... | Is there a reason we’re not including `weakDefault` in `getOrCreateStoredSecret` and `getOrCreateStoredSecret` functions? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow).findOneBy({
id: chatflowId
})
if (!dbResponse) {
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Chatflow ${chatflowId} not found`)
}
const uploadsConfig = await utilGetUploads... | We cannot remove `flowData`, this is being used by [FlowiseChatEmbed](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/src/components/Bot.tsx#L1369) to retrieve the data.
`flowData` does not contains any sensitive data like apikeys, only credential ID. | const appServer = getRunningExpressApp()
const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow).findOneBy({
id: chatflowId
})
if (!dbResponse) {
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Chatflow ${chatflowId} not found`)
}
... | @@ -388,7 +388,7 @@ const getSinglePublicChatbotConfig = async (chatflowId: string): Promise<any> =>
}
delete parsedConfig.allowedOrigins
delete parsedConfig.allowedOriginsError
- return { ...parsedConfig, uploads: uploadsConfig, flowData: dbResponse.flo... | packages/server/src/services/chatflows/index.ts | 26 | TypeScript | 0.643 | security | 263 | 51 | 51 | false | Remove flowData from getSinglePublicChatbotConfig response | 5,751 | FlowiseAI/Flowise | 45,241 | TypeScript | HenryHengZJ | christopherholland-workday | Review this pull request change.
Language: TypeScript
File: packages/server/src/services/chatflows/index.ts
PR Title: Remove flowData from getSinglePublicChatbotConfig response
BEFORE CODE: const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow).findOneBy({
id: chatflowId
... | We cannot remove `flowData`, this is being used by [FlowiseChatEmbed](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/src/components/Bot.tsx#L1369) to retrieve the data.
`flowData` does not contains any sensitive data like apikeys, only credential ID. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { useCallback } from 'react'
import type { NodeData } from '../../../core/types'
import { useAgentflowContext } from '../../../infrastructure/store'
import { useFlowNodes } from './useFlowNodes'
/**
* Hook to open the node editor dialog
* Handles fetching node data and schema, then opens the edit dialog
*/... | nit, do you mind using `@/` alias instead? | import { useCallback } from 'react'
import type { NodeData } from '@/core/types'
import { useAgentflowContext } from '@/infrastructure/store'
import { useFlowNodes } from './useFlowNodes'
/**
* Hook to open the node editor dialog
* Handles fetching node data and schema, then opens the edit dialog
*/
export functi... | @@ -0,0 +1,42 @@
+import { useCallback } from 'react'
+
+import type { NodeData } from '../../../core/types'
+import { useAgentflowContext } from '../../../infrastructure/store' | packages/agentflow/src/features/canvas/hooks/useOpenNodeEditor.ts | 4 | TypeScript | 0.286 | question | 43 | 29 | 29 | false | feat(agentflow): wire functionality to edit nodes | 5,786 | FlowiseAI/Flowise | 45,241 | TypeScript | jocelynlin-wd | j-sanaa | Review this pull request change.
Language: TypeScript
File: packages/agentflow/src/features/canvas/hooks/useOpenNodeEditor.ts
PR Title: feat(agentflow): wire functionality to edit nodes
BEFORE CODE: import { useCallback } from 'react'
import type { NodeData } from '../../../core/types'
import { useAgentflowContext... | nit, do you mind using `@/` alias instead? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { getBaseClasses } from '../../../src/utils'
class RetrievalQAChain_Chains implements INode {
label: string
name: string
type: string
icon: string
category: string
baseClasses: string[]
description: string
inputs: INodeParams[]
constructor() {
this.label = 'Retrieval... | No issues found. | import { getBaseClasses } from '../../../src/utils'
class RetrievalQAChain_Chains implements INode {
label: string
name: string
type: string
icon: string
category: string
baseClasses: string[]
description: string
inputs: INodeParams[]
constructor() {
this.label = 'Retrieval... | @@ -15,7 +15,7 @@ class RetrievalQAChain_Chains implements INode {
inputs: INodeParams[]
constructor() {
- this.label = 'RetrievalQA Chain'
+ this.label = 'Retrieval QA Chain'
this.name = 'retrievalQAChain'
this.type = 'RetrievalQAChain'
this.icon = 'chain.svg' | packages/components/nodes/chains/RetrievalQAChain/RetrievalQAChain.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Feature/azure | 92 | FlowiseAI/Flowise | 45,241 | TypeScript | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chains/RetrievalQAChain/RetrievalQAChain.ts
PR Title: Feature/azure
BEFORE CODE: import { getBaseClasses } from '../../../src/utils'
class RetrievalQAChain_Chains implements INode {
label: string
name: string
type: st... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (isAcceptVariable) {
const variablePaths = Object.keys(variableDict)
variablePaths.sort() // Sort by length of variable path because longer path could possibly contains nested variable
variablePaths.forEach((path) => {
const variableValue = variableDict[path]
// R... | No issues found. |
if (isAcceptVariable) {
const variablePaths = Object.keys(variableDict)
variablePaths.sort() // Sort by length of variable path because longer path could possibly contains nested variable
variablePaths.forEach((path) => {
const variableValue = variableDict[path]
// R... | @@ -182,6 +182,7 @@ export const buildLangchain = async (
depthQueue: IDepthQueue,
componentNodes: IComponentNodes,
question: string,
+ chatId: string,
overrideConfig?: ICommonObject
) => {
const flowNodes = cloneDeep(reactFlowNodes)
@@ -214,7 +215,7 @@ export const buildLangchain = async (... | packages/server/src/utils/index.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | feature/SupportZepMemoryAndAutoSummary | 284 | FlowiseAI/Flowise | 45,241 | TypeScript | wangerzi | Review this pull request change.
Language: TypeScript
File: packages/server/src/utils/index.ts
PR Title: feature/SupportZepMemoryAndAutoSummary
BEFORE CODE:
if (isAcceptVariable) {
const variablePaths = Object.keys(variableDict)
variablePaths.sort() // Sort by length of variable path because lo... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import { INodeParams, INodeCredential } from '../src/Interface'
class ApifyApiCredential implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'Apify API'
this.name = 'apifyApi'
thi... | No issues found. | import { INodeParams, INodeCredential } from '../src/Interface'
class ApifyApiCredential implements INodeCredential {
label: string
name: string
version: number
description: string
inputs: INodeParams[]
constructor() {
this.label = 'Apify API'
this.name = 'apifyApi'
thi... | @@ -0,0 +1,26 @@
+import { INodeParams, INodeCredential } from '../src/Interface'
+
+class ApifyApiCredential implements INodeCredential {
+ label: string
+ name: string
+ version: number
+ description: string
+ inputs: INodeParams[]
+
+ constructor() {
+ this.label = 'Apify API'
+ this.... | packages/components/credentials/ApifyApi.credential.ts | 0 | TypeScript | 1 | none | 16 | 27 | 27 | true | feat: Add document loader for Apify Website Content Crawler | 399 | FlowiseAI/Flowise | 45,241 | TypeScript | drobnikj | Review this pull request change.
Language: TypeScript
File: packages/components/credentials/ApifyApi.credential.ts
PR Title: feat: Add document loader for Apify Website Content Crawler
BEFORE CODE: import { INodeParams, INodeCredential } from '../src/Interface'
class ApifyApiCredential implements INodeCredential {... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
placeholder: 'http://localhost:6333'
},
{
label: 'Qdrant Collection Name',
name: 'qdrantCollection',
type: 'string'
},
{
label: 'Qdrant API Key',
name: 'qdrantApiKey',
... | No issues found. | placeholder: 'http://localhost:6333'
},
{
label: 'Qdrant Collection Name',
name: 'qdrantCollection',
type: 'string'
},
{
label: 'Qdrant API Key',
name: 'qdrantApiKey',
... | @@ -0,0 +1,120 @@
+import { INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
+import { QdrantClient } from '@qdrant/js-client-rest'
+import { QdrantVectorStore, QdrantLibArgs } from 'langchain/vectorstores/qdrant'
+import { Embeddings } from 'langchain/embeddings/base'
+import { getBaseC... | packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Feature/Qdrant vector store integration | 409 | FlowiseAI/Flowise | 45,241 | TypeScript | govind-kumarr | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts
PR Title: Feature/Qdrant vector store integration
BEFORE CODE: placeholder: 'http://localhost:6333'
},
{
label: 'Qdrant Collec... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
name: 'claude-v1-100k'
},
{
label: 'claude-v1.0',
name: 'claude-v1.0'
},
{
label: 'claude-v1.2',
name: 'claude-v1.2'
... | No issues found. | name: 'claude-v1-100k'
},
{
label: 'claude-v1.0',
name: 'claude-v1.0'
},
{
label: 'claude-v1.2',
name: 'claude-v1.2'
... | @@ -137,8 +137,8 @@ class ChatAnthropic_ChatModels implements INode {
}
if (maxTokensToSample) obj.maxTokensToSample = parseInt(maxTokensToSample, 10)
- if (topP) obj.topP = parseInt(topP, 10)
- if (topK) obj.topK = parseInt(topK, 10)
+ if (topP) obj.topP = parseFloat(topP)
+ ... | packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | bugfix/OpenAITopP | 617 | FlowiseAI/Flowise | 45,241 | TypeScript | chungyau97 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts
PR Title: bugfix/OpenAITopP
BEFORE CODE: name: 'claude-v1-100k'
},
{
label: 'claude-v1.0',
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
this.inputs = [
{
label: 'Vectara Metadata Filter',
name: 'filter',
type: 'json',
additionalParams: true,
optional: true
},
{
label: 'Lambda',
name: 'lamb... | No issues found. | }
this.inputs = [
{
label: 'Vectara Metadata Filter',
name: 'filter',
type: 'json',
additionalParams: true,
optional: true
},
{
label: 'Lambda',
name: 'lamb... | @@ -0,0 +1,111 @@
+import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
+import { VectaraStore, VectaraLibArgs, VectaraFilter } from 'langchain/vectorstores/vectara'
+
+class V... | packages/components/nodes/vectorstores/Vectara_Existing/Vectara_Existing.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Feature/Add Vectara Vector Store | 645 | FlowiseAI/Flowise | 45,241 | TypeScript | 3eif | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Vectara_Existing/Vectara_Existing.ts
PR Title: Feature/Add Vectara Vector Store
BEFORE CODE: }
this.inputs = [
{
label: 'Vectara Metadata Filter',
name: 'fil... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { GoogleCustomSearch } from 'langchain/tools'
class GoogleCustomSearchAPI_Tools implements INode {
label: string
name: string
... | No issues found. | import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { GoogleCustomSearch } from 'langchain/tools'
class GoogleCustomSearchAPI_Tools implements INode {
label: string
name: string
... | @@ -0,0 +1,43 @@
+import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
+import { GoogleCustomSearch } from 'langchain/tools'
+
+class GoogleCustomSearchAPI_Tools implements INode {
+ label: st... | packages/components/nodes/tools/GoogleSearchAPI/GoogleSearchAPI.ts | 0 | TypeScript | 1 | none | 16 | 44 | 44 | true | Feature/google custom search | 646 | FlowiseAI/Flowise | 45,241 | TypeScript | denchi | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/tools/GoogleSearchAPI/GoogleSearchAPI.ts
PR Title: Feature/google custom search
BEFORE CODE: import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCred... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
label: 'Model Name',
name: 'modelName',
type: 'options',
options: [
{
label: 'text-bison',
name: 'text-bison'
},
{
label: 'c... | No issues found. | label: 'Model Name',
name: 'modelName',
type: 'options',
options: [
{
label: 'text-bison',
name: 'text-bison'
},
{
label: 'c... | @@ -0,0 +1,117 @@
+import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
+import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
+import { GoogleVertexAI, GoogleVertexAITextInput } from 'langchain/llms/googlevertexai'
+import { GoogleAuthOptions } from... | packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Feature/add vertex ai | 713 | FlowiseAI/Flowise | 45,241 | TypeScript | Yongtae723 | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts
PR Title: Feature/add vertex ai
BEFORE CODE: label: 'Model Name',
name: 'modelName',
type: 'options',
options: [
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
name: 'document',
type: 'Document',
list: true
},
{
label: 'Vectara Metadata Filter',
name: 'filter',
description:
'Filter to apply to Vectara metadata. Refer to the <a target="_bl... | No issues found. | name: 'document',
type: 'Document',
list: true
},
{
label: 'Vectara Metadata Filter',
name: 'filter',
description:
'Filter to apply to Vectara metadata. Refer to the <a target="_bl... | @@ -41,9 +41,11 @@ class VectaraExisting_VectorStores implements INode {
list: true
},
{
- label: 'Filter',
+ label: 'Vectara Metadata Filter',
name: 'filter',
- type: 'json',
+ description:
+ ... | packages/components/nodes/vectorstores/Vectara_Upsert/Vectara_Upsert.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Fix Vectara filter | 762 | FlowiseAI/Flowise | 45,241 | TypeScript | 3eif | Review this pull request change.
Language: TypeScript
File: packages/components/nodes/vectorstores/Vectara_Upsert/Vectara_Upsert.ts
PR Title: Fix Vectara filter
BEFORE CODE: name: 'document',
type: 'Document',
list: true
},
{
la... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.