Function: eca-jobs--handle-jobs-updated

eca-jobs--handle-jobs-updated is a natively compiled function defined in eca-jobs.el.

Signature

(eca-jobs--handle-jobs-updated SESSION PARAMS)

Documentation

Update jobs list in SESSION from PARAMS and refresh tab + modeline.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-jobs.el
;; Notification handler

(defun eca-jobs--handle-jobs-updated (session params)
  "Update jobs list in SESSION from PARAMS and refresh tab + modeline."
  (setf (eca--session-jobs session)
        (append (plist-get params :jobs) nil))
  (eca-settings-refresh-tab "jobs" session)
  ;; Manage timer in any live jobs buffer
  (dolist (buf (buffer-list))
    (when (and (buffer-live-p buf)
               (string-match-p "eca-settings.*:jobs:" (buffer-name buf)))
      (eca-jobs--ensure-timer session buf)))
  ;; Update modeline and bg job emoji in chat buffers
  (dolist (chat-entry (eca--session-chats session))
    (when-let* ((chat-buf (cdr chat-entry)))
      (when (buffer-live-p chat-buf)
        (with-current-buffer chat-buf
          (force-mode-line-update)
          ;; Update tool call labels for background jobs
          (let ((chat-id (car chat-entry)))
            (dolist (job (eca--session-jobs session))
              (when-let* ((tc-id (plist-get job :toolCallId))
                          (job-chat (plist-get job :chatId))
                          (_ (string= job-chat chat-id))
                          (emoji (eca-jobs--status-emoji
                                  (plist-get job :status))))
                (eca-chat--update-bg-job-emoji
                 tc-id emoji)))))))))