Skip to content

Commit 04adcd4

Browse files
committed
Removed dead code and added comments.
1 parent 3a0a5d9 commit 04adcd4

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/eca/features/chat.clj

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
(defn ^:private get-active-tool-calls
5858
"Returns a map of tool calls that are still active.
5959
60-
Active tool calls are those not in the following states: :completed, :rejected, :stopped."
60+
Active tool calls are those not in the following (terminal) states: :completed, :rejected, :stopped."
6161
[db chat-id]
6262
(->> (get-in db [:chats chat-id :tool-calls] {})
6363
(remove (fn [[_ state]]
@@ -128,7 +128,7 @@
128128

129129
;; And now all the :stop-requested transitions
130130

131-
;; In the future, when calls can be interrupted,
131+
;; TODO: In the future, when calls can be interrupted,
132132
;; more states and actions will be required.
133133

134134
[:execution-approved :stop-requested]
@@ -442,7 +442,7 @@
442442
(transition-tool-call! db* chat-ctx id :auto-approve))
443443
;; Execute each tool call concurrently - this should be the return value of let
444444
(future
445-
(if @approved?*
445+
(if @approved?* ;TODO: Should there be a timeout here? If so, what would be the state transitions?
446446
;; assert: In :execution-approved state
447447
(do
448448
(assert-chat-not-stopped! chat-ctx)
@@ -657,23 +657,7 @@
657657

658658
;; Handle each active tool call
659659
(doseq [[tool-call-id _] (get-active-tool-calls @db* chat-id)]
660-
(transition-tool-call! db* chat-ctx tool-call-id :stop-requested)
661-
#_(let [{:keys [actions]} (stop-tool-call-atomically! db* chat-id tool-call-id)]
662-
(doseq [action actions]
663-
(case action
664-
:send-reject
665-
(when (should-send-notification? @db* chat-id tool-call-id :toolCallRejected)
666-
(send-content! chat-ctx :assistant {:type :toolCallRejected
667-
:id tool-call-id
668-
:reason :stop})
669-
(mark-notification-sent! db* chat-id tool-call-id :toolCallRejected))
670-
671-
:reject-approval
672-
;; This will send a toolCallRejected
673-
(deliver (get-in @db* [:chats chat-id :tool-calls tool-call-id :approved?*]) false)
674-
675-
(:wait-for-completion :no-action)
676-
nil))))
660+
(transition-tool-call! db* chat-ctx tool-call-id :stop-requested))
677661
(finish-chat-prompt! :stopping chat-ctx))))
678662

679663
(defn delete-chat

0 commit comments

Comments
 (0)