Productize scheduled success delivery, close WA pending, and clarify SQL scope grants.

Wrap successful scheduled jobs with a short WA header (+ attachment count), expire stale access pending and DM requesters on admin approve/deny, and add concrete next_steps for insufficient_scope:sql:query.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-10 23:52:41 +08:00
parent dff8901ae3
commit 4898adf7d0
10 changed files with 334 additions and 12 deletions

View file

@ -1052,8 +1052,12 @@ def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
)
channel_is_wa_bind = str(inbound.channel or "").strip().lower() == "whatsapp"
if info:
guide = _menu_text(channel=str(inbound.channel or ""))
reply = ("Bound successfully.\n\n" + guide) if channel_is_wa_bind else ("绑定成功。\n\n" + guide)
if channel_is_wa_bind:
from runtime.extensions.whatsapp.access_control import access_granted_guide_text
reply = access_granted_guide_text(lang="en")
else:
reply = "绑定成功。\n\n" + _menu_text(channel=str(inbound.channel or ""))
else:
reply = (
"Bind failed: invalid or already used code."