File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed
Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix ` eca_shell_command ` to include stderr output even when exit 0.
6+
57## 0.91.1
68
79- Fix openai pro login exceptions related to graalvm.
Original file line number Diff line number Diff line change 9393 (state-transition-fn :resources-destroyed {:resources (keys resources)}))))))
9494 err (some-> (:err result) string/trim)
9595 out (some-> (:out result) string/trim)]
96- (cond
97- (= result ::timeout )
96+ (if (= result ::timeout )
9897 (do
9998 (logger/debug logger-tag " Command timed out after " timeout " ms" )
10099 (tools.util/single-text-content (str " Command timed out after " timeout " ms" ) true ))
101-
102- (zero? (:exit result))
103- (do (logger/debug logger-tag " Command executed:" result)
104- (tools.util/single-text-content (:out result)))
105-
106- :else
107100 (do
108101 (logger/debug logger-tag " Command executed:" result)
109- {:error true
102+ {:error ( not ( zero? ( :exit result)))
110103 :contents (remove nil?
111104 (concat [{:type :text
112- :text (str " Exit code " (:exit result))}]
105+ :text (str " Exit code: " (:exit result))}]
113106 (when-not (string/blank? err)
114107 [{:type :text
115108 :text (str " Stderr:\n " err)}])
Original file line number Diff line number Diff line change 2727 (is (match?
2828 {:error true
2929 :contents [{:type :text
30- :text " Exit code 1" }
30+ :text " Exit code: 1" }
3131 {:type :text
3232 :text " Stderr:\n Some error" }]}
3333 (with-redefs [fs/exists? (constantly true )
4141 (is (match?
4242 {:error false
4343 :contents [{:type :text
44- :text " Some text" }]}
44+ :text " Exit code: 0" }
45+ {:type :text
46+ :text " Stderr:\n Other text" }
47+ {:type :text
48+ :text " Stdout:\n Some text" }]}
4549 (with-redefs [fs/exists? (constantly true )
4650 p/process (constantly (future {:exit 0 :out " Some text" :err " Other text" }))]
4751 ((get-in f.tools.shell/definitions [" shell_command" :handler ])
5357 (is (match?
5458 {:error false
5559 :contents [{:type :text
56- :text " Some text" }]}
60+ :text " Exit code: 0" }
61+ {:type :text
62+ :text " Stdout:\n Some text" }]}
5763 (with-redefs [fs/exists? (constantly true )
58- p/process (constantly (future {:exit 0 :out " Some text" :err " Other text " }))]
64+ p/process (constantly (future {:exit 0 :out " Some text" }))]
5965 ((get-in f.tools.shell/definitions [" shell_command" :handler ])
6066 {" command" " ls -lh"
6167 " working_directory" (h/file-path " /project/foo/src" )}
8692 (is (match?
8793 {:error false
8894 :contents [{:type :text
89- :text " also ok" }]}
95+ :text " Exit code: 0" }
96+ {:type :text
97+ :text " Stdout:\n also ok" }]}
9098 (with-redefs [fs/exists? (constantly true )
91- p/process (constantly (reset! proc (future {:exit 0 :err " ok " : out " also ok" })))]
99+ p/process (constantly (reset! proc (future {:exit 0 :out " also ok" })))]
92100 ((get-in f.tools.shell/definitions [" shell_command" :handler ])
93101 {" command" " ls -lh" }
94102 {:db {:workspace-folders [{:uri (h/file-uri " file:///project/foo" ) :name " foo" }]}
117125 (are [command] (match?
118126 {:error false
119127 :contents [{:type :text
120- :text " Some output" }]}
128+ :text " Exit code: 0" }
129+ {:type :text
130+ :text " Stdout:\n Some output" }]}
121131 (with-redefs [fs/exists? (constantly true )
122132 p/process (constantly (future {:exit 0 :out " Some output" }))]
123133 ((get-in f.tools.shell/definitions [" shell_command" :handler ])
You can’t perform that action at this time.
0 commit comments