Skip to content

Revert "feat(slack): expose direct WebClient access via adapter.client"#472

Merged
visyat merged 2 commits into
mainfrom
revert-471-feat/slack-direct-webclient-access
May 9, 2026
Merged

Revert "feat(slack): expose direct WebClient access via adapter.client"#472
visyat merged 2 commits into
mainfrom
revert-471-feat/slack-direct-webclient-access

Conversation

@visyat
Copy link
Copy Markdown
Collaborator

@visyat visyat commented May 9, 2026

Reverts #471

@visyat visyat requested a review from a team as a code owner May 9, 2026 09:05
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 May 9, 2026 9:15am
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 May 9, 2026 9:15am

Copy link
Copy Markdown
Contributor

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

The createSlackAdapter() helper function silently drops the apiUrl config field, so custom Slack API URLs (e.g., for GovSlack) are ignored when using the helper.

Fix on Vercel

…piUrl` config field, so custom Slack API URLs (e.g., for GovSlack) are ignored when using the helper.

This commit fixes the issue reported at packages/adapter-slack/src/index.ts:5055

**Bug explanation:**

The `SlackAdapterConfig` interface defines an `apiUrl` field (line 166) that allows users to override the Slack Web API base URL — useful for GovSlack or self-hosted gateways. The `SlackAdapter` constructor reads this field at line 622:

```typescript
const slackApiUrl = config.apiUrl ?? process.env.SLACK_API_URL;
```

However, the `createSlackAdapter()` helper function (around line 5055) constructs a `resolved` config object that includes many fields from the user's config but omits `apiUrl`. This means when a user writes:

```typescript
createSlackAdapter({ apiUrl: "https://slack-gov.com/api/" })
```

The `apiUrl` is silently dropped and the `WebClient` is created without the custom URL. The `SLACK_API_URL` environment variable fallback still works (since it's checked in the constructor), but explicit config via the helper is lost.

This is clearly a bug — all other config fields are forwarded through the `resolved` object, and `apiUrl` was simply forgotten.

**Fix explanation:**

Added `apiUrl: config?.apiUrl,` to the `resolved` config object in `createSlackAdapter()`. This ensures the `apiUrl` value from user config is properly forwarded to the `SlackAdapter` constructor, matching the pattern used for all other optional config fields.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: visyat <vishal.yathish@gmail.com>
@visyat visyat merged commit 2279f1d into main May 9, 2026
12 of 13 checks passed
@visyat visyat deleted the revert-471-feat/slack-direct-webclient-access branch May 9, 2026 09:21
bensabic added a commit that referenced this pull request May 11, 2026
…nt" (#472) (#476)

This reverts commit 2279f1d.

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
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