Skip to content

feat: add react_remove tool for removing emoji reactions#496

Open
oskarszoon wants to merge 1 commit intospacedriveapp:mainfrom
oskarszoon:feat/unreact-tool
Open

feat: add react_remove tool for removing emoji reactions#496
oskarszoon wants to merge 1 commit intospacedriveapp:mainfrom
oskarszoon:feat/unreact-tool

Conversation

@oskarszoon
Copy link

Summary

  • Adds a react_remove channel tool that sends OutboundResponse::RemoveReaction, allowing agents to remove emoji reactions they previously added to messages
  • Mirrors the existing react tool structure — same lifecycle (added/removed with other channel tools), same parameter shape (single emoji)
  • Enables the "react with 👀 → respond → clean up 👀" pattern that agents need for acknowledgment workflows

Motivation

The RemoveReaction variant already exists on OutboundResponse and is handled by the messaging adapters (Slack fully implements it via reactions_remove, others gracefully no-op). But there was no tool exposing it to agents — they could add reactions but never remove them.

Changes

File Change
src/tools/react_remove.rs New tool, mirrors ReactTool but sends RemoveReaction
prompts/en/tools/react_remove_description.md.j2 Tool description for agent prompt injection
src/tools.rs Module registration, pub exports, wired into add_channel_tools() / remove_channel_tools()
src/prompts/text.rs Prompt registry entry for tools/react_remove

Adapter support

Adapter RemoveReaction support
Slack Full (reactions_remove API)
Mattermost Full
Discord No-op
Telegram No-op
Signal Logs warning, drops

Adapter implementations for Discord/Telegram/Signal are out of scope for this PR — the plumbing is in place for when those platforms add support or workarounds are found.

Test plan

  • cargo fmt --all passes
  • No new compiler warnings from react_remove.rs
  • Tested on Slack: agent reacts with 👀, responds, then removes reaction

Mirrors the existing react tool but sends RemoveReaction, allowing
agents to clean up acknowledgment emojis (e.g. 👀) after responding.
Wired into channel tool lifecycle alongside react.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2b3c2f47-229e-409d-924f-42e30c582487

📥 Commits

Reviewing files that changed from the base of the PR and between b7d5dd2 and 1cbd52d.

📒 Files selected for processing (4)
  • prompts/en/tools/react_remove_description.md.j2
  • src/prompts/text.rs
  • src/tools.rs
  • src/tools/react_remove.rs

Walkthrough

A new "react_remove" tool has been added to enable removal of emoji reactions from messages. The implementation includes a new tool module, Jinja template prompt file, tool registration in the framework, and corresponding prompt lookup entry.

Changes

Cohort / File(s) Summary
Prompt template
prompts/en/tools/react_remove_description.md.j2
Added Jinja template file containing instruction text for the react_remove tool describing emoji reaction removal behavior.
Tool implementation
src/tools/react_remove.rs
New module implementing ReactRemoveTool with Tool trait, handling emoji removal via OutboundResponse::RemoveReaction, including argument parsing, error handling, and JSON schema-based tool definition.
Tool registration and integration
src/tools.rs, src/prompts/text.rs
Updated tool module to register ReactRemoveTool in add_channel_tools() and remove_channel_tools(), added public re-exports; updated prompt lookup to map tools/react_remove key to the new template file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new react_remove tool for removing emoji reactions, which is the primary focus of this PR.
Description check ✅ Passed The description is well-structured and directly related to the changeset, covering motivation, implementation details, adapter support, and test plan.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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