Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/sim/lib/slack-search/assistant-stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -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({
Expand All @@ -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. ')
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/lib/slack-search/assistant-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down Expand Up @@ -356,7 +356,7 @@ export class SlackSearchAssistantStream {
token,
{ channel, threadTs },
[...this.leadingChunks, chunk],
'timeline',
'plan',
signal
)
this.leadingChunks = []
Expand Down
Loading