-
Notifications
You must be signed in to change notification settings - Fork 80
Use integration tasks for processing Ask AI queries in Slack #1011
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
Use integration tasks for processing Ask AI queries in Slack #1011
Conversation
🦋 Changeset detectedLatest commit: c7f21b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
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.
Pull Request Overview
This PR refactors the Slack integration's Ask AI query processing to use asynchronous integration tasks instead of blocking operations. The primary goal is to handle scenarios where AI API responses take longer than the 30-second timeout limit of Cloudflare Workers' waitUntil
.
Key changes:
- Splits the query processing into immediate acknowledgment and async task execution
- Adds integration task queue infrastructure with signature verification
- Refactors utility functions to support the new async flow
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
integrations/slack/src/utils.ts | Adds crypto utilities and refactors installation API client methods |
integrations/slack/src/types.ts | Defines integration task types and interfaces for async processing |
integrations/slack/src/router.ts | Implements task endpoint with signature verification for processing queued tasks |
integrations/slack/src/actions/queryAskAI.ts | Refactors Ask AI processing to queue async tasks and handle them separately |
integrations/slack/package.json | Updates itty-router dependency to version 4.0.26 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0d7e91d
to
02285b0
Compare
When we receive a slack event for an Ask AI query it can sometimes take more than 30s for the AI API to respond. 30s is the timeout limit of
waitUntil
in cf workersThis PR changes the strategy where we queue an async task for the AI query so it's not subject to the 30s limit of waitUntil