fix: restore message tool suppression to prevent duplicate messages #19
Reference in New Issue
Block a user
Delete Branch "fix/message-tool-suppression"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Restores the message tool suppression feature that was accidentally removed during refactoring. This prevents users from receiving duplicate messages when the agent uses the message tool to reply to them.
Problem
When the agent uses the
messagetool to send a reply to the same channel/chat_id as the incoming message, users receive TWO messages:Solution
_sent_in_turntracking to MessageToolChanges
nanobot/agent/tools/message.py: Add_sent_in_turnfield,start_turn()method, and tracking logicnanobot/agent/loop.py: Callstart_turn()at beginning, check flag before sending final replyTesting
All 5 tests in
test_message_tool_suppress.pynow pass:History
This feature was originally implemented in commits
fafd8d4(Feb 26) and29e6709(Feb 27), but was accidentally removed during subsequent refactoring.🤖 Generated with Claude Code