Skip to content

WebSocket support for persistent real-time connections #744

@chubes4

Description

@chubes4

Vision

WebSockets give Data Machine the always-on feel. The site feels alive — notifications arrive without polling, dashboards update themselves, agent presence is ambient. This is the persistent connection layer that complements HTTP Streaming (#743).

Why

  • Agent presence — your agent is there, not summoned per-request
  • Live notifications — flow completed, content published, error occurred — you see it instantly
  • Collaborative awareness — multiple users/agents editing the same site, changes reflected live
  • Dashboard vitality — job status, pipeline progress, agent activity — all updating without refresh
  • WordPress has never had native WebSocket support — every plugin that needs it builds a custom solution or depends on third-party services (Pusher, Ably, Socket.io)

What it enables

  • Agent status indicators — "thinking", "idle", "running flow X"
  • Push notifications — agent completed a task while you were on another page
  • Live admin dashboard — real-time job/flow/pipeline status without polling
  • Multi-user awareness — see what other users/agents are doing on the site
  • Inter-agent communication — agents on the same site coordinating in real-time

Implementation considerations

WordPress (PHP) is request-response by nature. Options:

  1. Sidecar process — lightweight Node.js or Go WebSocket server alongside WordPress. Communicates with DM via internal REST API or shared database. Most reliable, cleanest separation.
  2. PHP WebSocket server — libraries like Ratchet/ReactPHP. Runs as a separate long-lived PHP process. Keeps the stack single-language but PHP is not ideal for persistent connections.
  3. Action Scheduler + SSE polling hybrid — not true WebSockets but could approximate the feel with aggressive SSE polling. Worse UX, simpler infra.

Recommendation: Sidecar approach. A small Node.js or Go binary (could even be packaged with the plugin) that handles WebSocket connections and bridges to WordPress via REST API. Similar to how Kimaki works today, but embedded.

WordPress Core value

Like HTTP Streaming (#743), this is platform-level infrastructure. Every WordPress plugin that needs real-time — live chat, notifications, collaborative editing, AI streaming — reinvents this wheel. A native solution would be transformative for the ecosystem.

Together, SSE (#743) + WebSockets create the full real-time stack:

  • SSE = real-time workflow (request → streaming response)
  • WebSockets = always-on presence (persistent bidirectional connection)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions