Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation, defaults, documentation, localization, and targeted tests consistently cover the requested behavior.
Review effort: Lite
Findings: None
What changed in this PR
Adds configurable OneBot v11 self-mention stripping while preserving existing behavior by default.
Changes:
- Adds
strip_self_mentionconfiguration with default-enabled compatibility behavior. - Preserves structured
Atcomponents and documents the setting in Chinese and English. - Adds parameterized coverage for mention configurations and grouping.
| File | Description |
|---|---|
astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py |
Applies configurable self-mention text handling. |
astrbot/core/config/default.py |
Defines the setting and default metadata. |
tests/unit/test_aiocqhttp_self_mention.py |
Tests enabled, disabled, and missing configuration cases. |
dashboard/src/i18n/locales/en-US/features/config-metadata.json |
Adds English setting text. |
dashboard/src/i18n/locales/zh-CN/features/config-metadata.json |
Adds Chinese setting text. |
docs/en/platform/aiocqhttp.md |
Documents the English configuration option. |
docs/zh/platform/aiocqhttp.md |
Documents the Chinese configuration option. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a group message mentions several bots, the OneBot v11 adapter removes this bot's first mention from each contiguous mention group while retaining other mentions in
message_str. An LLM consuming that text can therefore interpret a message addressed to multiple bots as addressed only to the other bots.Add a per-adapter
strip_self_mentiontoggle to the OneBot v11 configuration. It defaults totrue, including for existing configurations without the key, preserving current wake-prefix and command-matching behavior. Turning it off retains the bot's mention name and ID in the message text. StructuredAtcomponents remain intact in both modes.Includes Chinese and English setting descriptions and platform documentation. The setting hint notes that retaining mentions also affects commands matched against message text. This change does not attempt to infer model intent or filter invisible-only responses.
Validation:
ruff format .andruff check .passed in an isolated source copy using the existing container's dependencies.git diff --checkpassed.Summary by Sourcery
Make OneBot v11 self-mention stripping configurable while preserving legacy behavior by default.
New Features:
Enhancements:
Documentation:
Tests: