diff --git a/apps/sim/app/api/webhooks/trigger/[path]/route.ts b/apps/sim/app/api/webhooks/trigger/[path]/route.ts index 0db8bd9ad7..abb37e8960 100644 --- a/apps/sim/app/api/webhooks/trigger/[path]/route.ts +++ b/apps/sim/app/api/webhooks/trigger/[path]/route.ts @@ -155,19 +155,14 @@ async function handleWebhookPost( if (shouldSkipWebhookEvent(foundWebhook, body, requestId)) { continue } - - try { - const response = await queueWebhookExecution(foundWebhook, foundWorkflow, body, request, { - requestId, - path, - actorUserId: preprocessResult.actorUserId, - executionId: preprocessResult.executionId, - correlation: preprocessResult.correlation, - }) - responses.push(response) - } catch (error) { - throw error - } + const response = await queueWebhookExecution(foundWebhook, foundWorkflow, body, request, { + requestId, + path, + actorUserId: preprocessResult.actorUserId, + executionId: preprocessResult.executionId, + correlation: preprocessResult.correlation, + }) + responses.push(response) } if (responses.length === 0) { diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx index d73196f34a..56a7c7b5f6 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx @@ -241,40 +241,57 @@ export function ChatContent({ const hasSpecialContent = parsed.hasPendingTag || parsed.segments.some((s) => s.type !== 'text') if (hasSpecialContent) { + type RenderGroup = + | { kind: 'inline'; markdown: string } + | { kind: 'block'; segment: ContentSegment; index: number } + + const groups: RenderGroup[] = [] + let pendingMarkdown = '' + + const flushMarkdown = () => { + if (pendingMarkdown.trim()) { + groups.push({ kind: 'inline', markdown: pendingMarkdown }) + } + pendingMarkdown = '' + } + + for (let i = 0; i < parsed.segments.length; i++) { + const s = parsed.segments[i] + if (s.type === 'workspace_resource') { + const label = s.data.title || s.data.id + pendingMarkdown += `[${label}](#wsres-${s.data.type}-${s.data.id})` + } else if (s.type === 'text' || s.type === 'thinking') { + pendingMarkdown += s.content + } else { + flushMarkdown() + groups.push({ kind: 'block', segment: s, index: i }) + } + } + flushMarkdown() + return (