diff --git a/apps/sim/lib/slack-search/assistant-stream.test.ts b/apps/sim/lib/slack-search/assistant-stream.test.ts index 77c71b3b649..a1de1200b39 100644 --- a/apps/sim/lib/slack-search/assistant-stream.test.ts +++ b/apps/sim/lib/slack-search/assistant-stream.test.ts @@ -205,6 +205,7 @@ describe('Slack lazy stream lifecycle', () => { expect(api.start).not.toHaveBeenCalled() await stream.onEvent(toolCall()) expect(api.start).toHaveBeenCalledOnce() + expect(api.start.mock.calls[0][3]).toBe('plan') expect(api.start.mock.calls[0][2]).toEqual([ { type: 'markdown_text', text: '\n' }, { type: 'markdown_text', text: '\n\n' }, @@ -895,7 +896,7 @@ describe('Slack Assistant delivery', () => { 'Connect here ' ) }) - it('streams only main public answer text and preserves the original thread', async () => { + it('streams only main public answer text in plan mode and preserves the original thread', async () => { const { stream } = setup() await stream.start() await stream.onEvent({ @@ -908,7 +909,7 @@ describe('Slack Assistant delivery', () => { 'test-token', { channel: 'D1', threadTs: '1.1' }, [{ type: 'markdown_text', text: 'Hello world. ' }], - 'timeline', + 'plan', expect.any(AbortSignal) ) expect(deliveredText()).toBe('Hello world. ') diff --git a/apps/sim/lib/slack-search/assistant-stream.ts b/apps/sim/lib/slack-search/assistant-stream.ts index 06f3125b206..c41c34975ae 100644 --- a/apps/sim/lib/slack-search/assistant-stream.ts +++ b/apps/sim/lib/slack-search/assistant-stream.ts @@ -246,7 +246,7 @@ export class SlackSearchAssistantStream { } } this.toolProgress.set(payload.toolCallId, { toolName: payload.toolName, chunk }) - /** Updating an existing task does not introduce a new position in Slack's timeline. */ + /** Existing task updates can be delivered without waiting for preceding answer text. */ this.pendingProgress.push({ textEnd: payload.phase === 'call' ? this.text.length : 0, chunk }) } @@ -356,7 +356,7 @@ export class SlackSearchAssistantStream { token, { channel, threadTs }, [...this.leadingChunks, chunk], - 'timeline', + 'plan', signal ) this.leadingChunks = []