Opus finding
BasePlatform `len_param_names > 3` check excludes valid handlers with default args
mediumbughigh
- backend/wonderwall/simulations/base.py:175-189
`func_code.co_varnames[:func_code.co_argcount]` includes all named positional/keyword args including defaults. A handler with `(self, agent_id, message, optional_flag=False)` will be rejected even though it is callable. This is a strict-fragile dispatcher; co_argcount includes self, so the limit of 3 is exactly (self, agent_id, message). Any subclass adding a fourth optional arg breaks at runtime, and the crash kills the message loop (see related finding).
Recommendation
Either pass `message` as the second positional and unpack inside handlers, or only count parameters without defaults. Document the contract explicitly.