Skip to content

Commit 2c9b986

Browse files
fix(slack): omit legacy assistant events from Agent View manifests
1 parent 51b58bd commit 2c9b986

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

‎apps/sim/triggers/slack/capabilities.test.ts‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ const REQUIRED_AGENT_EVENTS = [
2525
'agent_session_title_changed',
2626
'app_context_changed',
2727
'app_home_opened',
28-
'assistant_thread_context_changed',
29-
'assistant_thread_started',
3028
'message.im',
3129
]
3230

@@ -58,6 +56,29 @@ describe('buildSlackManifest - interactivity', () => {
5856
})
5957

6058
describe('buildSlackManifest - Agent View', () => {
59+
it.each([
60+
{ name: 'minimal', capabilities: new Set<string>() },
61+
{ name: 'all capabilities', capabilities: new Set(SLACK_CAPABILITIES.map(({ id }) => id)) },
62+
])('excludes incompatible Assistant events from $name manifests', ({ capabilities }) => {
63+
const manifest = buildSlackManifest(capabilities, opts)
64+
const features = manifest.features as Record<string, unknown>
65+
const subscriptions = settingsOf(manifest).event_subscriptions as { bot_events: string[] }
66+
67+
expect(features.agent_view).toBeDefined()
68+
expect(features.assistant_view).toBeUndefined()
69+
expect(subscriptions.bot_events).not.toContain('assistant_thread_started')
70+
expect(subscriptions.bot_events).not.toContain('assistant_thread_context_changed')
71+
expect(subscriptions.bot_events).toEqual(
72+
expect.arrayContaining([
73+
'app_home_opened',
74+
'app_context_changed',
75+
'message.im',
76+
'agent_session_stopped',
77+
'agent_session_title_changed',
78+
])
79+
)
80+
})
81+
6182
it('enables Agent View, Agent Sessions, streaming, and direct messages for every custom bot', () => {
6283
const manifest = buildSlackManifest(new Set(), opts)
6384
const features = manifest.features as Record<string, Record<string, unknown>>

‎apps/sim/triggers/slack/capabilities.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ export const SLACK_AGENT_EVENTS = [
231231
'agent_session_title_changed',
232232
'app_context_changed',
233233
'app_home_opened',
234-
'assistant_thread_context_changed',
235-
'assistant_thread_started',
236234
'message.im',
237235
] as const
238236

0 commit comments

Comments
 (0)