Skip to content

fix(sdk): blocked reason is operator-only, not an API-returned field#54

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

fix(sdk): blocked reason is operator-only, not an API-returned field#54
tuyakhov wants to merge 1 commit into
mainfrom
claude/amazing-bardeen-htw3oh

Conversation

@tuyakhov

Copy link
Copy Markdown
Contributor

Why

Periodic sync review of senderkit-app main since the last SDK sync (SDK PR #44, which covered app #196 — the blocked status). New app PRs reviewed: #197 → #211. One of them, senderkit-app #211 ("keep spam-detection detail out of customer-visible surfaces"), directly contradicts a field the SDK currently documents.

The issue

SDK PR #44 added an optional Message.blockedReason field, documented as "the human-readable reason a blocked message was halted." But the app's message read endpoints never returned it:

  • getMessage / listMessages (backing GET /api/v1/messages/:id and GET /api/v1/messages) project an explicit messageColumns set that does not include blockedReason — and never has.
  • App #211 makes this permanent and test-guarded: the detailed abuse/anti-phishing signal breakdown is deliberately operator-only (admin abuse review), so a sender can't learn how detection works. The tests now assert blockedReason is absent from the list/get projection and the SSE tail.

So Message.blockedReason advertised a field that is never populated on any SDK/MCP/CLI response.

Changes (SDK)

  • packages/sdk/src/types.ts — remove the Message.blockedReason field and reword the status doc to note the block reason is operator-only / not returned. The [key: string]: unknown index signature is unchanged, so this is not a runtime change for any caller.
  • packages/sdk/src/mcp-schemas.ts — drop the MESSAGE_STATUSES comment claiming the trigger lives on the message's blockedReason.
  • Changeset: @senderkit/sdk patch + @senderkit/cli patch.

Not changed (intentionally)

Other app PRs reviewed — no SDK/CLI/MCP action needed

App PR Summary Why no SDK impact
#210 docs: agent-driven Supabase wiring (MCP) Spec+plan for app-only MCP management tools (senderkit_supabase_*) Docs only; PR states the public @senderkit/sdk is untouched — these are app-internal management tools, not SDK manifest surface
#203 feat(logs): load older history Logs UI paging over the existing GET /api/v1/messages?cursor=… "No new API/query"; cursor codec refactor is wire-compatible — pagination contract unchanged
#200 feat(managed-ses): retune shared-sender caps Server-side reputation caps per plan Internal config; not part of any SDK-documented surface
#197 docs(marketing) · #198/#199/#201/#205/#206/#202/#211¹ abuse · #207/#208/#209 onboarding/admin UI Marketing copy, abuse-detection internals/tuning, admin & onboarding UI Internal / UI only — no API contract change

¹ #211 is the abuse PR that triggered this SDK doc correction (above).

Verification

pnpm build, pnpm typecheck (all packages incl. examples), and tests pass — 58 sdk + 80 cli green.

🤖 Generated with Claude Code


Generated by Claude Code

senderkit-app's message read endpoints (GET /api/v1/messages and
GET /api/v1/messages/:id) project a lean column set that never includes the
detailed abuse `blockedReason` — the anti-phishing/spam signal breakdown is
deliberately operator-only so a sender can't learn how detection works. App
#211 locks this in (test-guarded across list, get, and the SSE tail).

A prior release documented an optional `Message.blockedReason` field as if the
API returned it; it never did. Correct the SDK surface to match reality:

- types.ts: remove the `Message.blockedReason` field and reword the `status`
  doc. The `[key: string]: unknown` index signature is unchanged, so this is
  not a runtime change for callers.
- mcp-schemas.ts: drop the MESSAGE_STATUSES comment claiming the trigger is on
  the message's `blockedReason`.

The `blocked` lifecycle status itself is unaffected — still a real returned
`status` value, still in MESSAGE_STATUSES and the messages_list status filter.

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