Detect assistant-authored cards / confirmations that should never be rerouted.
(text: Any)
| 864 | |
| 865 | |
| 866 | def looks_like_bot_authored_message(text: Any) -> bool: |
| 867 | """Detect assistant-authored cards / confirmations that should never be rerouted.""" |
| 868 | normalized = str(text or "").strip() |
| 869 | if not normalized: |
| 870 | return False |
| 871 | |
| 872 | if any(normalized.startswith(prefix) for prefix in BOT_AUTHORED_PREFIXES): |
| 873 | return True |
| 874 | |
| 875 | if "你的学术画像" in normalized and "你可以直接说:" in normalized: |
| 876 | return True |
| 877 | |
| 878 | if "你的学术画像周度报告" in normalized and "推送论文总数" in normalized: |
| 879 | return True |
| 880 | |
| 881 | if "今日反馈已记录" in normalized and "画像已更新" in normalized: |
| 882 | return True |
| 883 | |
| 884 | if "选择方式(任选)" in normalized and "快捷命令" in normalized: |
| 885 | return True |
| 886 | |
| 887 | if "Reading reports created (" in normalized and "Open the links above to start reading." in normalized: |
| 888 | return True |
| 889 | |
| 890 | if "Reading reports created (" in normalized and "doc_token:" in normalized: |
| 891 | return True |
| 892 | |
| 893 | if normalized.startswith("收到 PDF,") and "正在生成精读报告" in normalized: |
| 894 | return True |
| 895 | |
| 896 | if normalized.startswith("[精读]"): |
| 897 | return True |
| 898 | |
| 899 | if "必读清单" in normalized and "添加方式:" in normalized and "移除方式:" in normalized: |
| 900 | return True |
| 901 | |
| 902 | if "学术画像已更新" in normalized and "最后更新" in normalized and "你可以随时回复调整" in normalized: |
| 903 | return True |
| 904 | |
| 905 | return False |
| 906 | |
| 907 | |
| 908 | def safe_console_text(text: Any, max_len: int = 120) -> str: |
no outgoing calls
no test coverage detected