Skip to content

Commit 22fb0eb

Browse files
fix(slack-search): stream task progress in plan mode (#8219)
* fix(slack-search): stream task progress in plan mode * test(search): await async source integration selection
1 parent 2671951 commit 22fb0eb

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/sim/lib/slack-search/assistant-stream.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ describe('Slack lazy stream lifecycle', () => {
205205
expect(api.start).not.toHaveBeenCalled()
206206
await stream.onEvent(toolCall())
207207
expect(api.start).toHaveBeenCalledOnce()
208+
expect(api.start.mock.calls[0][3]).toBe('plan')
208209
expect(api.start.mock.calls[0][2]).toEqual([
209210
{ type: 'markdown_text', text: '\n' },
210211
{ type: 'markdown_text', text: '\n\n' },
@@ -895,7 +896,7 @@ describe('Slack Assistant delivery', () => {
895896
'Connect here '
896897
)
897898
})
898-
it('streams only main public answer text and preserves the original thread', async () => {
899+
it('streams only main public answer text in plan mode and preserves the original thread', async () => {
899900
const { stream } = setup()
900901
await stream.start()
901902
await stream.onEvent({
@@ -908,7 +909,7 @@ describe('Slack Assistant delivery', () => {
908909
'test-token',
909910
{ channel: 'D1', threadTs: '1.1' },
910911
[{ type: 'markdown_text', text: 'Hello world. ' }],
911-
'timeline',
912+
'plan',
912913
expect.any(AbortSignal)
913914
)
914915
expect(deliveredText()).toBe('Hello world. ')

‎apps/sim/lib/slack-search/assistant-stream.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class SlackSearchAssistantStream {
246246
}
247247
}
248248
this.toolProgress.set(payload.toolCallId, { toolName: payload.toolName, chunk })
249-
/** Updating an existing task does not introduce a new position in Slack's timeline. */
249+
/** Existing task updates can be delivered without waiting for preceding answer text. */
250250
this.pendingProgress.push({ textEnd: payload.phase === 'call' ? this.text.length : 0, chunk })
251251
}
252252

@@ -356,7 +356,7 @@ export class SlackSearchAssistantStream {
356356
token,
357357
{ channel, threadTs },
358358
[...this.leadingChunks, chunk],
359-
'timeline',
359+
'plan',
360360
signal
361361
)
362362
this.leadingChunks = []

0 commit comments

Comments
 (0)