Function: eca-chat-session-status

eca-chat-session-status is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat-session-status SESSION)

Documentation

Return the aggregated status of all chats in SESSION.

Return the symbol waiting-approval when any chat waits on the user (pending tool call approval or question), running when any chat is actively loading, otherwise idle. A chat in the transient stopping state is treated as idle since it is winding down and visually looks idle.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat-session-status (session)
  "Return the aggregated status of all chats in SESSION.
Return the symbol `waiting-approval' when any chat waits on the
user (pending tool call approval or question), `running' when any
chat is actively loading, otherwise `idle'.  A chat in the
transient `stopping' state is treated as idle since it is winding
down and visually looks idle."
  (let ((buffers (-filter #'buffer-live-p
                          (eca-vals (eca--session-chats session)))))
    (cond
     ((-first #'eca-chat--needs-attention-p buffers) 'waiting-approval)
     ((-first (lambda (buffer)
                (eq (buffer-local-value 'eca-chat--chat-loading buffer) t))
              buffers)
      'running)
     (t 'idle))))