Skip to content

Commit 17ff358

Browse files
authored
Merge pull request #455 from itkonen/fix/tool-call-stream-cpu
Fix CPU spike while streaming tool-call arguments
2 parents fd62958 + 90d0591 commit 17ff358

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

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+
- Improve CPU usage while streaming tool-call arguments by reusing the prompt's tool list.
6+
57
## 0.133.4
68

79
- Bugfix: stop the infinite "Cannot run program 'kill'" liveness-probe log loop for sandboxed environments.

src/eca/features/chat.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,7 @@
828828
(lifecycle/finish-chat-prompt! :idle chat-ctx)))))
829829
:on-prepare-tool-call (fn [{:keys [id full-name arguments-text]}]
830830
(lifecycle/assert-chat-not-stopped! chat-ctx)
831-
(let [all-tools (f.tools/all-tools chat-id agent @db* config)
832-
tool (f.tools/resolve-tool full-name all-tools)
831+
(let [tool (f.tools/resolve-tool full-name all-tools)
833832
resolved-full-name (or (:full-name tool) full-name)]
834833
(when-not tool
835834
(logger/warn logger-tag "Tool not found for prepare"

0 commit comments

Comments
 (0)