Skip to content

Commit 19ec46d

Browse files
committed
Only include parallel_tool_calls to openai-responses and openai-chat if true.
Related to #169
1 parent 96c50be commit 19ec46d

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Only include `parallel_tool_calls` to openai-responses and openai-chat if true. #169
6+
57
## 0.72.0
68

79
- Support clojureMCP dry-run flags for edit/write tools, being able to show preview of diffs before running tool.

src/eca/llm_api.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@
131131
:past-messages past-messages
132132
:tools tools
133133
:web-search web-search
134-
:extra-payload extra-payload
134+
:extra-payload (merge {:parallel_tool_calls true}
135+
extra-payload)
135136
:api-url api-url
136137
:api-key api-key
137138
:auth-type provider-auth-type}
@@ -164,9 +165,11 @@
164165
:supports-image? supports-image?
165166
:past-messages past-messages
166167
:tools tools
167-
:extra-payload extra-payload
168+
:extra-payload (merge {:parallel_tool_calls true}
169+
extra-payload)
168170
:api-url api-url
169171
:api-key api-key
172+
170173
:extra-headers {"openai-intent" "conversation-panel"
171174
"x-request-id" (str (random-uuid))
172175
"vscode-sessionid" ""
@@ -186,11 +189,10 @@
186189
:past-messages past-messages
187190
:tools tools
188191
:thinking-tag "thought"
189-
:extra-payload (merge {}
192+
:extra-payload (merge {:parallel_tool_calls false}
190193
(when reason?
191194
{:extra_body {:google {:thinking_config {:include_thoughts true}}}})
192195
extra-payload)
193-
:parallel-tool-calls? false
194196
:api-url api-url
195197
:api-key api-key}
196198
callbacks)

src/eca/llm_providers/openai.clj

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,24 @@
107107
tools (cond-> tools
108108
web-search (conj {:type "web_search_preview"}))
109109
body (deep-merge
110-
{:model model
111-
:input input
112-
:prompt_cache_key (str (System/getProperty "user.name") "@ECA")
113-
:parallel_tool_calls true
114-
:instructions (if (= :auth/oauth auth-type)
115-
(str "You are Codex." instructions)
116-
instructions)
117-
:tools tools
118-
:include (when reason?
119-
["reasoning.encrypted_content"])
120-
:store false
121-
:reasoning (when reason?
122-
{:effort "medium"
123-
:summary "detailed"})
124-
:stream true
125-
;; :verbosity "medium"
126-
:max_output_tokens max-output-tokens}
110+
(assoc-some
111+
{:model model
112+
:input input
113+
:prompt_cache_key (str (System/getProperty "user.name") "@ECA")
114+
:instructions (if (= :auth/oauth auth-type)
115+
(str "You are Codex." instructions)
116+
instructions)
117+
:tools tools
118+
:include (when reason?
119+
["reasoning.encrypted_content"])
120+
:store false
121+
:reasoning (when reason?
122+
{:effort "medium"
123+
:summary "detailed"})
124+
:stream true
125+
;; :verbosity "medium"
126+
:max_output_tokens max-output-tokens}
127+
:parallel_tool_calls (:parallel_tool_calls extra-payload))
127128
extra-payload)
128129
tool-call-by-item-id* (atom {})
129130
on-response-fn

src/eca/llm_providers/openai_chat.clj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,9 @@
268268
and message normalization. Supports both single and parallel tool execution.
269269
Compatible with OpenRouter and other OpenAI-compatible providers."
270270
[{:keys [model user-messages instructions temperature api-key api-url url-relative-path
271-
past-messages tools extra-payload extra-headers supports-image? parallel-tool-calls?
271+
past-messages tools extra-payload extra-headers supports-image?
272272
thinking-tag]
273273
:or {temperature 1.0
274-
parallel-tool-calls? true
275274
thinking-tag "think"}}
276275
{:keys [on-message-received on-error on-prepare-tool-call on-tools-called on-reason on-usage-updated]}]
277276
(let [thinking-start-tag (str "<" thinking-tag ">")
@@ -288,7 +287,7 @@
288287
:temperature temperature
289288
:stream true
290289
:max_completion_tokens 32000}
291-
:parallel_tool_calls (or parallel-tool-calls? (:parallel_tool_calls extra-payload))
290+
:parallel_tool_calls (:parallel_tool_calls extra-payload)
292291
:tools (when (seq tools) (->tools tools)))
293292
extra-payload)
294293

0 commit comments

Comments
 (0)