   (ws-msg {:type :repl/set-ns-complete :id id :ns ns}))
 
 (def close-reason-ref (volatile! nil))
+(def stale-client-detected (volatile! false))
 
 ;; FIXME: core.async-ify this
 (defn handle-message [{:keys [type] :as msg} done]

    nil

    :client/stale
    (vreset! close-reason-ref "Stale Client! You are not using the latest compilation output!")

    :client/no-worker
    (vreset! close-reason-ref (str "watch for build \"" env/build-id "\" not running"))

          (hud/connection-error (or @close-reason-ref "Connection closed!"))
          (vreset! socket-ref nil)
          (env/reset-print-fns!)
          (maybe-reconnect)
          ))

      (set! (.-onerror socket)
        (fn [e]
          (hud/connection-error "Connection failed!")
          (maybe-reconnect)
          (devtools-msg "websocket error" e))))
    (catch :default e
      (devtools-msg "WebSocket setup failed" e))))
