fix(act): Route tool outputs to CLI and refine assistant conversational prompt
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
This commit is contained in:
@@ -63,8 +63,12 @@
|
|||||||
(handler-case
|
(handler-case
|
||||||
(let* ((clean-args (if (and (listp tool-args) (listp (car tool-args))) (car tool-args) tool-args))
|
(let* ((clean-args (if (and (listp tool-args) (listp (car tool-args))) (car tool-args) tool-args))
|
||||||
(result (funcall (cognitive-tool-body tool) clean-args)))
|
(result (funcall (cognitive-tool-body tool) clean-args)))
|
||||||
(list :type :EVENT :depth (1+ depth) :reply-stream (getf context :reply-stream)
|
(let ((feedback (list :TYPE :EVENT :DEPTH (1+ depth) :REPLY-STREAM (getf context :REPLY-STREAM)
|
||||||
:payload (list :sensor :tool-output :result result :tool tool-name)))
|
:PAYLOAD (list :SENSOR :tool-output :RESULT result :TOOL tool-name))))
|
||||||
|
;; If we have a reply stream, also send a chat message with the result
|
||||||
|
(when (getf context :REPLY-STREAM)
|
||||||
|
(dispatch-action (list :TYPE :CHAT :TEXT (format nil "TOOL [~a] RESULT: ~a" tool-name result)) context))
|
||||||
|
feedback))
|
||||||
(error (c)
|
(error (c)
|
||||||
(list :type :EVENT :depth (1+ depth) :reply-stream (getf context :reply-stream)
|
(list :type :EVENT :depth (1+ depth) :reply-stream (getf context :reply-stream)
|
||||||
:payload (list :sensor :tool-error :tool tool-name :message (format nil "~a" c)))))
|
:payload (list :sensor :tool-error :tool tool-name :message (format nil "~a" c)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user