fix(telegram): fail closed unusable callbacks

This commit is contained in:
ogt
2026-07-16 23:19:52 +08:00
parent d9487cd55a
commit cb7c775d12
11 changed files with 1178 additions and 81 deletions

View File

@@ -554,9 +554,13 @@ class TelegramSecurityInterceptor:
# 2026-04-01 Claude Code (ADR-050): 支援 read-only info actions (2-part format)
# 2026-04-20 P0.1 ogt + Claude Opus 4.7: drift_view_page 納入 INFO_ACTIONS
# payload 格式: drift_view_page:{report_id}_{page}(底線分隔,不跟冒號衝突)
INFO_ACTIONS = {"detail", "reanalyze", "history", "drift_view_page"}
from src.services.telegram_button_registry import (
registered_info_callback_actions,
)
info_actions = registered_info_callback_actions()
parts = callback_data.split(":")
if len(parts) == 2 and parts[0] in INFO_ACTIONS:
if len(parts) == 2 and parts[0] in info_actions:
return {
"action": parts[0],
"incident_id": parts[1],