Skip to content

fix(sdk): stop advertising operator-only blockedReason on Message#51

Open
tuyakhov wants to merge 1 commit into
mainfrom
claude/amazing-bardeen-t3n2da
Open

fix(sdk): stop advertising operator-only blockedReason on Message#51
tuyakhov wants to merge 1 commit into
mainfrom
claude/amazing-bardeen-t3n2da

Conversation

@tuyakhov

Copy link
Copy Markdown
Contributor

Why

Routine sync review of senderkit-app changes merged to main since the last run (PRs #193–#211). All but one were internal (abuse-scanner refactors, billing/pricing, analytics, onboarding, admin UI, marketing copy) and need no SDK/CLI/MCP change. One app change affects this SDK:

  • senderkit-app #211 — keep spam-detection detail out of customer-visible surfaces. The detailed abuse-scan trigger (blockedReason) is now permanently operator-only: it is omitted from every customer-facing message read (messages.list/get, the SSE live tail, and the logs SSR fetch), and the message timeline records only a generic blocked entry. Senders must not learn how/whether detection runs.

The SDK, however, still advertised Message.blockedReason (added alongside the blocked status in the previous sync). Because the customer API never actually populated it, the field was always absent on the wire — so this corrects the type to match reality.

Message read type (packages/sdk/src/types.ts)

  • Removed the optional blockedReason?: string | null field from Message.
  • Reworded the status doc comment: a blocked message is halted by the outbound abuse scanner and surfaces a generic "blocked" entry on its timeline; the detailed detection breakdown is operator-only and never returned by the API.

MCP (packages/sdk/src/mcp-schemas.ts)

  • Updated the MESSAGE_STATUSES doc comment to drop the blockedReason reference (same operator-only framing). The blocked status itself is unchanged and still valid across the SDK, CLI, and MCP.

CLI

No change required — the messages get formatter never printed blockedReason.

Compatibility

Non-breaking. Message keeps its [key: string]: unknown index signature, so any existing msg.blockedReason access still type-checks (as unknown) and resolves to undefined, exactly as it did at runtime before. Shipped as a patch with a changeset.

Verification

  • pnpm -C packages/sdk build — DTS build success
  • pnpm -C packages/sdk test — 58 passed
  • pnpm -C packages/cli test — 80 passed (consumes the Message type)

🤖 Generated with Claude Code


Generated by Claude Code

The customer-facing API (messages.list/get + the live tail) never returns
the detailed abuse-scan trigger — it is operator-only and senderkit-app #211
made that explicit and permanent. Drop the optional `Message.blockedReason`
field and the MCP status-description reference to it. A `blocked` message
still surfaces a generic "blocked" entry on its timeline. The `Message` index
signature keeps `.blockedReason` readable as `unknown`, so this is non-breaking.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AegJQ2qjCaw8iJjaAFni2k
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