fix(gateway): push the clarify text fallback on Telegram

This is the same bug class as #132516. When a native clarify card fails
definitively, the runner retries with the base numbered-text
send_clarify, and that goes out through adapter.send(). In Telegram's
default "important" mode the retry carried only the thread metadata, so
_notification_kwargs sent the question with disable_notification=True.
The user got no push and the clarify wait timed out unanswered.

Tag the fallback with is_approval_prompt, the human-decision marker
_notification_kwargs now honours. text_fallback_coro only runs for
adapters that override send_clarify natively (Telegram, Discord, Slack,
...). The only other reader of the marker is WeCom, and WeCom keeps the
base send_clarify, so no other adapter changes.
This commit is contained in:
kshitijk4poor authored and kshitij committed 2026-10-04 11:58:00 +05:30
1 parent 943d4caa47
commit af6f618d3d
1 file changed
+3 -1
+3 -1
View File
@@ -34,7 +34,9 @@ def text_fallback_coro(adapter, **send_kwargs):
if not isinstance(adapter, BasePlatformAdapter) \
or type(adapter).send_clarify is BasePlatformAdapter.send_clarify:
return None
return BasePlatformAdapter.send_clarify(adapter, **send_kwargs)
# A human-decision prompt: Telegram's "important" mode must push it, not deliver it silently (#132516).
metadata = {**(send_kwargs.pop("metadata", None) or {}), "is_approval_prompt": True}
return BasePlatformAdapter.send_clarify(adapter, metadata=metadata, **send_kwargs)
def _abort_for_outcome(outcome: str, *, session_key: str, clarify_mod) -> Optional[str]: