fix(slack): handle app_mention events so thread @mentions are delivered to agents#13252
Closed
dzianisv wants to merge 17 commits into
Closed
fix(slack): handle app_mention events so thread @mentions are delivered to agents#13252dzianisv wants to merge 17 commits into
dzianisv wants to merge 17 commits into
Conversation
- Add JWT expiration check utility - Implement dynamic base URL resolution based on token environment - Add missing x-api-key and Authorization: Bearer headers - Add organizationId to ApiAuth schema - Add proactive token expiration warnings in CLI and model discovery
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…itely When network issues occur mid-stream (TCP half-open connections, stalled LLM providers, proxy timeouts), the streaming loop would hang forever waiting for the next chunk. This fix adds an idle timeout that detects when no data has been received for a configurable period (default 60 seconds) and triggers a retry with exponential backoff. Changes: - Add StreamIdleTimeoutError class to message-v2.ts - Add withIdleTimeout() async generator wrapper in processor.ts - Wrap stream.fullStream with idle timeout in the process loop - Mark StreamIdleTimeoutError as retryable so sessions recover automatically - Add stream_idle_timeout config option under experimental settings - Add additional network error types (ETIMEDOUT, ENOTFOUND, etc) as retryable Fixes issues where sessions get stuck for hours on LLM requests. Related: anomalyco#8383, anomalyco#2512, anomalyco#2819, anomalyco#4255
fix: add stream idle timeout to prevent sessions from hanging indefinitely
Integrate Kilo Code provider: - Add kilocode device authorization flow in auth.ts - Add kilocode provider loader in provider.ts - Add dynamic model discovery from Kilo Code API in models.ts - Add JWT expiry check for kilocode tokens in run.ts - Add install:local script for developer convenience - Add desktop infra import in sst.config.ts Preserves dev branch improvements: - Provider filtering (enabled/disabled providers) - Improved Data lazy loading with Flag support - Better message handling in run command - Plugin auth handling
This feature was causing more problems than it solved. Tool execution blocks the stream, so the timeout couldn't distinguish between: 1. LLM provider stalled (actual problem) 2. Tool executing (normal operation) Reverting to upstream behavior - no stream idle timeout.
…ed to agents When a user @mentions the bot in a Slack thread (e.g. '@supportengineer, please create a PR'), Slack sends an app_mention event that the bot was ignoring — only app.message() was registered. Changes: - Add app.event('app_mention') handler to process @mention events - Extract shared processMessage() to avoid duplicating message handling logic - Add timestamp-based deduplication (Slack sends both message and app_mention events for @mentions in channels where the bot is a member) Closes anomalyco#13251
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
Author
|
Closing: this fix was applied to the wrong codebase. The actual Slack bot is in VibeTechnologies/VibeTeam, and the fix was merged there as PR #92. See VibeTechnologies/VibeTeam#92 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
app.event('app_mention')handler so @mention messages in threads are processed by the agentprocessMessage()function to eliminate code duplication betweenmessageandapp_mentionhandlersmessageandapp_mentionevents for the same @mentionProblem
When a user @mentions the bot in a Slack thread (e.g.
@SupportEngineer, please create a PR with a code fix), Slack sends anapp_mentionevent. The bot only had anapp.message()handler registered and completely ignoredapp_mentionevents, so the message was never delivered to the agent.Root Cause
The Slack bot in
packages/slack/src/index.tsonly registeredapp.message()which handles regular channel messages. Theapp_mentions:readOAuth scope was listed in the README as required, but noapp.event('app_mention', ...)handler existed in the code.Changes
packages/slack/src/index.tsapp.event('app_mention')handler, extractprocessMessage(), use deduppackages/slack/src/dedup.tspackages/slack/test/dedup.test.tspackages/slack/tsconfig.jsonplan.mdCloses #13251