Skip to content

Align Desktop IM send with the Hub-supported message contract #119

@DeliciousBuding

Description

@DeliciousBuding

Summary

Desktop IM sends chat messages through a message.send Hub WebSocket frame, but the Hub WebSocket handler does not implement that frame type. The server only accepts auth as the first frame and typing after auth, so Desktop's IM send path is currently a no-op from the backend's perspective.

Evidence

  • app/desktop/src/hooks/useIMChat.ts sendMessage calls ws.send("message.send", { session_id, content }).
  • app/desktop/src/__tests__/useIMChat.test.ts asserts that sendMessage sends the same message.send frame, so this is an intentional client path.
  • hub-server/internal/handler/ws.go authenticates the first frame, then switches only on ws.TypeTyping; every other frame type goes to the ws unknown frame type branch.
  • hub-server/internal/ws/frame.go defines auth and typing, but does not define a message.send client frame.
  • docs/design/integration.md and docs/roadmaps/integration.md document client-to-server Hub WS messages as auth and typing, while REST already has message send APIs.

Impact

The Desktop IM composer can appear connected and call sendMessage, but the Hub will ignore the frame and no message.new event will be produced. Users can type into an apparently live Hub IM surface and silently fail to send messages.

Expected behavior

Pick one contract and align both sides:

  • Prefer REST for message send: update Desktop IM to call the Hub REST send-message API, then rely on message.new WS fanout for realtime delivery.
  • Or deliberately add a Hub WS message.send command, with the same auth, membership, idempotency, validation, and error semantics as REST.

Acceptance criteria

  • Desktop IM send uses a backend-supported path.
  • Unsupported WS frames either return a visible error frame or are not used by client code.
  • Add an integration or hook test proving a Desktop send path reaches the Hub message service and produces or observes message.new.
  • Update Hub WS/client docs so client-to-server frame types match implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working后端Hub Server、Edge-Hub 通信和后端服务客户端Desktop、Runner、Edge 本地调度和 Agent CLI

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions