Skip to content

fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103

Merged
patrick-chinchill merged 2 commits into
mainfrom
claude/wizardly-euler-gDArT
May 28, 2026
Merged

fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103
patrick-chinchill merged 2 commits into
mainfrom
claude/wizardly-euler-gDArT

Conversation

@patrick-chinchill

Copy link
Copy Markdown
Collaborator

Summary

Fixes #102. SlackAdapter._upload_files was passing channel_id= to slack-sdk's files_upload_v2. The documented kwarg is channel=; passing channel_id= collides with the kwarg slack-sdk adds internally when it forwards to files_completeUploadExternal, raising a hard TypeError on every Slack file upload.

One-line fix in src/chat_sdk/adapters/slack/adapter.py:

- kwargs: dict[str, Any] = {"channel_id": channel, "file_uploads": file_uploads}
+ kwargs: dict[str, Any] = {"channel": channel, "file_uploads": file_uploads}

Adds a regression test (test_file_upload_uses_channel_kwarg_not_channel_id) that asserts the upload call carries channel= and not channel_id=, pinning the kwarg name against future drift.

Test plan

  • uv run pytest tests/test_slack_api.py -q — 73 passed
  • uv run ruff check && uv run ruff format --check — clean
  • Full uv run pytest tests/ — only preexisting unrelated test_github_webhook failure remains

https://claude.ai/code/session_01WArZSuq5JFJwM9ecwqthhX


Generated by Claude Code

slack-sdk's files_upload_v2 takes channel=, not channel_id=. Passing
channel_id= collides with the kwarg slack-sdk adds internally when it
forwards to files_completeUploadExternal, raising TypeError on every
upload. Adds a regression test pinning the kwarg name.

https://claude.ai/code/session_01WArZSuq5JFJwM9ecwqthhX
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@patrick-chinchill, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 24 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c216dc57-4135-4637-bbc6-b1e61d0302ea

📥 Commits

Reviewing files that changed from the base of the PR and between be0852e and 7ab59a9.

📒 Files selected for processing (2)
  • src/chat_sdk/adapters/slack/adapter.py
  • tests/test_slack_api.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a bug in the Slack adapter where file uploads would fail due to a keyword argument collision. Specifically, the keyword argument passed to the Slack SDK's files_upload_v2 was corrected from channel_id to channel. Additionally, a regression test has been added to verify this behavior and prevent future occurrences. I have no further feedback to provide as the changes are correct and well-tested.

@patrick-chinchill patrick-chinchill marked this pull request as ready for review May 28, 2026 03:19
@patrick-chinchill patrick-chinchill force-pushed the claude/wizardly-euler-gDArT branch from 0cb8def to 7ab59a9 Compare May 28, 2026 21:22
@patrick-chinchill patrick-chinchill merged commit ff27651 into main May 28, 2026
15 checks passed
patrick-chinchill added a commit that referenced this pull request May 28, 2026
Synced to upstream vercel/chat@4.27.0 (release commit f55378a).

Upstream parity ports: chat.get_user across 8 adapters (#90), Slack Socket Mode (#86, closes #68), Slack dynamic bot_token resolver + webhook_verifier (#87), Teams native DM streaming (#88), Telegram MarkdownV2 (#89), Discord card text dedup (#89), Slack streaming team_id + Teams DM Graph conversation IDs (#85), Slack adapter bug-fix sweep (#89), ExternalSelect.initial_option + option_groups (#84), Slack @mention email-safe regex (#91).

Python-only improvements: markdown parser completeness (#101), streaming markdown list/table chunk-boundary (#99), Slack files_upload_v2 kwarg fix (#103), dict-shaped StreamChunk support (#105), Google Chat card-text markdown rendering (#92), adapter init logs + adapter-list in not-found errors (#104).

Sync-process documentation captures the review-loop discipline lessons from this wave (docs/UPSTREAM_SYNC.md + docs/SELF_REVIEW.md).

Fidelity workflow stays pinned to chat@4.26.0 — upstream did not publish a chat@4.27.0 tag for the Apr 30 monorepo cut.

4036 tests pass, 3 skipped, 0 failed.
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.

SlackAdapter._upload_files passes channel_id= to slack-sdk files_upload_v2 → TypeError "got multiple values for keyword argument 'channel_id'"

2 participants