chore: sentry tag of schedule task (#168)

This commit is contained in:
shivammittal274
2026-01-06 20:53:11 +05:30
committed by GitHub
parent c61d1df504
commit 297f212c80
3 changed files with 6 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ export async function getChatServerResponse(
}
: undefined,
userSystemPrompt: `${personalization}\n${scheduleSystemPrompt}`,
isScheduledTask: true,
}),
})

View File

@@ -51,6 +51,10 @@ export function createChatRoutes(deps: ChatRouteDeps) {
async (c) => {
const request = c.get('validatedBody') as ChatRequest
Sentry.getCurrentScope().setTag(
'request-type',
request.isScheduledTask ? 'schedule' : 'chat',
)
Sentry.setContext('request', {
provider: request.provider,
model: request.model,

View File

@@ -44,6 +44,7 @@ export const ChatRequestSchema = VercelAIConfigSchema.extend({
contextWindowSize: z.number().optional(),
browserContext: BrowserContextSchema.optional(),
userSystemPrompt: z.string().optional(),
isScheduledTask: z.boolean().optional().default(false),
})
export type ChatRequest = z.infer<typeof ChatRequestSchema>