← Back to PRs

#20732: fix(signal): forward replyTo as quoteTimestamp/quoteAuthor for native threading

by arjunblj open 2026-02-19 07:52 View on GitHub →
channel: signal size: M
## Summary - Problem: Signal reply threading (quote bubbles) doesn’t work because `replyToId` is never mapped to signal-cli’s `quoteTimestamp`/`quoteAuthor` JSON-RPC fields. - Why it matters: without native quote bubbles, replies in busy threads are ambiguous and the UX regresses to plain-text quoting. - What changed: thread `replyToId` + new `replyToAuthor` through the outbound pipeline and forward them as `quoteTimestamp`/`quoteAuthor` for Signal. - What did NOT change: no config defaults, no gateway routing changes, no behavior changes for other channels. ## Root cause The outbound pipeline already carries `replyToId`, but Signal didn’t implement any mapping. - Telegram/Discord/Slack map `replyToId` in their outbound adapters. - Signal’s outbound adapter ignored `replyToId`. - Additionally, Signal’s primary send path in `deliver.ts` bypasses the outbound adapter for markdown→Signal styled-text formatting, so fixing only the adapter is insufficient. Signal also requires the quoted message author (`quoteAuthor`) in addition to the quoted message timestamp (`quoteTimestamp`). The pipeline didn’t carry this, so this PR adds `replyToAuthor` as an additive optional field. ## Behavior details - Quote params are only included when both are present: - `replyToId` parses as a positive integer timestamp - `replyToAuthor` is provided (non-empty) - If `replyToAuthor` is missing, we send a normal message (no partial quote payload). - For chunked Signal sends, the quote bubble is attached only to the first chunk. ## Changes - Add `quoteTimestamp`/`quoteAuthor` to `SignalSendOpts` and include them in the Signal `send` JSON-RPC call - Add `replyToAuthor` to `ChannelOutboundContext` and thread it through: - message-action-runner → outbound-send-service → message → deliver - Update Signal’s inline send path in `deliver.ts` to forward quote params - Update Signal outbound adapter to map `replyToId`/`replyToAuthor` → `quoteTimestamp`/`quoteAuthor` - Accept `replyToAuthor` or `quoteAuthor` as the message tool param name (alias) ## Usage ``` message action=send channel=signal target=<recipient> message="exactly" replyTo=<message_timestamp> replyToAuthor=<sender_uuid> ``` ## Test plan - `pnpm check` - `npx vitest run src/infra/outbound/deliver.test.ts src/infra/outbound/outbound-send-service.test.ts src/infra/outbound/message.test.ts` ## Manual verification (not in CI) Not run against a live Signal account/daemon in this PR. Suggested quick check: 1. Send a Signal DM or group message. 2. Reply with `replyTo=<ts>` + `replyToAuthor=<uuid>`. 3. Confirm the recipient UI shows a native quote bubble. 4. Send a multi-paragraph reply that chunks and confirm only the first chunk is quoted. ## Security impact - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No (same signal-cli daemon) - Command/tool execution surface changed? Yes (additive `replyToAuthor` param for Signal quote bubbles) ## AI assistance AI-assisted (Cursor). I reviewed the full outbound pipeline and added unit tests to lock the parameter forwarding behavior.

Most Similar PRs