Skip to content

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

Open
patrick-chinchill wants to merge 1 commit into
mainfrom
claude/wizardly-euler-gDArT
Open

fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103
patrick-chinchill wants to merge 1 commit 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
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

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 46 minutes and 15 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: 052304a5-e314-487e-bdd4-0e61a460650e

📥 Commits

Reviewing files that changed from the base of the PR and between 08c42fa and e55f79a.

📒 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.

Copy link
Copy Markdown
Contributor

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

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
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