Skip to content

Commit 6c34971

Browse files
ArthurHeymanseca
andcommitted
refactor: remove unnecessary external-id from tool-call state
The external-id (thought signature for Google Gemini) doesn't need to be stored in the tool-call state because: 1. The tool-call object from the LLM provider already contains it 2. When adding to history, we use the original tool-call object which preserves the external-id 3. The tool-call state is only for tracking execution status, not for reconstructing tool-calls This addresses review feedback on PR #234 about why external-id was stored in the state. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <[email protected]>
1 parent fa88086 commit 6c34971

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/eca/features/chat.clj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@
560560
:server (:server event-data)
561561
:arguments (:arguments event-data)
562562
:origin (:origin event-data)
563-
:external-id (:external-id event-data)
564563
:decision-reason {:code :none
565564
:text "No reason"})
566565

@@ -1125,7 +1124,7 @@
11251124
:finish (do (add-to-history! {:role "assistant"
11261125
:content [{:type :text :text @received-msgs*}]})
11271126
(finish-chat-prompt! :idle chat-ctx))))
1128-
:on-prepare-tool-call (fn [{:keys [id full-name arguments-text external-id]}]
1127+
:on-prepare-tool-call (fn [{:keys [id full-name arguments-text]}]
11291128
(assert-chat-not-stopped! chat-ctx)
11301129
(let [tool (tool-by-full-name full-name all-tools)]
11311130
(transition-tool-call! db* chat-ctx id :tool-prepare
@@ -1134,7 +1133,6 @@
11341133
:full-name full-name
11351134
:origin (:origin tool)
11361135
:arguments-text arguments-text
1137-
:external-id external-id
11381136
:summary (f.tools/tool-call-summary all-tools full-name nil config)})))
11391137
:on-tools-called (on-tools-called! chat-ctx received-msgs* add-to-history!)
11401138
:on-reason (fn [{:keys [status id text external-id]}]

test/eca/features/chat_tool_call_state_test.clj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
:server "eca"
3636
:arguments tool-arguments
3737
:origin tool-origin
38-
:external-id nil
3938
:decision-reason {:code :none
4039
:text "No reason"}}
4140
(#'f.chat/get-tool-call-state @db* chat-id tool-call-id))

0 commit comments

Comments
 (0)