439cca48be
Root cause: adapter.py referenced MessageType.BUTTON_CLICK which does
not exist in Hermes-Core (only TEXT, COMMAND, PHOTO, etc.). The heuristic
at line 1502 matched MOVE_REQ:room_id::✅Ja text payloads as button
responses, triggering the crash path in _dispatch_agent.
Changes:
1. Heuristic fix: exclude MOVE_REQ: prefix from button detection (line 1502)
2. MessageType.BUTTON_CLICK → MessageType.COMMAND in both dispatch sites
3. DRY refactor: extracted _message_type_for() helper method
4. Updated fallback exception handlers and log messages (BUTTON_CLICK → COMMAND)
5. Regression test: test_p1_button_click_fix.py (6 tests)
Verification:
- python3 -c "from gateway.platforms.base import MessageType; assert hasattr(MessageType,COMMAND)" → OK
- pytest test_v8_3_2.py -k confirm_move → PASSED
- grep BUTTON_CLICK plugin/adapter.py → 1 (docstring only)
- pytest plugin/ -k dispatch → 5 passed
- Full suite: 984 passed, 2 skipped, 0 failures