Skip to content

fix(slack-app): retry slack rate limits when fetching thread messages#60983

Merged
tatoalo merged 3 commits into
masterfrom
chore/cloud-slack-agent-slack-ratelimit
Jun 2, 2026
Merged

fix(slack-app): retry slack rate limits when fetching thread messages#60983
tatoalo merged 3 commits into
masterfrom
chore/cloud-slack-agent-slack-ratelimit

Conversation

@tatoalo
Copy link
Copy Markdown
Contributor

@tatoalo tatoalo commented Jun 1, 2026

Problem

under bursty usage Slack returns HTTP 429. The SDK raised this as a fatal SlackApiError, which propagated up to the mention workflow's top-level except Exception catch-all and was shown to the user as the generic error.

Changes

  • slack_sdk's RateLimitErrorRetryHandler registered. On a 429 the SDK honors Slack's Retry-After header and retries transparently (up to 3 times) instead of surfacing a fatal error.

@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team June 1, 2026 18:07
@tatoalo tatoalo force-pushed the chore/cloud-slack-agent-slack-ratelimit branch 2 times, most recently from fe5d04c to 9207854 Compare June 1, 2026 18:08
conversations.replies is a Tier-3 rate-limited Slack method. Under bursty
usage it returns HTTP 429, which the SDK raised as a fatal SlackApiError that
bubbled up to the @PostHog mention workflow's catch-all and surfaced to users
as a generic internal error. Register slack_sdk's RateLimitErrorRetryHandler
so the SDK honors Retry-After and retries transparently inside the activity.
@tatoalo tatoalo force-pushed the chore/cloud-slack-agent-slack-ratelimit branch from 9207854 to 592d9b1 Compare June 1, 2026 18:09
@tatoalo tatoalo enabled auto-merge (squash) June 1, 2026 18:10
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 1, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
products/slack_app/backend/tests/test_collect_thread_messages.py:342
The test confirms a `RateLimitErrorRetryHandler` is registered but doesn't assert `max_retry_count=3`. Changing that value in the production code would pass this test silently. Checking the specific handler attribute costs one line and pins the contract.

```suggestion
        handlers = [h for h in self.slack.client.retry_handlers if isinstance(h, RateLimitErrorRetryHandler)]
        assert len(handlers) == 1
        assert handlers[0].max_retry_count == 3
```

Reviews (1): Last reviewed commit: "fix(slack-app): retry slack rate limits ..." | Re-trigger Greptile

Comment thread products/slack_app/backend/tests/test_collect_thread_messages.py Outdated
tatoalo and others added 2 commits June 2, 2026 09:06
@tatoalo tatoalo merged commit 9882c67 into master Jun 2, 2026
257 of 260 checks passed
@tatoalo tatoalo deleted the chore/cloud-slack-agent-slack-ratelimit branch June 2, 2026 08:34
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Jun 2, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-02 09:01 UTC Run
prod-us ✅ Deployed 2026-06-02 10:18 UTC Run
prod-eu ✅ Deployed 2026-06-02 10:20 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants