Skip to content

Commit 631f22f

Browse files
ericdalloeca-agent
andcommitted
Fix tests for updated tool call summary format
Update unit and integration tests to match the new summary strings from commit f40651b ("Improve summary of tool calls"): - shell_command: "Running 'X'" → "$ X", "Running shell command" → "Preparing shell command" - directory_tree: "Listing file tree" → "Listing tree" (prepare) / "Listing tree: <path>" (run) 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <git@eca.dev>
1 parent cf75a1a commit 631f22f

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

integration-test/integration/chat/anthropic_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,19 @@
219219
:id "tool-1"
220220
:name "directory_tree"
221221
:argumentsText ""
222-
:summary "Listing file tree"})
222+
:summary "Listing tree"})
223223
(match-content chat-id "assistant" {:type "toolCallPrepare"
224224
:origin "native"
225225
:id "tool-1"
226226
:name "directory_tree"
227227
:argumentsText "{\"pat"
228-
:summary "Listing file tree"})
228+
:summary "Listing tree"})
229229
(match-content chat-id "assistant" {:type "toolCallPrepare"
230230
:origin "native"
231231
:id "tool-1"
232232
:name "directory_tree"
233233
:argumentsText (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")
234-
:summary "Listing file tree"})
234+
:summary "Listing tree"})
235235
(match-content chat-id "system" {:type "usage"
236236
:sessionTokens 35
237237
:lastMessageCost (m/pred string?)
@@ -242,20 +242,20 @@
242242
:name "directory_tree"
243243
:arguments {:path (h/project-path->canon-path "resources")}
244244
:manualApproval false
245-
:summary "Listing file tree"})
245+
:summary "Listing tree: resources"})
246246
(match-content chat-id "assistant" {:type "toolCallRunning"
247247
:origin "native"
248248
:id "tool-1"
249249
:name "directory_tree"
250250
:arguments {:path (h/project-path->canon-path "resources")}
251-
:summary "Listing file tree"})
251+
:summary "Listing tree: resources"})
252252
(match-content chat-id "system" {:type "progress" :state "running" :text "Calling tool"})
253253
(match-content chat-id "assistant" {:type "toolCalled"
254254
:origin "native"
255255
:id "tool-1"
256256
:name "directory_tree"
257257
:arguments {:path (h/project-path->canon-path "resources")}
258-
:summary "Listing file tree"
258+
:summary "Listing tree: resources"
259259
:totalTimeMs (m/pred number?)
260260
:error false
261261
:outputs [{:type "text" :text (str (h/project-path->canon-path "resources") "\n"

integration-test/integration/chat/github_copilot_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,21 @@
207207
:name "directory_tree"
208208
:argumentsText ""
209209
:manualApproval false
210-
:summary "Listing file tree"})
210+
:summary "Listing tree"})
211211
(match-content chat-id "assistant" {:type "toolCallPrepare"
212212
:origin "native"
213213
:id "tool-1"
214214
:name "directory_tree"
215215
:argumentsText "{\"pat"
216216
:manualApproval false
217-
:summary "Listing file tree"})
217+
:summary "Listing tree"})
218218
(match-content chat-id "assistant" {:type "toolCallPrepare"
219219
:origin "native"
220220
:id "tool-1"
221221
:name "directory_tree"
222222
:argumentsText (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")
223223
:manualApproval false
224-
:summary "Listing file tree"})
224+
:summary "Listing tree"})
225225
(match-content chat-id "system" {:type "usage"
226226
:messageInputTokens 5
227227
:messageOutputTokens 30
@@ -234,20 +234,20 @@
234234
:name "directory_tree"
235235
:arguments {:path (h/project-path->canon-path "resources")}
236236
:manualApproval false
237-
:summary "Listing file tree"})
237+
:summary "Listing tree: resources"})
238238
(match-content chat-id "assistant" {:type "toolCallRunning"
239239
:origin "native"
240240
:id "tool-1"
241241
:name "directory_tree"
242242
:arguments {:path (h/project-path->canon-path "resources")}
243243
:totalTimeMs number?
244-
:summary "Listing file tree"})
244+
:summary "Listing tree: resources"})
245245
(match-content chat-id "assistant" {:type "toolCalled"
246246
:origin "native"
247247
:id "tool-1"
248248
:name "directory_tree"
249249
:arguments {:path (h/project-path->canon-path "resources")}
250-
:summary "Listing file tree"
250+
:summary "Listing tree: resources"
251251
:error false
252252
:outputs [{:type "text" :text (str "[FILE] " (h/project-path->canon-path "resources/file1.md\n")
253253
"[FILE] " (h/project-path->canon-path "resources/file2.md\n"))}]})

integration-test/integration/chat/google_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,40 +212,40 @@
212212
:id (m/pred string?)
213213
:name "directory_tree"
214214
:argumentsText ""
215-
:summary "Listing file tree"})
215+
:summary "Listing tree"})
216216
(match-content chat-id "assistant" {:type "toolCallPrepare"
217217
:origin "native"
218218
:id (m/pred string?)
219219
:name "directory_tree"
220220
:argumentsText "{\"pat"
221-
:summary "Listing file tree"})
221+
:summary "Listing tree"})
222222
(match-content chat-id "assistant" {:type "toolCallPrepare"
223223
:origin "native"
224224
:id (m/pred string?)
225225
:name "directory_tree"
226226
:argumentsText (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")
227-
:summary "Listing file tree"})
227+
:summary "Listing tree"})
228228
(match-content chat-id "system" {:type "usage"})
229229
(match-content chat-id "assistant" {:type "toolCallRun"
230230
:origin "native"
231231
:id (m/pred string?)
232232
:name "directory_tree"
233233
:arguments {:path (h/project-path->canon-path "resources")}
234234
:manualApproval false
235-
:summary "Listing file tree"})
235+
:summary "Listing tree: resources"})
236236
(match-content chat-id "assistant" {:type "toolCallRunning"
237237
:origin "native"
238238
:id (m/pred string?)
239239
:name "directory_tree"
240240
:arguments {:path (h/project-path->canon-path "resources")}
241-
:summary "Listing file tree"})
241+
:summary "Listing tree: resources"})
242242
(match-content chat-id "system" {:type "progress" :state "running" :text "Calling tool"})
243243
(match-content chat-id "assistant" {:type "toolCalled"
244244
:origin "native"
245245
:id (m/pred string?)
246246
:name "directory_tree"
247247
:arguments {:path (h/project-path->canon-path "resources")}
248-
:summary "Listing file tree"
248+
:summary "Listing tree: resources"
249249
:totalTimeMs (m/pred number?)
250250
:error false
251251
:outputs [{:type "text" :text (str (h/project-path->canon-path "resources") "\n"

integration-test/integration/chat/ollama_test.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,27 +219,27 @@
219219
:id (m/pred string?)
220220
:name "directory_tree"
221221
:argumentsText ""
222-
:summary "Listing file tree"})
222+
:summary "Listing tree"})
223223
(match-content chat-id "assistant" {:type "toolCallRun"
224224
:origin "native"
225225
:id (m/pred string?)
226226
:name "directory_tree"
227227
:arguments {:path (h/project-path->canon-path "resources")}
228228
:manualApproval false
229-
:summary "Listing file tree"})
229+
:summary "Listing tree: resources"})
230230
(match-content chat-id "assistant" {:type "toolCallRunning"
231231
:origin "native"
232232
:id (m/pred string?)
233233
:name "directory_tree"
234234
:arguments {:path (h/project-path->canon-path "resources")}
235-
:summary "Listing file tree"})
235+
:summary "Listing tree: resources"})
236236
(match-content chat-id "system" {:type "progress" :state "running" :text "Calling tool"})
237237
(match-content chat-id "assistant" {:type "toolCalled"
238238
:origin "native"
239239
:id (m/pred string?)
240240
:name "directory_tree"
241241
:arguments {:path (h/project-path->canon-path "resources")}
242-
:summary "Listing file tree"
242+
:summary "Listing tree: resources"
243243
:totalTimeMs (m/pred number?)
244244
:error false
245245
:outputs [{:type "text" :text (str (h/project-path->canon-path "resources") "\n"
@@ -257,7 +257,7 @@
257257
:function {:id (m/pred string?)
258258
:name "eca__directory_tree"
259259
:arguments {:path (h/project-path->canon-path "resources")}
260-
:summary "Listing file tree"
260+
:summary "Listing tree: resources"
261261
:origin "native"}}]}
262262
{:role "tool" :content (str (h/project-path->canon-path "resources") "\n"
263263
" file1.md\n"

integration-test/integration/chat/openai_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,19 @@
219219
:id "tool-1"
220220
:name "directory_tree"
221221
:argumentsText ""
222-
:summary "Listing file tree"})
222+
:summary "Listing tree"})
223223
(match-content chat-id "assistant" {:type "toolCallPrepare"
224224
:origin "native"
225225
:id "tool-1"
226226
:name "directory_tree"
227227
:argumentsText "{\"pat"
228-
:summary "Listing file tree"})
228+
:summary "Listing tree"})
229229
(match-content chat-id "assistant" {:type "toolCallPrepare"
230230
:origin "native"
231231
:id "tool-1"
232232
:name "directory_tree"
233233
:argumentsText (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")
234-
:summary "Listing file tree"})
234+
:summary "Listing tree"})
235235
(match-content chat-id "system" {:type "usage"
236236
:sessionTokens 35
237237
:lastMessageCost (m/pred string?)
@@ -242,20 +242,20 @@
242242
:name "directory_tree"
243243
:arguments {:path (h/project-path->canon-path "resources")}
244244
:manualApproval false
245-
:summary "Listing file tree"})
245+
:summary "Listing tree: resources"})
246246
(match-content chat-id "assistant" {:type "toolCallRunning"
247247
:origin "native"
248248
:id "tool-1"
249249
:name "directory_tree"
250250
:arguments {:path (h/project-path->canon-path "resources")}
251-
:summary "Listing file tree"})
251+
:summary "Listing tree: resources"})
252252
(match-content chat-id "system" {:type "progress" :state "running" :text "Calling tool"})
253253
(match-content chat-id "assistant" {:type "toolCalled"
254254
:origin "native"
255255
:id "tool-1"
256256
:name "directory_tree"
257257
:arguments {:path (h/project-path->canon-path "resources")}
258-
:summary "Listing file tree"
258+
:summary "Listing tree: resources"
259259
:totalTimeMs (m/pred number?)
260260
:error false
261261
:outputs [{:type "text" :text (str (h/project-path->canon-path "resources") "\n"

test/eca/features/tools/shell_test.clj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,37 +151,37 @@
151151
config {:toolCall {:shellCommand {:summaryMaxLength 80}}}
152152
db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}]
153153
(testing "strips cd prefix when path matches a workspace root"
154-
(is (= "Running 'clojure -M:test'"
154+
(is (= "$ clojure -M:test"
155155
(summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " && clojure -M:test")}
156156
:config config
157157
:db db}))))
158158
(testing "strips cd prefix with semicolon separator"
159-
(is (= "Running 'clojure -M:test'"
159+
(is (= "$ clojure -M:test"
160160
(summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " ; clojure -M:test")}
161161
:config config
162162
:db db}))))
163163
(testing "does not strip cd prefix when path is not a workspace root"
164-
(is (= (format "Running 'cd %s && clojure -M:test'" (h/file-path "/other/dir"))
164+
(is (= (format "$ cd %s && clojure -M:test" (h/file-path "/other/dir"))
165165
(summary-fn {:args {"command" (str "cd " (h/file-path "/other/dir") " && clojure -M:test")}
166166
:config config
167167
:db db}))))
168168
(testing "handles command without cd prefix"
169-
(is (= "Running 'ls -la'"
169+
(is (= "$ ls -la"
170170
(summary-fn {:args {"command" "ls -la"}
171171
:config config
172172
:db db}))))
173173
(testing "handles no command argument"
174-
(is (= "Running shell command"
174+
(is (= "Preparing shell command"
175175
(summary-fn {:args {}
176176
:config config
177177
:db db}))))
178178
(testing "truncates long commands"
179-
(is (= "Running 'aaaaaaaaaa...'"
179+
(is (= "$ aaaaaaaaaa..."
180180
(summary-fn {:args {"command" "aaaaaaaaaaaaaaaaaaa"}
181181
:config {:toolCall {:shellCommand {:summaryMaxLength 10}}}
182182
:db db}))))
183183
(testing "handles nil db gracefully"
184-
(is (= (format "Running 'cd %s && clojure -M:test'" (h/file-path "/project/foo"))
184+
(is (= (format "$ cd %s && clojure -M:test" (h/file-path "/project/foo"))
185185
(summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " && clojure -M:test")}
186186
:config config
187187
:db nil}))))))

0 commit comments

Comments
 (0)