-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(slack): add message reactions to track conversation status #1475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KiranChilledOut
wants to merge
6
commits into
coleam00:dev
Choose a base branch
from
KiranChilledOut:feature/slack-reactions
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cee0fd0
feat(slack): add message reactions to track conversation status
Wirasm ec39d2f
Merge branch 'coleam00:dev' into feature/slack-reactions
KiranChilledOut 79da658
fix: make reaction updates non-blocking with try/finally
KiranChilledOut bad3ca0
Merge branch 'dev' into feature/slack-reactions
KiranChilledOut 1f5397c
Fixed Comments by Rasmus
KiranChilledOut 3d0ecc7
Merge branch 'dev' into feature/slack-reactions
KiranChilledOut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import { describe, it, expect, mock, beforeEach } from 'bun:test'; | ||
| import type { IPlatformAdapter } from '../types'; | ||
| import { safeAddReaction, safeRemoveReaction } from './orchestrator-agent'; | ||
|
|
||
| // Minimal mock of IPlatformAdapter for reaction testing | ||
| const createMockPlatform = (): IPlatformAdapter => { | ||
| const platform: IPlatformAdapter = { | ||
| getPlatformType: mock(() => 'slack'), | ||
| sendMessage: mock(() => Promise.resolve()), | ||
| }; | ||
| return platform; | ||
| }; | ||
|
|
||
| describe('Reaction Helpers', () => { | ||
| let mockPlatform: IPlatformAdapter; | ||
|
|
||
| beforeEach(() => { | ||
| mockPlatform = createMockPlatform(); | ||
| }); | ||
|
|
||
| describe('safeAddReaction', () => { | ||
| it('calls platform.addReaction when it exists', async () => { | ||
| const addReactionSpy = mock(() => Promise.resolve()); | ||
| mockPlatform.addReaction = addReactionSpy; | ||
|
|
||
| await safeAddReaction(mockPlatform, 'channel:123', 'eyes'); | ||
|
|
||
| expect(addReactionSpy).toHaveBeenCalledWith('channel:123', 'eyes'); | ||
| }); | ||
|
|
||
| it('gracefully returns when platform.addReaction is undefined', async () => { | ||
| mockPlatform.addReaction = undefined; | ||
|
|
||
| await expect(safeAddReaction(mockPlatform, 'channel:123', 'eyes')).resolves.toBeUndefined(); | ||
| }); | ||
|
|
||
| it('catches and logs errors without throwing', async () => { | ||
| const error = new Error('API error'); | ||
| mockPlatform.addReaction = mock(() => Promise.reject(error)); | ||
|
|
||
| await expect(safeAddReaction(mockPlatform, 'channel:123', 'eyes')).resolves.toBeUndefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('safeRemoveReaction', () => { | ||
| it('calls platform.removeReaction when it exists', async () => { | ||
| const removeReactionSpy = mock(() => Promise.resolve()); | ||
| mockPlatform.removeReaction = removeReactionSpy; | ||
|
|
||
| await safeRemoveReaction(mockPlatform, 'channel:123', 'eyes'); | ||
|
|
||
| expect(removeReactionSpy).toHaveBeenCalledWith('channel:123', 'eyes'); | ||
| }); | ||
|
|
||
| it('gracefully returns when platform.removeReaction is undefined', async () => { | ||
| mockPlatform.removeReaction = undefined; | ||
|
|
||
| await expect( | ||
| safeRemoveReaction(mockPlatform, 'channel:123', 'eyes') | ||
| ).resolves.toBeUndefined(); | ||
| }); | ||
|
|
||
| it('catches and logs errors without throwing', async () => { | ||
| const error = new Error('API error'); | ||
| mockPlatform.removeReaction = mock(() => Promise.reject(error)); | ||
|
|
||
| await expect( | ||
| safeRemoveReaction(mockPlatform, 'channel:123', 'eyes') | ||
| ).resolves.toBeUndefined(); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add direct orchestrator coverage for the new reaction helpers.
Slack adapter tests cover the Slack SDK wiring, but they do not prove the contract introduced here: no-op when a platform has no reaction hooks, errors are swallowed and logged, and
handleMessage()drives the intended π β π β β /β sequence. That orchestrator-level behavior is still untested in the provided changes.I can sketch a small dedicated test file for these helper/lifecycle cases if helpful.
π€ Prompt for AI Agents