Skip to content

Commit 66ce4ce

Browse files
fix volume save
1 parent a647745 commit 66ce4ce

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

runbook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ docker run --rm \
5959
"$(uname -o)" \
6060
local/prompts/eslint \
6161
--pat "$(cat ~/.secrets/dockerhub-pat-ai-tools-for-devs.txt)" \
62-
--jsonrpc
63-
62+
--thread-id "something" \
63+
--save-thread-volume
6464
```

src/prompts.clj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
(update-in m [:prompts] (fn [coll] (remove (fn [{:keys [type]}] (= type (second args))) coll)))))
301301

302302
(= "run" (first args))
303-
(with-volume
303+
(apply with-volume
304304
(fn [thread-id]
305305
(select-keys
306306
(async/<!! (apply conversation-loop (concat (rest args) [:thread-id thread-id])))
@@ -324,7 +324,7 @@
324324
(defn- add-arg [options args k]
325325
(if-let [v (k options)] (concat args [k v]) args))
326326

327-
(def output-handler (fn [x] (jsonrpc/notify {:message {:content (json/generate-string x)}})))
327+
(def output-handler (fn [x] (jsonrpc/notify :message {:content (json/generate-string x)})))
328328
(defn output-prompts [coll]
329329
(jsonrpc/notify {:message {:content "## Prompts:\n"}})
330330
(->> coll
@@ -333,7 +333,7 @@
333333
content]))
334334
(interpose "\n")
335335
(apply str)
336-
((fn [s] (jsonrpc/notify {:message {:content s}})))))
336+
((fn [s] (jsonrpc/notify :message {:content s})))))
337337

338338
(defn -main [& args]
339339
(try
@@ -348,9 +348,7 @@
348348
((if (:pretty-print-prompts options) output-prompts output-handler)
349349
(apply -run-command (concat
350350
arguments
351-
(reduce (partial add-arg options) [] [:url :pat :host-dir :prompts])
352-
(when (:offline options) [:offline true])
353-
(when (:save-thread-volume options) [:save-thread-volume true])))))
351+
(reduce (partial add-arg options) [] [:url :pat :host-dir :prompts :thread-id :offline :save-thread-volume])))))
354352
(catch Throwable t
355353
(warn "Error: {{ exception }}" {:exception t})
356354
(System/exit 1))))

0 commit comments

Comments
 (0)