mirror of https://github.com/buster-so/buster.git
greptile fixes
This commit is contained in:
parent
fa53ae1111
commit
0c2e3e2e95
|
@ -22,6 +22,7 @@
|
|||
"@buster/server-shared": "workspace:*",
|
||||
"@buster/ai": "workspace:*",
|
||||
"@buster/database": "workspace:*",
|
||||
"@buster/slack": "workspace:*",
|
||||
"@buster/test-utils": "workspace:*",
|
||||
"@buster/typescript-config": "workspace:*",
|
||||
"@buster/vitest-config": "workspace:*",
|
||||
|
|
|
@ -9,6 +9,7 @@ import {
|
|||
slackIntegrations,
|
||||
slackMessageTracking,
|
||||
} from '@buster/database';
|
||||
import { SlackMessageType } from '@buster/slack';
|
||||
import { logger } from '@trigger.dev/sdk/v3';
|
||||
|
||||
export interface SlackNotificationParams {
|
||||
|
@ -369,7 +370,10 @@ function formatSlackReplyMessage(params: SlackReplyNotificationParams): SlackMes
|
|||
};
|
||||
}
|
||||
|
||||
throw new Error('Invalid reply notification parameters');
|
||||
throw new Error(
|
||||
'Invalid reply notification parameters: Missing required fields. ' +
|
||||
'Requires either formattedMessage, summaryTitle with summaryMessage, or toolCalled="flagChat" with message'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -449,7 +453,9 @@ function formatSlackMessage(params: SlackNotificationParams): SlackMessage {
|
|||
}
|
||||
|
||||
// This shouldn't happen if shouldSendSlackNotification is working correctly
|
||||
throw new Error('Invalid notification parameters');
|
||||
throw new Error(
|
||||
`Invalid notification parameters: Missing required fields. Requires either formattedMessage, summaryTitle with summaryMessage, or toolCalled="flagChat" with message. Received: formattedMessage=${!!params.formattedMessage}, summaryTitle=${!!params.summaryTitle}, summaryMessage=${!!params.summaryMessage}, toolCalled="${params.toolCalled}", message=${!!params.message}`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -528,7 +534,7 @@ export async function trackSlackNotification(params: {
|
|||
slackChannelId: params.channelId,
|
||||
slackMessageTs: params.messageTs,
|
||||
slackThreadTs: params.threadTs || null,
|
||||
messageType: params.threadTs ? 'reply' : 'message',
|
||||
messageType: params.threadTs ? SlackMessageType.REPLY : SlackMessageType.MESSAGE,
|
||||
content: params.slackBlocks
|
||||
? JSON.stringify({ blocks: params.slackBlocks })
|
||||
: params.summaryTitle && params.summaryMessage
|
||||
|
|
|
@ -99,3 +99,10 @@ export const SendMessageResultSchema = z.object({
|
|||
});
|
||||
|
||||
export type SendMessageResult = z.infer<typeof SendMessageResultSchema>;
|
||||
|
||||
// Message Type enum for tracking
|
||||
export enum SlackMessageType {
|
||||
MESSAGE = 'message',
|
||||
REPLY = 'reply',
|
||||
UPDATE = 'update',
|
||||
}
|
||||
|
|
|
@ -163,6 +163,9 @@ importers:
|
|||
'@buster/server-shared':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/server-shared
|
||||
'@buster/slack':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/slack
|
||||
'@buster/test-utils':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/test-utils
|
||||
|
|
Loading…
Reference in New Issue