[kimi] refactor: extract WebSocket message types into shared protocol module (#667) #696
Reference in New Issue
Block a user
Delete Branch "kimi/issue-667"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #667
Summary
src/infrastructure/protocol.pywith aMessageTypeStrEnum covering all 9 Matrix PROTOCOL.md types:agent_state,visitor_state,bark,thought,system_status,connection_ack,error,task_update,memory_flashto_json()andfrom_json()methodsWSMessage.from_json()dispatches to the correct subclass via a registry, falling back to the base class for unknown typestests/unit/test_protocol.py) covering round-trip serialisation, dispatch, enum completeness, and error handlingTest plan
tox -e formatpassestox -e unitpasses (2402 tests)tox -e lintpassestox -e pre-pushpasses (full CI mirror)