Files
LocalAI/core/http/endpoints/studio
Ettore Di Giacinto c70566d4f7 feat(connectors): keep two connections of one bot from answering twice
Two enabled connections can hold different token pairs of the same
upstream account, such as one Slack app registered twice. Both then
receive every message and both answer it.

The op "me" may now return accountId, a stable name of the upstream
account. Slack returns the workspace and bot user, Telegram the bot ID
and Discord the application ID. The host stores it on the binding when
a token is saved and, for a binding that has none, when its add-on runs.
An add-on that does not return it has no identity and is never compared.

When two enabled bindings of one owner and kind share an identity:

- the binding carries a duplicate marker with the code
  duplicate_connection, with a sentence in all eight languages of the
  connection texts;
- saving one of them is a 409 of that type until the request carries
  confirm_duplicate, and nothing is saved before;
- only the oldest enabled binding answers a message that has a platform
  message ID. The other logs one line and stays silent. The choice reads
  the stored bindings only, so every frontend makes the same one.

Assisted-by: Claude:claude-sonnet-5-5
2026-11-05 11:36:23 +00:00
..