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
- The job content and thread content are provided in the prompt — do NOT re-read them
- Find new messages: scan backward from the end of the thread's
entries:array for the lastkind: seenorkind: message, sender: agent— everything after that is new - If there are no new messages, check the last
kind: seenentry'stext:for a note-to-self about what to do - Decide whether to respond or acknowledge:
- Respond: append an entry
{kind: message, sender: agent, text: "Your response"} - Acknowledge: append an entry
{kind: seen}(optionally withcallback-inand/or a note-to-selftext:)
- Respond: append an entry
- Commit the thread file
- Run
bbx finish {thisJobFile}to complete the job
Important
- Only append ONE entry at the end of
entries: - Do NOT modify existing entries
- Do NOT fill in
sentoridon agent messages — the connector handles delivery - Commit the thread file before finishing the job