Skip to content

Commit c09fc81

Browse files
ericdalloeca-agent
andcommitted
Fix Windows MCP remote test: widen unordered notification group
On Windows, toolCalled can arrive before the progress "Calling tool" notification. Include toolCalled in the match-contents-unordered group alongside toolCallRunning and progress to handle all orderings. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca-agent <git@eca.dev>
1 parent c046d20 commit c09fc81

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

integration-test/integration/chat/mcp_remote_test.clj

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,21 @@
107107
:id "mcp-tool-1"
108108
:arguments {:message "hello from mcp"}
109109
:manualApproval false})
110-
;; toolCallRunning and progress may arrive in either order on Windows
110+
;; toolCallRunning, progress, and toolCalled may arrive in any order on Windows
111111
(match-contents-unordered
112112
[chat-id "assistant" {:type "toolCallRunning"
113113
:origin "mcp"
114114
:name "echo"
115115
:id "mcp-tool-1"
116116
:arguments {:message "hello from mcp"}}]
117-
[chat-id "system" {:type "progress" :state "running" :text "Calling tool"}])
118-
119-
;; Tool called result — echo returns the same message
120-
(match-content chat-id "assistant" {:type "toolCalled"
121-
:origin "mcp"
122-
:name "echo"
123-
:id "mcp-tool-1"
124-
:arguments {:message "hello from mcp"}
125-
:error nil
126-
:outputs [{:type "text" :text "hello from mcp"}]})
117+
[chat-id "system" {:type "progress" :state "running" :text "Calling tool"}]
118+
[chat-id "assistant" {:type "toolCalled"
119+
:origin "mcp"
120+
:name "echo"
121+
:id "mcp-tool-1"
122+
:arguments {:message "hello from mcp"}
123+
:error nil
124+
:outputs [{:type "text" :text "hello from mcp"}]}])
127125

128126
;; Second LLM turn: final response after tool result
129127
(match-content chat-id "assistant" {:type "text" :text "The echo tool returned: hello from mcp"})
@@ -239,24 +237,22 @@
239237
:id "mcp-add-tool-1"
240238
:arguments {:name "multiply"}
241239
:manualApproval false})
242-
;; toolCallRunning and progress may arrive in either order on Windows
240+
;; toolCallRunning, progress, and toolCalled may arrive in any order on Windows
243241
(match-contents-unordered
244242
[chat-id "assistant" {:type "toolCallRunning"
245243
:origin "mcp"
246244
:name "add-tool"
247245
:id "mcp-add-tool-1"
248246
:arguments {:name "multiply"}}]
249-
[chat-id "system" {:type "progress" :state "running" :text "Calling tool"}])
250-
251-
;; Tool result
252-
(match-content chat-id "assistant" {:type "toolCalled"
253-
:origin "mcp"
254-
:name "add-tool"
255-
:id "mcp-add-tool-1"
256-
:arguments {:name "multiply"}
257-
:error nil
258-
:outputs [{:type "text"
259-
:text "Tool 'multiply' registered successfully"}]})
247+
[chat-id "system" {:type "progress" :state "running" :text "Calling tool"}]
248+
[chat-id "assistant" {:type "toolCalled"
249+
:origin "mcp"
250+
:name "add-tool"
251+
:id "mcp-add-tool-1"
252+
:arguments {:name "multiply"}
253+
:error nil
254+
:outputs [{:type "text"
255+
:text "Tool 'multiply' registered successfully"}]}])
260256

261257
;; Second LLM turn: final response
262258
(match-content chat-id "assistant" {:type "text" :text "Tool added successfully"})

0 commit comments

Comments
 (0)