multica-ai/multica · error
wecom_bot_owned_by_another_workspace
wecom_bot_owned_by_another_workspace
Error message
wecom: this bot is already connected to a different Multica workspace
What it means
Error "wecom: this bot is already connected to a different Multica workspace" thrown in multica-ai/multica.
Source
Thrown at server/internal/integrations/wecom/installation.go:310
// a second agent misses the ON CONFLICT clause entirely and trips the index
// instead. Without these the admin reads the raw Postgres text
// ("duplicate key value violates unique constraint …") in a toast.
//
// One bot is one connection: the WeCom long connection allows a single
// live subscriber per bot, so two agents cannot share one. The way out is
// always to free the bot first, which is what each message says.
var (
// ErrBotOwnedBySameWorkspace — another agent in the admin's own workspace
// holds the bot. Reversible from the same settings screen.
ErrBotOwnedBySameWorkspace = errors.New("wecom: this bot is already connected to another agent in this workspace")
// ErrBotOwnedByArchivedAgent — the holder is archived, so it does not show
// up in the agent list and the bot looks free while it is not.
ErrBotOwnedByArchivedAgent = errors.New("wecom: this bot is connected to an archived agent in this workspace")
// ErrBotOwnedByAnotherWorkspace — the holder is out of sight entirely and
// only someone with access there can release it.
ErrBotOwnedByAnotherWorkspace = errors.New("wecom: this bot is already connected to a different Multica workspace")
)
// pgUniqueViolation is Postgres' unique_violation SQLSTATE.
const pgUniqueViolation = "23505"
// botSlotConflictErr answers one question: may this install act on the
// (wecom, bot_id) routing slot at all? It returns the sentinel to refuse with,
// or nil to proceed. MUST be called inside the transaction holding
// LockChannelInstallationAppIDSlot — outside it the answer is a guess that a
// concurrent install or reconnect can invalidate before it is used.
//
// It is the gate in front of BOTH side effects Upsert can produce: the probe's
// subscribe (which displaces whoever is connected to this bot at WeCom) and the
// reclaim's hard delete (which takes the row and its bindings). A refusal here
// costs the caller nothing and the current owner nothing.
//
// The classification mirrors ReclaimDeadChannelInstallationByAppID's own
// definition of "dead", so the two cannot drift into disagreeing about whichView on GitHub (pinned to 2c0912b6ec)
Solutions
- Disconnect the bot from the other workspace first, or use a different WeCom bot.
When it happens
Trigger: Thrown at server/internal/integrations/wecom/installation.go:310 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/0ed7d7feea3c4e52.
Report an issue: GitHub.