#3395·picoclaw

[Feature]Make OneBot auto-ack reaction configurable (reaction_enabled setting)

Author: ycsqwanCreated Sep 27, 2026Updated Sep 27, 2026

The Goal / Use Case

I run PicoClaw with the OneBot channel (QQ via NapCat) and noticed that every group message gets an automatic emoji acknowledgement (set_msg_emoji_like, emoji 289). The reaction is hardcoded in OneBotChannel.ReactToMessage and triggered unconditionally by the channel-layer capability dispatch in pkg/channels/base.go (HandleMessageWithContext), with no configuration switch anywhere to turn it off. In an active group this is quite disruptive to the reading experience:

  • Every single message the bot sees is reacted to, so each one is followed by a visible reaction bubble and a grayTip line like … 回应了你的消息 under it — the chat quickly fills up with these
ImageImage
  • The impression is that the bot is "commenting on" every message, which reads as noisy rather than helpful. It's a small thing, but it currently makes the bot hard to use in any lively group.

Proposed Solution

A simple per-channel opt-in switch under the existing OneBot settings block:

json
"channel_list": {
  "onebot": {
    "settings": { "reaction_enabled": false }
  }
}
  • Default false, so groups stay quiet unless the user explicitly enables the ack (the ack remains one WebUI toggle away for those who like it).
  • Would surface automatically in the WebUI OneBot panel (booleans render as a switch via the generic form), with zh/en labels.
  • Env override: PICOCLAW_CHANNELS_ONEBOT_REACTION_ENABLED.

Potential Implementation (Optional)

I went ahead and prototyped this locally to check it's feasible — a small, self-contained patch (~150 lines across 7 files):

  1. pkg/config/config.go — add ReactionEnabled bool to OneBotSettings with json/env tags (mirrors existing fields like ReconnectInterval).
  2. pkg/config/defaults.go — default "reaction_enabled": false.
  3. pkg/channels/onebot/onebot.go — early-return a no-op undo func at the top of ReactToMessage when c.config == nil || !c.config.ReactionEnabled. This single gate covers both the automatic dispatch path in base.go and any agent-side reaction tool.
  4. web/frontend/.../generic-form.tsx + i18n/en.json + zh.json — hint text and labels for the toggle.
  5. Unit tests in pkg/channels/onebot covering: disabled → no-op (no HTTP call), enabled → reaction sent, private chat → no-op. If the approach seems reasonable to the maintainers, I'd be glad to open a PR — or of course drop it if you'd rather solve this differently.

Impact & Roadmap Alignment

  • This is a Core Feature
  • This is a Nice-to-Have / Enhancement
  • This aligns with the current Roadmap

Alternatives Considered

  • Global reaction disable — reactions are a generic ReactionCapable channel concept; gating at the OneBot layer keeps the change minimal and avoids touching other channels. Feishu already has its own random_reaction_emoji knob, so per-channel config seems to fit the existing pattern.
  • Default true (preserve current behaviour) — happy to flip to this if you prefer behaviour preservation on upgrade; I leaned quiet-by-default but don't feel strongly.
  • Fork/patch downstream — what I was doing until now; I suspect other self-hosted users would benefit from this being upstream, so I'd rather contribute it back if it's welcome.

Additional Context

  • Environment: AOSC OS / LoongArch64, PicoClaw 0.3.1, QQ via NapCat (OneBot 1.11), frontend built from source.
  • AI disclosure: as stated in CONTRIBUTING.md, the prototype was written with AI assistance; I've read through it, tested it locally (enabled / disabled / private-chat paths) and can provide logs or a screenshot of the noisy-reaction behaviour on request.
  • Thanks again for taking a look, and for your patience with a first-time contributor!