fix(message): include target in reply suppression tracking#25757
Closed
Suko wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(message): include target in reply suppression tracking#25757Suko wants to merge 1 commit intoopenclaw:mainfrom
Suko wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Contributor
|
Closing as superseded by #25923, which is now merged to What was carried over from this PR:
What #25923 additionally fixes (same incident cluster):
Thanks for the clear, minimal patch and write-up here; it directly informed the final merged solution. |
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.
Summary
messagetool schema routes recipients viatarget, butextractMessagingToolSendonly trackedargs.to, so sends usingtargetwere not recorded by the reply-suppression system.NO_REPLY/ reasoning) to end users on channels like Telegram, even when the agent already delivered content via themessagetool.extractMessagingToolSendnow resolves the recipient fromargs.to ?? args.targetforaction=send/thread-reply, so suppression tracking works for both parameter names.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
messagetool call usestarget(instead ofto) as the routing parameter. Prevents duplicate/leaked follow-up text.Security Impact (required)
Repro + Verification
Environment
Steps
messagetool usingaction=sendandtarget(notto).NO_REPLY(or any text).Expected
Actual (before)
Evidence
pnpm checkpassed;pnpm test:fastpassed.Human Verification (required)
pnpm check+pnpm test:fast.args.tocontinues to work;args.targetnow also works; non-send actions unaffected.Compatibility / Migration
Failure Recovery (if this breaks)
src/agents/pi-embedded-subscribe.tools.tsmessagetool sends.Risks and Mitigations
targetas a recipient for suppression could suppress replies in unexpected edge cases.toolName === "message"andaction in {send, thread-reply}; still requires a string recipient and provider normalization before suppression applies.Greptile Summary
Extends reply suppression tracking to support the
targetparameter in addition totofor themessagetool. The message tool schema accepts bothtoandtargetas routing parameters (src/agents/tools/message-tool.ts:301-307), butextractMessagingToolSendonly trackedargs.to, causing suppression to miss sends routed viatarget. This could result in duplicate messages or leaked post-tool text on channels like Telegram.The fix adds a fallback chain (
args.to ?? args.target) to resolve the recipient from either parameter name. The change is minimal, correctly scoped totoolName === "message"withactionin{send, thread-reply}, and preserves the existing normalization flow throughnormalizeTargetForProvider.Confidence Score: 5/5
toandtargetparameters as documented in the message tool schema. The implementation uses a proper fallback chain, maintains type safety, preserves existing validation logic, and is scoped to only the message tool's send/thread-reply actions. The PR description clearly documents scope boundaries and the author verified static checks pass.Last reviewed commit: 6f4d0df
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!