|
123 | 123 | (let [result (#'f.chat/transition-tool-call! db* chat-ctx tool-call-id :tool-prepare event-data)] |
124 | 124 |
|
125 | 125 | (is (match? {:status :preparing |
126 | | - :actions [:send-toolCallPrepare]} |
| 126 | + :actions [:send-toolCallPrepare :init-decision-reason]} |
127 | 127 | result) |
128 | 128 | "Expected return value to show :preparing status and send toolCallPrepare action") |
129 | 129 |
|
|
240 | 240 | (is (= 1 (count run-messages)) "Expected exactly one toolCallRun notification to be sent") |
241 | 241 |
|
242 | 242 | (is (match? {:chat-id chat-id |
243 | | - :request-id "req-1" |
244 | 243 | :role :assistant |
245 | 244 | :content (merge {:type :toolCallRun |
246 | 245 | :id tool-call-id} |
|
477 | 476 | {:approved?* approved?* :name "test" :origin "test" :arguments {} :manual-approval false}) |
478 | 477 |
|
479 | 478 | (let [result (#'f.chat/transition-tool-call! db* chat-ctx "tool-check" :stop-requested)] |
480 | | - (is (match? {:status :stopped |
481 | | - :actions [:send-toolCallRejected]} |
| 479 | + (is (match? {:status :rejected |
| 480 | + :actions [:set-decision-reason :deliver-approval-false]} |
482 | 481 | result) |
483 | | - "Expected transition from :check-approval to :stopped with send toolCallRejected action")))) |
| 482 | + "Expected transition from :check-approval to :rejected with relevant actions")))) |
484 | 483 |
|
485 | 484 | ;; Test :completed -> :stopped (should be no-op or error) |
486 | 485 | (testing ":completed -> :stopped (should handle gracefully)" |
|
552 | 551 | (is (match? {:status :rejected |
553 | 552 | :actions [:set-decision-reason :deliver-approval-false]} |
554 | 553 | result) |
555 | | - "Expected transition to :stopped with deliver approval false action") |
556 | | - (is (= :stopped (:status (#'f.chat/get-tool-call-state @db* chat-id "tool-2"))) |
557 | | - "Expected tool call state to be in :stopped status") |
| 554 | + "Expected transition to :refected with deliver approval false action") |
| 555 | + (is (= :rejected (:status (#'f.chat/get-tool-call-state @db* chat-id "tool-2"))) |
| 556 | + "Expected tool call state to be in :rejected status") |
558 | 557 | (is (= false (deref approved?* 100 :timeout)) |
559 | 558 | "Expected promise to be delivered with false value")))) |
560 | 559 |
|
|
0 commit comments