|
|
@@ -49,6 +49,7 @@ logger = logging.getLogger(__name__)
|
|
|
from gateway.config import Platform, PlatformConfig
|
|
|
from gateway.platforms.base import (
|
|
|
BasePlatformAdapter,
|
|
|
+ ExecApprovalPrompt,
|
|
|
MessageEvent,
|
|
|
MessageType,
|
|
|
ProcessingOutcome,
|
|
|
@@ -2804,9 +2805,7 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
content = "\n".join(lines)
|
|
|
|
|
|
try:
|
|
|
- msg = await client.post_message(
|
|
|
- room_id=str(chat_id), body=content
|
|
|
- )
|
|
|
+ msg = await client.post_message(room_id=str(chat_id), body=content)
|
|
|
except ChattoError as e:
|
|
|
logger.warning("Chatto: send_clarify post failed: %s", e)
|
|
|
return SendResult(success=False, error=str(e), retryable=True)
|
|
|
@@ -2826,9 +2825,7 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
emoji=emoji,
|
|
|
)
|
|
|
except Exception:
|
|
|
- logger.debug(
|
|
|
- "Chatto: seed reaction %s failed", emoji, exc_info=True
|
|
|
- )
|
|
|
+ logger.debug("Chatto: seed reaction %s failed", emoji, exc_info=True)
|
|
|
|
|
|
prompt = _ClarifyPrompt(
|
|
|
clarify_id=clarify_id,
|
|
|
@@ -2843,7 +2840,9 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
|
|
|
return SendResult(success=True, message_id=message_id)
|
|
|
|
|
|
- async def _send_exec_approval_prompt(self, prompt) -> SendResult:
|
|
|
+ async def _send_exec_approval_prompt(
|
|
|
+ self, prompt: ExecApprovalPrompt
|
|
|
+ ) -> SendResult:
|
|
|
"""Post a reaction-driven exec-approval prompt.
|
|
|
|
|
|
BasePlatformAdapter override
|
|
|
@@ -2872,7 +2871,7 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
success=False, error="Chatto client not available", retryable=True
|
|
|
)
|
|
|
|
|
|
- smart_denied = bool(getattr(prompt, "smart_denied", False))
|
|
|
+ smart_denied = bool(prompt.smart_denied)
|
|
|
tier = "once"
|
|
|
if not smart_denied:
|
|
|
if "always" in choices:
|
|
|
@@ -2896,9 +2895,7 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
content = "\n".join(lines)
|
|
|
|
|
|
try:
|
|
|
- msg = await client.post_message(
|
|
|
- room_id=str(prompt.chat_id), body=content
|
|
|
- )
|
|
|
+ msg = await client.post_message(room_id=str(prompt.chat_id), body=content)
|
|
|
except ChattoError as e:
|
|
|
logger.warning("Chatto: send_exec_approval post failed: %s", e)
|
|
|
return SendResult(success=False, error=str(e), retryable=True)
|
|
|
@@ -2918,9 +2915,7 @@ class ChattoAdapter(BasePlatformAdapter):
|
|
|
emoji=emoji,
|
|
|
)
|
|
|
except Exception:
|
|
|
- logger.debug(
|
|
|
- "Chatto: seed reaction %s failed", emoji, exc_info=True
|
|
|
- )
|
|
|
+ logger.debug("Chatto: seed reaction %s failed", emoji, exc_info=True)
|
|
|
|
|
|
approval_prompt = _ApprovalPrompt(
|
|
|
session_key=str(prompt.session_key),
|