← Back to PRs

#6790: Messages: randomize ack reactions

by ihciah open 2026-02-02 02:16 View on GitHub →
docs channel: telegram channel: whatsapp-web gateway commands agents
Summary: - Allow messages.ackReaction and WhatsApp ackReaction.emoji to accept emoji lists and randomize per message. - Ensure Telegram uses the randomized ack reaction via shared resolution logic. - Update schema/docs and add tests for selection + fallback behavior. Testing: - corepack pnpm vitest run src/channels/ack-reactions.test.ts src/agents/identity.test.ts - corepack pnpm vitest run src/telegram/bot.test.ts https://docs.openclaw.ai/gateway/configuration https://docs.openclaw.ai/channels/whatsapp <img width="356" height="300" alt="image" src="https://github.com/user-attachments/assets/518a5018-3385-411e-9707-3964459b08a7" /> <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR extends ack reactions to accept either a single emoji or a list of emojis, selecting a random emoji per message. Key changes: - Adds `resolveAckReactionChoice` in `src/channels/ack-reactions.ts` and uses it from `src/agents/identity.ts` (for `messages.ackReaction`) and from the WhatsApp web ack reaction monitor (for `channels.whatsapp.ackReaction.emoji`). - Updates config types and zod schemas to allow `string | string[]` for both message-level and WhatsApp-specific ack reaction configuration. - Updates docs to describe array behavior and adds tests for random selection and fallback/disable behavior. I wasn’t able to execute the vitest commands locally in this environment because `pnpm` isn’t available, so the review is based on code inspection only. <h3>Confidence Score: 4/5</h3> - This PR looks safe to merge with low risk; behavior changes are localized and covered by tests. - Changes are straightforward (parsing + random selection), used consistently across message-level and WhatsApp-specific ack reactions, and include targeted unit tests. Main remaining risk is small schema/type drift from duplicating the union shape in multiple places, and I couldn’t run tests in this environment. - src/channels/ack-reactions.ts; src/config/zod-schema.providers-whatsapp.ts; src/config/zod-schema.session.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs