Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ jobs:
os: [ubuntu-22.04]
jdk: [24]
include:
# FIXME
# Windows keep failing randomly because of CI issues.
# - os: windows-latest
# jdk: 24
- os: windows-latest
jdk: 24
- os: macos-latest
jdk: 24
steps:
Expand Down
2 changes: 1 addition & 1 deletion integration-test/integration/chat/anthropic_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
:origin "native"
:id "tool-1"
:name "eca_directory_tree"
:argumentsText (str "h\":\"" (h/project-path->canon-path "resources") "\"}")
:argumentsText (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")
:summary "Listing file tree"})
(match-content chat-id "system" {:type "usage"
:sessionTokens 35
Expand Down
7 changes: 5 additions & 2 deletions integration-test/integration/chat/commands_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@
(eca/request! (fixture/initialize-request
{:initializationOptions (merge fixture/default-init-options
{:mcpServers {"mcp-server-sample"
{:command "bash"
:args ["-c" (str "cd " h/mcp-server-sample-path " && clojure -M:server")]}}})}))
(if h/windows?
{:command "cmd.exe"
:args ["/c" (str "cd /d " h/mcp-server-sample-path " && clojure -M:server")]}
{:command "bash"
:args ["-c" (str "cd " h/mcp-server-sample-path " && clojure -M:server")]})}})}))
(eca/notify! (fixture/initialized-notification))

(Thread/sleep 10000) ;; wait MCP server start TODO Improve this
Expand Down
2 changes: 1 addition & 1 deletion integration-test/integration/chat/openai_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
{:type "function_call"
:name "eca_directory_tree"
:call_id "tool-1"
:arguments (str "{\"path\":\"" (h/project-path->canon-path "resources") "\"}")}
:arguments (str "{\"path\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")}
{:type "function_call_output"
:call_id "tool-1"
:output (str (h/project-path->canon-path "resources") "\n"
Expand Down
6 changes: 6 additions & 0 deletions integration-test/integration/helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
windows?
(string/replace #"/([a-zA-Z]):/" "/$1%3A/")))

(defn json-escape-path
"Escapes the filesystem PATH string for safe use in JSON and returns the
result."
[path]
(string/replace path "\\" "\\\\"))

(defn file->uri [file]
(let [uri (-> file fs/canonicalize .toUri .toString)]
(if *escape-uris?*
Expand Down
2 changes: 1 addition & 1 deletion integration-test/llm_mock/anthropic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
{:type "content_block_delta"
:index 2
:delta {:type "input_json_delta"
:partial_json (str "h\":\"" (h/project-path->canon-path "resources") "\"}")}})
:partial_json (str "h\":\"" (h/json-escape-path (h/project-path->canon-path "resources")) "\"}")}})
;; Finish the message indicating a tool_use stop so the client triggers tools
(sse-send! ch "message_delta"
{:type "message_delta"
Expand Down
Loading