Skip to content

fix(integrations): validate twilio, sendgrid, resend, mailgun, discord, telegram and whatsapp - #10073

Merged
waleedlatif1 merged 7 commits into
stagingfrom
sweep2/v3
Nov 16, 2026
Merged

waleedlatif1 merged 7 commits into
stagingfrom
sweep2/v3

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Validates the Twilio, Twilio Voice, SendGrid, Resend, Mailgun, Discord, Telegram and WhatsApp integrations against each vendor's official API spec, fixes what was wrong, and moves every block mapper in scope onto mapperOperation (added in #10070) so the operation is read from the tool-call context.

  • Every tool's endpoint, method, params, body, response parsing, outputs and auth/scopes was checked against the vendor's machine-readable spec. Claims that could not be verified were left unchanged.
  • Block mappers no longer read params.operation, which is undefined when a block runs as an Agent tool, in Pi or in Human-in-the-loop. Each operation's branch now runs on those paths too. Every newly live branch keeps the model's own args (via toolCallArg), accepts already-typed values, and never overwrites an arg with undefined.
  • Canvas requests for saved workflows are unchanged, except for the bug fixes listed below. No subBlock, operation, tool, param or output id was renamed or removed, and no OAuth scope was added.
  • The check:mapper-operation baseline shrinks for every block fixed here, and generated tool metadata and docs are regenerated.

Release notes

Twilio

  • SMS: the fromNumber and toNumber outputs now return the sender and recipient Twilio reports. Before, they were always empty.
  • SMS: new optional advanced Messaging Service SID field and tool parameter. Agent tool calls can send through a Messaging Service without a From number.
  • SMS: the copy now says each send reaches one recipient. Only the first line of Recipient Phone Number was ever sent; that behavior is unchanged.
  • SMS: full Twilio responses (recipient number and message body) are no longer written to the server logs.

Twilio Voice

  • Get Recording: transcriptionText, transcriptionStatus, and transcriptionPrice now come from the requested recording's own transcription. Before, the account-level list ignored the RecordingSid filter, so these fields could hold the newest transcription on the account, often from a different call. Recordings with no transcription now return these fields empty.
  • Get Recording's file, transcriptionPrice, and transcriptionPriceUnit outputs now appear in the block's output picker.
  • List Calls used as an Agent tool row now applies the stored To, From, Status, and Page Size filters. Before, they were dropped and the call listed every status with the default page size.
  • List Calls has a new optional Page Token input and nextPageToken output for paging past the first page. The agent can now set the date filters and page size.
  • Make Call: the duration output is now a number (or empty), not Twilio's raw string.

SendGrid

  • A Template ID saved under Send Mail (advanced field) no longer overrides the Template ID used by Get Template, Delete Template, or Create Template Version. Before, the wrong template could be deleted, read, or versioned.
  • A Page Size, Page Token, Generation filter, List IDs, Subject, or Name value left in a field from another operation no longer leaks into the current operation. For example, a List All Lists page size of 500 no longer makes List Templates fail with a 400.
  • As Agent tools, the stored List All Lists and List Templates Page Token is now applied on tool calls. Before, tool calls always returned the first page.
  • List, template, and contact IDs that contain a path separator or are a dot segment (. or ..) are now rejected instead of being sent to another endpoint. Valid IDs are unchanged.
  • List Templates: the description now states that SendGrid returns legacy templates only unless the generations filter includes dynamic. The valid values are legacy, dynamic, and legacy,dynamic. The request default is unchanged.

Resend

  • In both Resend blocks, an agent or tool call that sets a contact's unsubscribed to true now unsubscribes the contact. Before, a boolean true was turned into false, so agent-driven unsubscribes re-subscribed the contact. Canvas dropdown behavior is unchanged.
  • Send Email: Schedule At now accepts ISO 8601 timestamps with a UTC offset (for example 2026-11-16T09:00:00-08:00). Before, these were rejected with "Invalid request data".
  • List Contacts and List Domains have new optional Limit (1-100) and After (cursor) fields in advanced mode, so you can page past the first page. Workflows that leave them empty send the same request as before.
  • Create Broadcast has a new Segment ID field, which Resend now requires in place of the deprecated Audience ID. When it is set, the broadcast goes to the segment. Saved workflows with only an Audience ID still send audience_id. Audience ID is no longer marked required for this operation.
  • Get Broadcast: the replyTo output is now declared as an array of addresses, which matches what Resend returns. The value itself is unchanged.
  • Get Email: an email ID containing / or equal to .. is now rejected instead of being used to reach a different API path.

Mailgun

  • Add List Member used as an Agent tool (or in Pi / Human-in-the-loop v2) now adds the right member to the right list. Before, the stored Member Email and Member Name were ignored and the list address could be sent as the member address. When the call carries the block's Member Email and Member Name fields, those are sent as the member. When the model supplies listAddress and address, it adds the member it named to the list it named. Canvas requests are unchanged.
  • Add List Member as a tool now honors Subscribed = No and a model-sent false. Before, the string "false" was sent to Mailgun as subscribed=yes.
  • Known limitation, not fixed: in an Agent tool row, the field titled "List Address" is bound to the member address and Member Email/Name are not shown, so a pinned list address in a row does not work correctly yet.
  • Get Message now fills the from and subject outputs for sent messages retrieved by storage key, where Mailgun returns From/Subject.
  • Mailgun tools now reject a domain, list address, or storage key that contains a path separator or is empty, and they escape ? and # inside it. Valid values build the same request URL as before.

Discord

  • Send Message with attachments and empty content no longer posts the placeholder text "Message sent from Sim". The attachment posts with no text.
  • Update Member with mute/deaf left unset no longer sends mute: false / deaf: false, which unmuted and undeafened the member on every rename.
  • Update Member no longer server-mutes and deafens the member on every run. Server Mute and Server Deafen now have a "No change" option, which is the default for new blocks. Saved workflows already store "Mute member" / "Deafen member" and keep muting until you switch those fields to "No change".
  • Update Role no longer resets Display Separately and Mentionable on every run. Both have a "No change" option, which is the default for Update Role. Create Role defaults are unchanged. Saved Update Role workflows keep their stored values until edited.
  • Archive Thread given a real boolean true (for example from a block output reference) now archives the thread. It used to send archived: false.
  • Bulk Delete Messages, Archive Thread, Create Role, Create Invite, and Update Member now work correctly as Agent tools. Message IDs from the tool row are split, and true/false values are sent to Discord as booleans instead of strings. Before, bulk delete always failed with "got 1".
  • Server ID is no longer required for the 26 operations that are not server-scoped (channel, message, thread, invite, and webhook operations), because their endpoints don't use one. Agents can call them without guessing a guild ID, and the canvas field is required only for server-scoped operations.
  • Pin Message and Unpin Message now use Discord's current /channels/{channel_id}/messages/pins/{message_id} endpoint instead of the deprecated /pins one. Behavior is the same.
  • Get Messages used as an Agent tool accepts before/after/around message-ID cursors to page past the latest 100 messages.
  • Channel, message, user, and other IDs that contain a path separator are now rejected, instead of building a different request path.
  • Create Channel as an Agent tool uses the channel type the agent chooses again, instead of always making a text channel. The channel type now lists the supported values.
  • Ban Member as an Agent tool uses the agent's message-deletion window (deleteMessageSeconds) again, instead of deleting no messages.

Telegram

  • Telegram as an Agent tool (or in Pi / Human-in-the-loop v2): per-operation mapping now runs on tool calls. Poll options stored on the row are sent, Yes/No dropdowns are sent as real booleans, uploaded photo/video/audio/animation files are sent as their URLs, and a model's reaction emoji is applied. Before, Send Poll with stored options failed with "A poll requires at least 2 options" because the stored options were dropped. A numeric chat ID from the model no longer skips the mapping.
  • Messages and captions that contain a literal <, >, or & (for example "Latency < 200ms & rising") now send. Before, Telegram rejected them with "can't parse entities". Supported HTML tags such as <b> still pass through.
  • Markdown conversion no longer turns underscores inside words or link URLs into italics ([docs](https://x.com/a_b_c) keeps its URL), and no longer applies **/* emphasis inside code spans.
  • A supported HTML tag written inside a markdown code span or link URL (for example "use <b> for bold") is now sent as escaped literal text. Before, Telegram rejected the message with a parse error. This applies to message text, edits, and media captions.
  • Send Poll now allows 1 to 12 options, as the current Bot API does. Before, it required at least 2 and said the maximum was 10.
  • Send Video and Send Animation now expose the video and animation outputs (file_id, dimensions, duration, thumbnail, and so on). The format output never held data and is now documented as a legacy key.

WhatsApp

  • Send Media now lists its optional mediaId output (returned when a file is uploaded as part of the send) in its tool output schema. Runtime behavior for saved workflows does not change.

Review follow-ups

  • Twilio Send SMS can now send through a Messaging Service SID with no From number.
  • Out-of-range page sizes for Discord, Mailgun, Resend and Twilio Voice are clamped to each API's documented range instead of being rejected by the provider.
  • Telegram escapes a plain <span> (only tg-spoiler spans are kept) instead of the whole send failing, and strips NUL characters from message text.
  • Discord Get Messages errors when more than one of Before/After/Around is set.
  • Output nullability now matches each vendor's response for Discord, Resend, Twilio and Twilio Voice.

Testing

  • Each integration (or batch of blocks) was fixed by one agent and then reviewed by independent adversarial reviewers until it came back clean. Integrations got a vendor-spec/auth lens and a canvas-vs-tool-call/backward-compat lens; batches got the canvas-vs-tool-call lens.
  • Regression tests call each mapper the way the Agent path does, params(modelArgs, { operation }) without an operation in params, and were confirmed to fail on the pre-fix code.
  • Ran the touched test files, biome, check:mapper-operation, check:explicit-any, check:tool-metadata, check:docs, check:docs-manifest, check:block-successors, check:deployment-config, check:canvas-sentences, check:test-patterns, check:utils, check:comment-hygiene, check:source-conventions and check:integration-catalog locally. CI runs type-check and the full suite.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 16, 2026 1:40am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no blocking new issue was established.

Summary

This PR fixes integration inputs and outputs across eight messaging and email services.

  • Discord actions use the selected operation and the values supplied for it.
  • Telegram tool calls send the selected action’s values and handle message text safely.
  • Twilio SMS and Voice blocks return clearer results and support more request options.
  • SendGrid operations use only their own fields and keep identifiers within their intended API paths.
  • Resend lists can page, broadcasts can target segments, and contact choices keep their boolean values.
  • Mailgun tool calls add the named list member and return stored-message details.
  • WhatsApp exposes the media ID returned when a file is uploaded with a send.
  • Generated integration metadata and check baselines reflect the updated tool definitions.

Reviews (4) · Last reviewed commit: "chore: regenerate tool metadata and mapp..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 111 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/blocks/blocks/whatsapp.ts Resolved
Comment thread apps/sim/tools/discord/get_messages.ts Resolved
Comment thread apps/sim/tools/discord/get_messages.ts Resolved
Comment thread apps/sim/tools/discord/get_messages.ts Resolved
Comment thread apps/sim/tools/telegram/utils.ts Resolved
Comment thread apps/sim/tools/discord/edit_message.ts Resolved
Comment thread apps/sim/blocks/blocks/telegram.ts Resolved
Comment thread apps/sim/tools/telegram/utils.ts Resolved
Comment thread apps/sim/tools/resend/get_broadcast.ts Resolved
Comment thread apps/sim/blocks/blocks/twilio.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 111 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/tools/discord/get_user.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 111 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/tools/discord/get_user.ts Resolved
Comment thread apps/sim/tools/discord/get_user.ts Resolved
Comment thread apps/sim/tools/discord/get_user.ts Resolved
…l-call context and validate integrations against vendor specs
- twilio: trim account SID and From number once, mark sender/recipient outputs nullable, make From optional on the block when a Messaging Service is used
- discord: truncate fractional limits, reject more than one message cursor, mark nullable outputs
- telegram: only keep spoiler spans, drop NUL so input cannot alias a protected segment, mark optional animation fields, fall back to model poll options when the stored field is blank
- resend: clamp list limit to 1-100, sentence covers segment or audience, nullable broadcast outputs
- mailgun: clamp events limit to 300
- twilio voice: nextPageToken nullable
- fix test-types errors in twilio and whatsapp tests
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 111 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 0ea25f4 into staging Nov 16, 2026
85 checks passed
@waleedlatif1
waleedlatif1 deleted the sweep2/v3 branch November 16, 2026 04:00

This branch was successfully deployed

1 active deployment
Preview — c68bc75e Deployed Nov 16, 2026 by vercel[bot]
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.

1 participant