           worker-state)))))
 
 (defmethod do-proc-control :start-autobuild
-  [{:keys [build-config autobuild] :as worker-state} msg]
+  [{:keys [build-state autobuild] :as worker-state} msg]
   (if autobuild
     ;; do nothing if already in auto mode
     worker-state
     ;; compile immediately, autobuild is then checked later
     (-> worker-state
         (assoc :autobuild true)
-        (build-configure)
+        (cond->
+          (not build-state)
+          (build-configure))
         (build-compile)
         )))
 

                (build/compile)
                (build/flush)
                (build-find-hooks)
                (update ::compile-attempt inc))]

        (>!!output worker-state

  (async/close! chan)
  worker-state)

(defmethod do-proc-control :runtime-connect
  [{:keys [build-state] :as worker-state} {:keys [runtime-id runtime-out runtime-info]}]
  (log/debug ::runtime-connect {:runtime-id runtime-id})

  (>!! runtime-out {:type :repl/init
                    :repl-state
                    (-> (:repl-state build-state)
                        (update :repl-sources repl-sources-as-client-resources build-state))})

  ;; (>!!output worker-state {:type :repl/runtime-connect :runtime-id runtime-id :runtime-info runtime-info})

  ;; don't do anything that takes time here until race condition is fixed
  ;; otherwise things may try to access the repl-state that hasn't been set yet
  (-> worker-state
      (cond->
        (zero? (count (:runtimes worker-state)))
        (assoc :default-runtime-id runtime-id))
      (update :runtimes assoc runtime-id
        {:runtime-id runtime-id
         :runtime-out runtime-out
         :runtime-info runtime-info
         :connected-since (System/currentTimeMillis)
         :init-sent true})))

(defn maybe-pick-different-default-runtime [{:keys [runtimes default-runtime-id] :as worker-state} runtime-id]
  (cond
