mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 01:50:44 +08:00
Fix WhatsApp same-session quote re-injection.
Strip @mention prefixes and widen history lookup so reply-to of the bot's own prior answer is not wrapped as [被引用消息] again. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2446993b11
commit
10ae4abc1d
3 changed files with 153 additions and 19 deletions
|
|
@ -1318,7 +1318,9 @@ def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
|||
quoted_info = extract_group_quoted_message(metadata=meta_for_group)
|
||||
quoted_text = str(quoted_info.get("quoted_text") or "").strip()
|
||||
if quoted_text:
|
||||
recent_messages = store.get_messages(str(session_id), limit=6)
|
||||
# Look back far enough to cover long tool loops; dedupe uses
|
||||
# assistant bodies so same-session reply-to will not re-inject.
|
||||
recent_messages = store.get_messages(str(session_id), limit=80)
|
||||
if should_inject_quoted_context(
|
||||
quoted_text=quoted_text,
|
||||
recent_messages=recent_messages,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue