Skip to content

release: 0.4.27.1 — backport Slack files_upload_v2 confirmation fix#120

Closed
patrick-chinchill wants to merge 2 commits into
mainfrom
release/0.4.27.1
Closed

release: 0.4.27.1 — backport Slack files_upload_v2 confirmation fix#120
patrick-chinchill wants to merge 2 commits into
mainfrom
release/0.4.27.1

Conversation

@patrick-chinchill
Copy link
Copy Markdown
Collaborator

Summary

Point release 0.4.27.1 — Python-only patch on the 0.4.27 line. Does NOT include the 0.4.29 alpha sync work currently in flight on main. Branched off v0.4.27 tag.

Unblocks chinchill-api consumer that needs to gate UX on actual Slack file-delivery confirmation, ahead of the 0.4.29 release.

What's in 0.4.27.1

  • Slack files_upload_v2 confirmation surfaced through post() (backported from fix(slack): surface files_upload_v2 confirmation in SentMessage.raw #117). SlackAdapter._upload_files already computed the list of Slack-confirmed file IDs but post_message discarded the return, and ThreadImpl._create_sent_message hardcoded raw=None. Now: post_message augments RawMessage.raw with "uploaded_file_ids" on every file-carrying return path; _create_sent_message accepts and propagates the adapter's raw. None = no upload; empty list = Slack confirmed zero. Augmentation is additive, not a replace.

  • Storage-bloat / PII fixchat._MessageHistoryCache.append now nulls raw before persisting (mirror of the existing null-out in message_history.MessageHistoryCache.append). Without this, the platform payload that the above fix populates on SentMessage.raw (Slack team_id/user_id, Discord guildId, etc.) would persist on every reply to Redis/Postgres-backed state. Caught by post-merge code review of fix(slack): surface files_upload_v2 confirmation in SentMessage.raw #117.

Why a point release vs waiting for 0.4.29

0.4.29 is still in mid-wave (alpha 1 just landed; chat/ai, Messenger, and other big pieces still in flight). chinchill-api can't wait. Branching off v0.4.27 for a focused patch gets the fix to production immediately without coupling to 4.29's risk surface.

Release mechanics

  • Base: v0.4.27 tag (c43ea05)
  • Branch: release/0.4.27.1
  • PR target: main (for visibility / CI / review). Not intended for merge into main — main is already on 0.4.29a1 and merging would conflict on version + CHANGELOG. After approval, tag v0.4.27.1 from release/0.4.27.1 directly; CHANGELOG entry will be forward-ported to main via a separate small PR.

Validation

  • ruff check + ruff format --check: clean
  • audit_test_quality.py: 0 hard failures
  • Full suite: 4040 passed, 3 skipped on Python 3.12

Upstream convergence

Filing the same fix upstream (vercel/chat#564) to restore parity in a future sync.


Generated by Claude Code


Generated by Claude Code

patrick-chinchill and others added 2 commits May 28, 2026 22:01
SlackAdapter._upload_files already returns the list of Slack-confirmed
file IDs, but post_message discarded the return and
ThreadImpl._create_sent_message hardcoded raw=None, so the confirmation
never reached SentMessage.raw. Slack was the only file-capable adapter to
drop upload confirmation; discord/telegram upload inline and expose the
platform response naturally.

- post_message: capture _upload_files' return and augment RawMessage.raw
  with "uploaded_file_ids" on every return path that can carry files
  (file-only, card, table, text), via a new _augment_raw_with_uploads
  helper. None means no upload; empty list means Slack confirmed zero
  attachments. raw is augmented, not replaced — non-breaking.
- thread.py: _create_sent_message accepts and propagates a raw parameter;
  the post() call site passes raw_msg.raw through. Platform-agnostic, so
  discord/telegram real platform responses now flow through too.

Tests: 3 in test_slack_api.py (file-only, text+files, text-only no-augment)
and 1 end-to-end in test_thread_faithful.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Post-merge review of PR #117 caught that _MessageHistoryCache.append
in chat.py did not null out raw before persisting (unlike its sibling
MessageHistoryCache.append in message_history.py, which already does).

Without this, the platform raw payload (Slack team_id/user_id,
Discord guild IDs, etc.) that #117 now correctly populates on
SentMessage.raw would persist to Redis/Postgres-backed state on
every reply, inflating storage size and PII surface.

Mirrors the null-out in message_history.py:62.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 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 56 minutes and 49 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: 2ce1c744-02c5-4c55-ad93-ad032337b2a5

📥 Commits

Reviewing files that changed from the base of the PR and between f0d7f1c and e45069f.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • pyproject.toml
  • src/chat_sdk/adapters/slack/adapter.py
  • src/chat_sdk/chat.py
  • src/chat_sdk/thread.py
  • tests/test_slack_api.py
  • tests/test_thread_faithful.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 bumps the SDK version to 0.4.27.1 and introduces a fix to surface Slack file upload confirmations (uploaded_file_ids) on SentMessage.raw. It also updates _MessageHistoryCache to null out the raw payload before persisting messages to history, preventing storage bloat and PII exposure. Feedback on this PR suggests explicitly documenting the SDK's versioning scheme to clarify how local, Python-only patch versions are handled relative to upstream releases to avoid potential version number collisions.

Comment thread pyproject.toml
[project]
name = "chat-sdk"
version = "0.4.27"
version = "0.4.27.1"
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.

medium

When defining a versioning scheme that embeds an upstream version (such as 0.4.27.1 for a local patch on 0.4.27), there is a potential for collision if the upstream project releases a patch version (e.g., 4.27.1). If upstream patch releases are handled by bumping to the next minor version in this SDK, please ensure this behavior is explicitly documented (for example, in the README or a dedicated versioning document) to clarify that the fourth digit/local patch slot is strictly reserved for local, Python-only fixes.

References
  1. When defining a versioning scheme that embeds an upstream version, ensure that the scheme clearly differentiates between upstream patch releases and local (Python-only) fixes to avoid ambiguity and potential collisions in version numbers. If upstream patch releases are handled by bumping to the next minor version, explicitly document this to clarify that the local patch slot is reserved for local fixes.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e45069f686

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

files = extract_files(message)
if files:
await self._upload_files(files, channel, thread_ts or None)
uploaded_file_ids = await self._upload_files(files, channel, thread_ts or None)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse Slack upload IDs from the top-level files list

When this new return value is used, successful real Slack uploads will usually surface uploaded_file_ids: []: the Python SDK's files_upload_v2 returns the files.completeUploadExternal payload with top-level entries like {"files": [{"id": ...}]}, but _upload_files still only collects IDs from a nested uploaded["files"] list. As a result, consumers gating on SentMessage.raw["uploaded_file_ids"] get a false “zero attachments confirmed” signal even though the files were delivered; the extraction needs to handle the top-level file objects before this value is exposed.

Useful? React with 👍 / 👎.

@patrick-chinchill
Copy link
Copy Markdown
Collaborator Author

Closing — this is a tag-only maintenance release, not a main merge. v0.4.27.1 has been tagged off this branch (release/0.4.27.1 @ e45069f). It must NOT merge into main: main is the 0.4.29 alpha line, so merging would conflict on version (0.4.29a1 ↔ 0.4.27.1) and pull the version backward.

The fix also lands on main forward via #117 (the null-out commit e45069f is being cherry-picked onto #117 so the 0.4.29 line gets the PII guard too). Branch release/0.4.27.1 is retained as the tag's source.

chinchill-api pins @v0.4.27.1.

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