Skip to content

Commit d573d21

Browse files
committed
Run preToolCall hook before user approval if any.
Fixes #170
1 parent eceb1a7 commit d573d21

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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+
- Run `preToolCall` hook before user approval if any. #170
6+
57
## 0.72.1
68

79
- Only include `parallel_tool_calls` to openai-responses and openai-chat if true. #169

src/eca/features/chat.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@
174174
{:status :execution-approved
175175
:actions [:set-decision-reason :deliver-approval-true]}
176176

177+
[:waiting-approval :hook-rejected]
178+
{:status :rejected
179+
:actions [:set-decision-reason :deliver-approval-false]}
180+
177181
[:waiting-approval :user-reject]
178182
{:status :rejected
179183
:actions [:set-decision-reason :deliver-approval-false :log-rejection]}
@@ -667,8 +671,6 @@
667671
:text "Tool call rejected by user config"}})
668672
(logger/warn logger-tag "Unknown value of approval in config"
669673
{:approval approval :tool-call-id id})))
670-
;; TODO: Should there be a timeout here? If so, what would be the state transitions?
671-
@approved?* ;; wait for user respond before checking hook
672674
(f.hooks/trigger-if-matches! :preToolCall
673675
{:chat-id chat-id
674676
:tool-name name

0 commit comments

Comments
 (0)