Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified, and focused validation and regression coverage are included.
Pull request overview
Adds optional explicit platform message-ID reply targeting to send_message_to_user.
Changes:
- Adds and documents
reply_to_message_id. - Validates IDs and prepends
Replycomponents. - Adds coverage for replies, validation, sessions, and permissions.
File summaries
| File | Description |
|---|---|
tests/unit/test_message_tools.py |
Tests explicit replies and regression behavior. |
astrbot/core/tools/message_tools.py |
Implements reply ID validation and message-chain construction. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kilisamemarisaaa
left a comment
There was a problem hiding this comment.
Reviewed head 37c9796. The optional reply_to_message_id is validated as a non-empty string before constructing the outgoing chain, the Reply component is placed before user content, and the existing target-session authorization path remains unchanged. The tests cover current and explicit sessions, OneBot serialization, invalid values, omitted values, and member cross-session denial. All required Linux/Windows/macOS pytest lanes, CodeQL, Ruff/format, build, and smoke checks are green. I found no correctness blocker.
The agent can send messages but cannot explicitly quote an earlier message, even though message chains already support
Reply. Add an optionalreply_to_message_idargument tosend_message_to_userso callers can quote a known platform message ID in the target session.Modifications
Replycomponent to the outgoing chain. Omitted arguments retain existing behavior and cross-session permission checks remain in place.Example tool arguments:
{"messages":[{"type":"plain","text":"About your earlier message..."}],"reply_to_message_id":"123456789"}Test Results
python -m pytest tests/unit/test_message_tools.py tests/unit/test_aiocqhttp_reply.py -q: 32 passed.ruff format .andruff check .: passed.git diff --check: passed.Checklist
Summary by Sourcery
Enable callers to quote a known earlier platform message when sending messages without changing existing sending behavior.
New Features:
Enhancements:
Documentation:
Tests: