fix(sdk): correct blocked-message docs (drop non-existent blockedReason field)#53
Open
tuyakhov wants to merge 1 commit into
Open
fix(sdk): correct blocked-message docs (drop non-existent blockedReason field)#53tuyakhov wants to merge 1 commit into
tuyakhov wants to merge 1 commit into
Conversation
…on field Review of senderkit-app main since the last SDK sync (PR #44, which covered app PRs through #198) — app PRs #199 → #211. App PR #211 ("keep spam-detection detail out of customer-visible surfaces") makes explicit and enforces that the abuse-scan detail is operator-only: the public message read surface (`GET /api/v1/messages` list/get, used by `messages.list`/`messages.get`) projects a lean column set that has never included `blocked_reason`. The SDK's `Message.blockedReason` field (added in PR #44 on the assumption it was readable) was therefore never populated by the API and is misleading. - types.ts: remove `Message.blockedReason`; reword the `status` doc so a `blocked` message is identified by its status + generic `timeline` entry. - mcp-schemas.ts: drop the comment claiming the trigger is on `blockedReason`. `blocked` stays in MESSAGE_STATUSES (unchanged). Non-breaking: the field was always `undefined` and `Message` keeps its index signature. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019CX1MwgJt4TBjL8RnG9hax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Scheduled review of
senderkit-appmainsince the last SDK sync (PR #44, which covered app PRs through #198) — this run covers app PRs #199 → #211.Almost the entire window is internal abuse-module refactors, operator-only tooling, server-side config, and UI work that does not touch the SDK/CLI/MCP outbound contract. The one change that does affect the SDK is app #211, and it's a correction of something PR #44 got wrong.
The one SDK-affecting change — app #211
App #211 ("keep spam-detection detail out of customer-visible surfaces") makes explicit and enforces that the abuse-scan detail is operator-only. The public message read surface (
GET /api/v1/messageslist/get — whatmessages.list/messages.getcall, plus the SSE tail) projects a leanmessageColumnsset that has never includedblocked_reason(confirmed against the app code:lib/services/messages.ts—getMessage/listMessagesboth.select(messageColumns), and no serializer re-adds it). The detailed reason lives only on the operator alert, the workspaceflagged/suspendedreason, and the admin abuse-review page.PR #44 added
Message.blockedReason?: string | nullon the assumption it was readable by API clients. It never was — the field is alwaysundefinedover the wire. #211 confirms this is intentional and permanent.What changed
SDK types (
packages/sdk/src/types.ts)Message.blockedReason— the API never populates it.Message.statusdoc: ablockedmessage is identified by itsblockedstatus plus a generic entry on itstimeline; the detailed trigger is operator-only.MCP / CLI (
packages/sdk/src/mcp-schemas.ts)MESSAGE_STATUSEScomment claiming the trigger is onblockedReason; it now states the detail is operator-only.Changeset
@senderkit/sdk: patch.Non-breaking: the field was always
undefined, andMessagekeeps its[key: string]: unknownindex signature.blockedstays inMESSAGE_STATUSES(unchanged) — so MCP/CLIstatus: "blocked"filtering still works exactly as shipped in #44.Reviewed and intentionally not changed
pipeline.tsextraction, classifier dedupe)GET /api/v1/messages?cursor=&limit=endpoint the SDK already models (cursor/nextCursor).messages.rendered_version,workspaces.flagged_message_idcolumns)@senderkit/sdkis explicitly untouched. Nothing to do until/unless it ships.Verification
pnpm buildandpnpm testpass — sdk 58, cli 80, react-email 29. No remainingblockedReasonreferences inpackages/.🤖 Generated with Claude Code
https://claude.ai/code/session_019CX1MwgJt4TBjL8RnG9hax
Generated by Claude Code