fix(auto-reply): hide direct-chat metadata without sender-id sentinel#24373
fix(auto-reply): hide direct-chat metadata without sender-id sentinel#24373
Conversation
|
Merged with admin CI bypass per maintainer instruction. Head pinned: ca54355. |
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
|
@obviyus After this PR, agents in direct chats can no longer access sender_id. This breaks proactive messaging scenarios — e.g. the message tool needs a target to send to the user, but there's no reliable way to obtain one from the current metadata. What's the intended approach for this? |
|
@Lanfei Good catch! This was intentional: we removed Proactive sends should use the trusted route target (chat_id in inbound metadata) or rely on message-tool current-session target inference (no explicit target needed for same chat). If you have a concrete flow where those are insufficient, please let me know. I can take a look. |
|
@obviyus Thanks! One follow-up: |
|
@Lanfei With channel=telegram, target="telegram:" is treated as a direct id (no directory lookup). The current limitation is channel selection, not Telegram id parsing: for proactive sends to another user, you must pass both channel and target (unless sending in current-session context where channel/target can be inferred). Maybe we can also add a follow-up enhancement to infer channel from provider-prefixed targets when channel is omitted. |
|
@obviyus Thanks for the clarification! Just to confirm: is using Also, in a multi-account setup, the message tool requires the correct |
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
…openclaw#24373) thanks @jd316 Co-authored-by: jd316 <138361777+jd316@users.noreply.github.com> Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Supersedes #22054 (author branch was force-reset and maintainers no longer had push rights).
What changed
message_id,message_id_full,reply_to_id,sender_id, andsenderin direct chats inbuildInboundUserContextPrefix.ChatTypeonly (remove sender-id sentinel behavior).Validation
pnpm vitest run src/auto-reply/reply/inbound-meta.test.tsGreptile Summary
Removes sender-id sentinel behavior that could allow group chats to be misclassified as direct chats. Now hides
message_id,message_id_full,reply_to_id,sender_id, andsendermetadata strictly based on the normalizedChatTypevalue, preventing spoofing attacks where a malicious sender could setsender_idto a special value likeopenclaw-control-uito trigger direct-chat handling in a group context.ChatType: "group"instead of"direct"for tests that verify group metadata visibilityConfidence Score: 5/5
ChatTypefield rather than allowing sender-id values to override it. All modified tests now correctly useChatType: "group"for group chat scenarios, and two new tests specifically guard against the vulnerability. The logic changes are confined to conditional checks that hide metadata in direct chats, which is the intended behavior.Last reviewed commit: 1212258