                 new-actions)))
 
         (catch Exception e
-          (let [msg (repl-error e)]
+          (let [msg (repl-error e {:when ::do-repl-rpc :command command :msg msg})]
             (>!! result-chan msg)
             (>!!output worker-state msg))
           worker-state)))))

    {:type :build-message
     :msg msg}))

(defn repl-error [e]
  (log/debug-ex e ::repl-error)
  {:type :repl/error
   :ex e})


              (pop-repl-state session-id)))

        (catch Exception e
          (let [msg (repl-error e {:when ::session-eval :msg msg})]
            (>!! tool-out msg)
            (>!!output worker-state msg))
          worker-state)))))
