Skip to content

Slack app won't continue processing unless I change tabs or trigger another action/event on AWS Lambda without a deferred response #2630

@dsarlo-viso

Description

@dsarlo-viso

I am currently updating our existing slack app to use the new AI App chat features built into slack. Before we were using slash commands. We deploy our slack app as a lambda function in AWS and I have been using the expressReceiver since we use OAuth.

Right now, I am just trying to do the following:

slackApp.event('assistant_thread_started', async ({ event, client, logger }) => {
    try {
        const assistantThread = (event as any).assistant_thread;
        const channel_id: string | undefined = assistantThread?.channel_id;
        const thread_ts: string | undefined = assistantThread?.thread_ts;
        if (!channel_id || !thread_ts) {
            logger.warn('assistant_thread_started missing channel_id or thread_ts');
            return;
        }
        await client.chat.postMessage({
            channel: channel_id,
            thread_ts,
            text: 'How can I assist you?',
        });
    } catch (error) {
        logger.error(error);
    }
});

I was using the Assistant interface and applying that to the slackApp previously but switched to this "lower level" approach to make sure this would work and I run into the same issues.

I am posting here because I am out of ideas. Set up provisioned concurrency and everything and nothing on the AWS/infra side has helped. We did not have these issues when using slash commands as we were using axios to make api calls to send messages to the slack client to the user to avoid this I believe.

When running locally, this works 100% of the time and instantly, but once we deploy the app, opening a new chat with the app does nothing. Once I swap tabs and go back to the chat window, then the message shows up, every time no matter how long I wait.

Same thing seems to happen when actually chatting with the agent as well.

When trying to use setStatus and setTitle to show that the AI is thinking, it doesn't update the chat UI until we change tabs back and forth or send another message. Basically any action that triggers the slack app again.

We are using bolt js 4.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:examplesissues related to example or sample codeauto-triage-skipPrevent this issue from being closed due to lack of activitydocsM-T: Documentation work only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions