Function: eca-chat--settle-question

eca-chat--settle-question is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat--settle-question QUESTION RESULT RESPONSE)

Documentation

Settle pending QUESTION, showing RESULT and sending RESPONSE.

RESULT replaces the question options in the chat. Return non-nil when QUESTION was pending, nil when it was already settled.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--settle-question (question result response)
  "Settle pending QUESTION, showing RESULT and sending RESPONSE.
RESULT replaces the question options in the chat.  Return non-nil
when QUESTION was pending, nil when it was already settled."
  (when (memq question eca-chat--pending-questions)
    (let ((session (plist-get question :session)))
      (setq eca-chat--pending-questions
            (remq question eca-chat--pending-questions))
      (eca-chat--allow-write
       (if-let* ((tool-call-id (plist-get question :tool-call-id)))
           (eca-chat--update-expandable-content
            tool-call-id nil (concat result "\n"))
         (eca-chat--collapse-question-block question (concat result "\n\n")))
       (eca-chat--refresh-question-prompt-prefix)
       (eca-chat--refresh-transient-area))
      (eca-api-send-request-response
       session (plist-get question :request) response)
      (eca-chat--notify-status-changed session)
      t)))