4040
4141
4242@lru_cache
43- def setup_handlers (app : App ):
43+ def setup_handlers (app : App ) -> None :
4444 """Register handlers. Intentionally minimal—no branching here."""
4545 app .event ("app_mention" )(mention_handler )
4646 app .event ("message" )(unified_message_handler )
@@ -53,7 +53,7 @@ def setup_handlers(app: App):
5353# ================================================================
5454
5555
56- def mention_handler (event : Dict [str , Any ], ack : Ack , body : Dict [str , Any ], client : WebClient ):
56+ def mention_handler (event : Dict [str , Any ], ack : Ack , body : Dict [str , Any ], client : WebClient ) -> None :
5757 """
5858 Channel interactions that mention the bot.
5959 - If text after the mention starts with 'feedback:', store it as additional feedback.
@@ -84,7 +84,7 @@ def mention_handler(event: Dict[str, Any], ack: Ack, body: Dict[str, Any], clien
8484 )
8585
8686
87- def dm_message_handler (event : Dict [str , Any ], event_id , client : WebClient , body : Dict [str , Any ]):
87+ def dm_message_handler (event : Dict [str , Any ], event_id : str , client : WebClient , body : Dict [str , Any ]) -> None :
8888 """
8989 Direct messages:
9090 - 'feedback:' prefix -> store as conversation-scoped additional feedback (no model call).
@@ -108,7 +108,7 @@ def dm_message_handler(event: Dict[str, Any], event_id, client: WebClient, body:
108108 )
109109
110110
111- def thread_message_handler (event : Dict [str , Any ], event_id , client : WebClient , body : Dict [str , Any ]):
111+ def thread_message_handler (event : Dict [str , Any ], event_id : str , client : WebClient , body : Dict [str , Any ]) -> None :
112112 """
113113 Thread messages:
114114 - Ignore top-level messages (policy: require @mention to start).
@@ -150,7 +150,7 @@ def thread_message_handler(event: Dict[str, Any], event_id, client: WebClient, b
150150 )
151151
152152
153- def unified_message_handler (event : Dict [str , Any ], ack : Ack , body : Dict [str , Any ], client : WebClient ):
153+ def unified_message_handler (event : Dict [str , Any ], ack : Ack , body : Dict [str , Any ], client : WebClient ) -> None :
154154 """Handle all message events - DMs and channel messages"""
155155 logger .debug ("Sending ack response" )
156156 ack ()
@@ -169,7 +169,7 @@ def unified_message_handler(event: Dict[str, Any], ack: Ack, body: Dict[str, Any
169169 thread_message_handler (event = event , event_id = event_id , client = client , body = body )
170170
171171
172- def feedback_handler (ack : Ack , body : Dict [str , Any ], client : WebClient ):
172+ def feedback_handler (ack : Ack , body : Dict [str , Any ], client : WebClient ) -> None :
173173 """Handle feedback button clicks (both positive and negative)."""
174174 logger .debug ("Sending ack response" )
175175 ack ()
@@ -234,10 +234,10 @@ def _common_message_handler(
234234 thread_root : str ,
235235 client : WebClient ,
236236 event : Dict [str , Any ],
237- event_id ,
237+ event_id : str ,
238238 post_to_thread : bool ,
239239 body : Dict [str , Any ],
240- ):
240+ ) -> None :
241241 channel_id = event ["channel" ]
242242 user_id = event .get ("user" , "unknown" )
243243 if message_text .lower ().startswith (constants .FEEDBACK_PREFIX ):
0 commit comments