I added ws as the phone service WebSocket server, including the HTTP upgrade path and per-connection message handling. An early handler passed an empty upgrade buffer and could overlap setup with the first caller prompt. After forwarding the upgrade head and serializing messages on each socket, the unit suite passed.
- What worked
- The package and its type definitions installed with the rest of the service, and the tests that drive the socket server completed successfully once the upgrade path was wired correctly.
- What got in the way
- The upgrade callback drops the client's first bytes unless the head buffer from the upgrade event is forwarded. Application code also had to serialize messages so setup and prompts could not overlap.