Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Slack adapter: expose the installation a delivery was resolved through to handlers

Open
#1,058 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start with the requestContext AsyncLocalStorage field on SlackAdapter and where the installation is resolved per delivery from installationProvider. Add a public getter that returns the current store's installation id and bot token, and check that it is only non-empty inside handler execution. Done means a handler such as onNewMention can read the installation through thread.adapter, with a test covering that path and no subclassing needed. Confirm with maintainers first whether exposing the bot token is acceptable.

Written by the indexing model from the issue text.

Description

Package: @chat-adapter/[email protected]

Problem

With an installationProvider, the adapter resolves an installation for each delivery (from authorizations[0].team_id / team_id, or the enterprise id for org-wide installs) and keeps it, with its bot token, in the adapter's own per-delivery store: the protected readonly requestContext: AsyncLocalStorage<{ token, installationId, teamId, enterpriseId, isEnterpriseInstall, botUserId, ... }> field on SlackAdapter. Handlers (onNewMention, onSubscribedMessage, onAction, ...) cannot read it.

A multi-workspace app usually needs exactly that inside a handler: which installation (tenant) this message came through, and that installation's bot token for its own Slack Web API calls. The alternatives available to handlers are wrong or costly:

  • message.raw.team is the sender's team. In a Slack Connect channel it is another company's workspace, not the one the app is installed in.
  • Looking the installation up again by team id means another getInstallation round trip per message, and still needs the right team id first.

Ask: a public way for a handler to get the current delivery's installation (id and bot token), for example a getter on the adapter.

Related: #874 (the suggestedPrompts resolver missing teamId on one path), the same gap in a different place.

Workaround today

Subclass SlackAdapter and add a public getter over that field (this.requestContext.getStore()), then reach the adapter through thread.adapter in handlers. It depends on a protected field and its shape, so a test has to guard it against adapter upgrades.

Dominant language
TypeScript
Stars
2.4k
Forks
329
Avg merge
2d 2h
Merged PRs (30d)
62

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/chat

All issues in vercel/chat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.