chat-job Card

Processing Chat Jobs

A chat job means there are new messages (or a scheduled callback) in a chat thread.

The source field names the connector that owns the thread, so bbx wakeup --connector telegram can drain telegram-originated chat jobs without picking up unrelated work.

Steps

  1. The job content and thread content are provided in the prompt — do NOT re-read them
  2. Find new messages: scan backward from the end of the thread's entries: array for the last kind: seen or kind: message, sender: agent — everything after that is new
  3. If there are no new messages, check the last kind: seen entry's text: for a note-to-self about what to do
  4. Decide whether to respond or acknowledge:
    • Respond: append an entry {kind: message, sender: agent, text: "Your response"}
    • Acknowledge: append an entry {kind: seen} (optionally with callback-in and/or a note-to-self text:)
  5. Commit the thread file
  6. Run bbx finish {thisJobFile} to complete the job

Important