mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-10-20 05:15:31 +00:00
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:
parent
a3297bd232
commit
02d8cbadec
7 changed files with 16 additions and 6 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue