fix(slack): use channel= kwarg for files_upload_v2 (closes #102)#103
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 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 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.
0cb8def to
7ab59a9
Compare
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.
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