Commit 96d5d5a
committed
fix(slack): only reset bot turn counter on real user messages (parity with openabdev#497)
PR openabdev#498 fixed the bot-turn-reset bug in Discord by gating on_human_message
behind MessageType::Regular | InlineReply + non-empty content. Slack had
the same class of bug but only a partial defense: the skip_subtype blacklist
dropped channel_join/leave/topic/purpose, message_changed/deleted, but many
system-like subtypes still reached on_human_message and reset the counter:
- pinned_item / unpinned_item
- channel_name / channel_archive / channel_unarchive
- group_join / group_leave / group_topic / group_purpose (private channels)
- reminder_add
- tombstone
Extract is_plain_user_message(subtype, text) — a whitelist of
"" | me_message | thread_broadcast | file_share with non-empty content —
and gate the reset on it. Unit tests cover empty-text, whitelist, and the
full system-subtype blacklist.1 parent 3b9c07a commit 96d5d5a
1 file changed
Lines changed: 71 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1097 | 1120 | | |
1098 | 1121 | | |
1099 | 1122 | | |
| |||
1153 | 1176 | | |
1154 | 1177 | | |
1155 | 1178 | | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1156 | 1226 | | |
1157 | 1227 | | |
1158 | 1228 | | |
| |||
0 commit comments