#15768: feat(slack): Add queue position indicators for message queues
docs
stale
size: L
Cluster:
Slack Thread Management Improvements
## Summary
Implements Slack Queue Position Indicators for OpenClaw to provide visual feedback to users when their messages are queued for AI processing.
## Problem
When multiple messages stack up waiting for the AI to respond, users have no visibility into queue position or whether their message is being processed.
## Solution
Added emoji reactions showing queue position (1️⃣, 2️⃣, 3️⃣, etc.) to messages as they wait, with automatic updates as the queue drains.
## Features
- **Position Reactions**: Messages receive number emoji reactions indicating their position in the queue
- **Dynamic Updates**: Reactions update automatically as messages ahead complete processing
- **Processing Indicator**: Position reaction is replaced with ⏳ when processing starts
- **Automatic Cleanup**: Reactions are removed when processing completes or messages are removed from queue
- **Multi-Account Support**: Works correctly with multiple Slack accounts/workspaces
- **Configurable**: Position emojis, processing emoji, and max position can be customized
## Implementation Details
### Architecture
- **QueuePositionTracker** class manages position reactions
- Integrated into queue enqueue/drain/cleanup flows
- Uses existing Slack API actions (reactSlackMessage, removeSlackReaction)
### Key Files Modified
- src/auto-reply/reply/queue/position-tracker.ts - Core tracker implementation
- src/auto-reply/reply/queue/enqueue.ts - Updates positions after enqueuing
- src/auto-reply/reply/queue/drain.ts - Marks as processing and updates during drain
- src/auto-reply/reply/queue/cleanup.ts - Clears reactions on queue clear
- src/auto-reply/reply/queue/state.ts - Clears reactions on state reset
### Edge Cases Handled
- Message deletion and queue clearing
- Non-Slack messages (only tracks originatingChannel: "slack")
- Missing metadata (channelId or messageId)
- Slack API failures (logged but don't crash processing)
- Collect mode (all items marked as processing when collected into one run)
- Bot restart (reactions are stateless, new state tracked correctly)
- Beyond max position (messages past limit don't get reactions)
## Testing
Comprehensive test coverage in position-tracker.test.ts:
- Position reaction addition and updates
- Processing indicator management
- Queue position changes
- Custom configuration
- Error handling
- Edge cases
## Configuration
The feature is enabled by default and can be configured.
## Documentation
- Added comprehensive documentation in docs/queue-position-indicators.md
- Updated CHANGELOG.md with feature description
## Checklist
- [x] Working implementation
- [x] Comprehensive tests added
- [x] Edge cases handled
- [x] Documentation added
- [x] CHANGELOG.md updated
🤖 Generated with Claude Code
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds Slack “queue position” emoji reactions to queued follow-up messages, introducing a `QueuePositionTracker` and integrating it into enqueue/drain/cleanup flows so users see numeric position emojis while waiting and an hourglass while processing.
Core logic lives in `src/auto-reply/reply/queue/position-tracker.ts`, with queue lifecycle hooks added to `enqueue.ts`, `drain.ts`, and queue-clear paths. Tests were added for tracker behavior.
Key merge blockers are around cleanup correctness in multi-account Slack setups: reaction removal during cleanup often omits `accountId`, and queue-clear paths call `updateQueuePositions([])` in a way that is not scoped to the specific queue being cleared.
<h3>Confidence Score: 3/5</h3>
- This PR is not safe to merge until the reaction cleanup/account scoping issues are fixed.
- The feature is well-scoped and tested, but cleanup/removal paths drop `accountId` and queue-clear logic uses a global tracker update that isn’t scoped to the specific queue, which can leave stale reactions or target the wrong Slack workspace in multi-account deployments.
- src/auto-reply/reply/queue/position-tracker.ts, src/auto-reply/reply/queue/state.ts, src/auto-reply/reply/queue/cleanup.ts
<sub>Last reviewed commit: 69be4da</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#19816: feat(slack): add typingReaction config for DM typing indicator fall...
by dalefrieswthat · 2026-02-18
81.3%
#19083: Slack: preserve per-thread context and consistent thread replies
by jkimbo · 2026-02-17
76.7%
#7980: feat(telegram): multi-stage reaction system for message pipeline vi...
by macmimi23 · 2026-02-03
75.8%
#9520: fix: ignore slack already_reacted
by bolismauro · 2026-02-05
75.3%
#17316: fix: ack reaction not removed when block streaming is enabled (Tele...
by czmathew · 2026-02-15
75.1%
#9671: feat(slack): add AI Assistant loading states support
by natedenh · 2026-02-05
75.0%
#4749: fix: handle string thread IDs in queue drain for Slack
by nvonpentz · 2026-01-30
74.8%
#20860: feat(reactions): add configurable immediate reaction dispatch system
by davidrudduck · 2026-02-19
74.7%
#21346: [AI-assisted] Telegram: add reaction state machine with fallback an...
by Archie818 · 2026-02-19
74.7%
#23320: fix(slack): respect replyToMode when incomingThreadTs is auto-created
by dorukardahan · 2026-02-22
74.2%