fix(approval): honor allow_session across all button adapters

Widen the allow_session tier from Matrix to every adapter the gateway
notifies: Telegram, Discord, Slack, Feishu, and Teams gate their Session
button on it; WhatsApp Cloud and qqbot accept the kwarg (no session tier
in their button sets). Also thread allow_session through the plugin-
escalation gate, the execute_code guard payload, and the plain-text
fallback so every notify path carries the same capability flags.
This commit is contained in:
Teknium 2026-07-21 06:41:36 -07:00
parent a3297bd232
commit 02d8cbadec
7 changed files with 16 additions and 6 deletions

View file

@ -2004,6 +2004,7 @@ class FeishuAdapter(BasePlatformAdapter):
description: str = "dangerous command",
metadata: Optional[Dict[str, Any]] = None,
allow_permanent: bool = True,
allow_session: bool = True,
smart_denied: bool = False,
) -> SendResult:
"""Send an interactive card with approval buttons.
@ -2028,7 +2029,7 @@ class FeishuAdapter(BasePlatformAdapter):
}
actions = [_btn("✅ Allow Once", "approve_once", "primary")]
if not smart_denied:
if not smart_denied and allow_session:
actions.append(_btn("✅ Session", "approve_session"))
if allow_permanent:
actions.append(_btn("✅ Always", "approve_always"))