diff --git a/.github/workflows/autoSyncMergedPullRequest.yml b/.github/workflows/autoSyncMergedPullRequest.yml index 288d09717..518db0bc6 100644 --- a/.github/workflows/autoSyncMergedPullRequest.yml +++ b/.github/workflows/autoSyncMergedPullRequest.yml @@ -23,4 +23,11 @@ jobs: token: ${{ secrets.AUTOSYNC_TOKEN }} repository: ${{ secrets.AUTOSYNC_CH_URL }} event-type: ${{ secrets.AUTOSYNC_PR_EVENT_TYPE }} - client-payload: '{"ref": "${{ github.ref }}", "prNumber": "${{ github.event.pull_request.number }}", "sha": "${{ github.sha }}"}' + client-payload: >- + { + "ref": "${{ github.ref }}", + "prNumber": "${{ github.event.pull_request.number }}", + "prTitle": "${{ github.event.pull_request.title }}", + "prDescription": "${{ github.event.pull_request.description }}", + "sha": "${{ github.sha }}" + } diff --git a/.github/workflows/autoSyncSingleCommit.yml b/.github/workflows/autoSyncSingleCommit.yml index ce429a606..8700f2321 100644 --- a/.github/workflows/autoSyncSingleCommit.yml +++ b/.github/workflows/autoSyncSingleCommit.yml @@ -28,4 +28,9 @@ jobs: token: ${{ secrets.AUTOSYNC_TOKEN }} repository: ${{ secrets.AUTOSYNC_CH_URL }} event-type: ${{ secrets.AUTOSYNC_SC_EVENT_TYPE }} - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + client-payload: >- + { + "ref": "${{ github.ref }}", + "sha": "${{ github.sha }}", + "commitMessage": "${{ github.event.commits[0].message }}" + } diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 3c5766fdf..b11653ee2 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1825,8 +1825,10 @@ export class App { flowGraph: getTelemetryFlowObj(nodes, edges) }) - // Only return ChatId when its Internal OR incoming input has ChatId, to avoid confusion when calling API - if (incomingInput.chatId || isInternal) result.chatId = chatId + // Prepare response + result.chatId = chatId + if (sessionId) result.sessionId = sessionId + if (memoryType) result.memoryType = memoryType return res.json(result) } catch (e: any) { diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index a232094e7..aa3e9ef64 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -1099,6 +1099,7 @@ export const getTelemetryFlowObj = (nodes: IReactFlowNode[], edges: IReactFlowEd * TODO: move env variables to settings json file, easier configuration */ export const getUserSettingsFilePath = () => { + if (process.env.SECRETKEY_PATH) return path.join(process.env.SECRETKEY_PATH, 'settings.json') const checkPaths = [path.join(getUserHome(), '.flowise', 'settings.json')] for (const checkPath of checkPaths) { if (fs.existsSync(checkPath)) { diff --git a/packages/server/src/utils/telemetry.ts b/packages/server/src/utils/telemetry.ts index 4254ea766..4b033f209 100644 --- a/packages/server/src/utils/telemetry.ts +++ b/packages/server/src/utils/telemetry.ts @@ -25,7 +25,9 @@ export class Telemetry { const settings = { instanceId } - const defaultLocation = path.join(getUserHome(), '.flowise', 'settings.json') + const defaultLocation = process.env.SECRETKEY_PATH + ? path.join(process.env.SECRETKEY_PATH, 'settings.json') + : path.join(getUserHome(), '.flowise', 'settings.json') await fs.promises.writeFile(defaultLocation, JSON.stringify(settings, null, 2)) return instanceId }