fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103
fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103patrick-chinchill wants to merge 1 commit into
Conversation
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
|
Warning Review limit reached
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 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
There was a problem hiding this comment.
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.
Summary
Fixes #102.
SlackAdapter._upload_fileswas passingchannel_id=to slack-sdk'sfiles_upload_v2. The documented kwarg ischannel=; passingchannel_id=collides with the kwarg slack-sdk adds internally when it forwards tofiles_completeUploadExternal, raising a hardTypeErroron every Slack file upload.One-line fix in
src/chat_sdk/adapters/slack/adapter.py:Adds a regression test (
test_file_upload_uses_channel_kwarg_not_channel_id) that asserts the upload call carrieschannel=and notchannel_id=, pinning the kwarg name against future drift.Test plan
uv run pytest tests/test_slack_api.py -q— 73 passeduv run ruff check && uv run ruff format --check— cleanuv run pytest tests/— only preexisting unrelatedtest_github_webhookfailure remainshttps://claude.ai/code/session_01WArZSuq5JFJwM9ecwqthhX
Generated by Claude Code