Files
openbot/scripts
Aleksander DygońandClaude Opus 5.5 d581de58d6 Stop Slack, Discord and Telegram conversations from holding an agent's queue (#2130)
* Stop messaging conversations from holding an agent's queue

A turn that no event ended held the agent's queue until OpenBot
restarted, and status posts in Slack, Discord and Telegram stayed on
"Working" or "Waiting" after a restart or a failed post.

- Muse ends a turn whose turn/start failed after turn/started.
- A provider exit ends the turns of that client that have no message
  left for the delivery recovery, such as a turn the CLI started.
- The drain does not mark a turn active that already ended, and settles
  the messages that such a turn left running.
- Messages of an unconfirmed turn/start that no turn took in 5 minutes
  end as interrupted, and the queue continues.
- A question card in a messaging thread is refused: nobody there can
  answer it.
- An approval that did not reach the platform is posted again.
- Discord and Slack name lookups no longer hold the prompt deadline.
- The delivery recovery tells the conversation that a request ended.
- Status posts and Stop buttons are kept in a file. A connection that
  is connected again sends each last post that did not reach the
  platform, and stops the posts of requests that ended meanwhile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Handle kept deliveries in order for each route only

Signal keeps the order of kept deliveries for each route (Slack team,
Discord guild, Telegram chat). The host opened and handled them under
one global permit. Thus a connection that could not start held back
the kept deliveries of all other connections, and each of its
deliveries waited 60 s for the transport.

- signal-ingress: open kept deliveries one at a time, in send order.
  Then each delivery waits only for the earlier deliveries of its route.
- messaging-service: the kept deliveries of one connection share one
  transport deadline for each socket. A connection that does not start
  costs one 60 s wait, not one wait for each event.

Ack and 503 behavior do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a Telegram link for the host's next Signal socket

A `/start <code>` link could land while the host's ingress socket
connected again. Then no socket, or a socket that closed, held the
chat, and Signal sent the linked update only once, live. The host
dropped it, and the route ticket of its next socket did not name the
chat. The chat did not show in OpenBot until the user linked it again.

- Signal keeps the linked update, sealed and with `linked: true`, in
  the ingress queue for the host until a socket acknowledges it. A
  host with no queue key, or a Signal with no queue, gets the live
  frame as before.
- Signal remembers each new link for the route ticket TTL, and routes
  the chat to a new socket of that host whose ticket does not name it.
  The route floor still applies.
- `IngressQueue.keep` keeps an event for a known host and starts no
  host. `offline` uses the same code.
- The Signal E2E check links a chat between two sockets of one host.

No frame changes meaning. The Signal change needs its own deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Merge the release notes of the messaging stall fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the local review findings of the messaging stall fixes

- A last post goes out once: a copy that a settle and a wait both
  queued stops when the post is no longer the current one.
- The last post is saved before it is sent, so a restart still has the
  answer when the send failed.
- A settle stops only posts from before the restart. The end of a
  request in this run comes as an activity, which can still be on its
  way.
- A turn with no known requester does not count as told, so the
  delivery settle still tells the conversation.
- The status file is read at once, before the activity listener, so no
  activity is lost while it loads. Posts of a removed connection are
  left out.
- A failed edit is sent again as an edit. Only the last attempt posts
  anew, so a temporary error leaves no second "Working" post.
- A new message waits at most 5 seconds for its author and place names.
- The reason of an unstarted turn uses a catalog key.
- interruptTurnsOf takes keepRecoverable in place of a copy of its loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the kept Telegram link in the Signal store rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not send a failed answer again

An answer goes out in parts. When a later part failed, the retry sent
the parts that were on the platform already. Now a failed answer is
not sent again: the status post gets the fixed failure notice, and the
host keeps the answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:22:38 +02:00
..
2026-08-25 16:40:20 +02:00