Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
-- Add bot_union_id to lark_installation so the WS inbound decoder can
-- match group-chat @-mentions against the bot's stable cross-app identity
-- (union_id) instead of the per-app open_id.
--
-- Why this column exists: Bohan's live-env triage on MUL-2671 showed that
-- in a group chat where two Multica-installed bots are bound, Lark's
-- `mentions[].id.open_id` field on `im.message.receive_v1` is structurally
-- inverse to /open-apis/bot/v3/info's `bot.open_id`. The bot whose WS
-- receives the event sees its OWN payload-form open_id when the OTHER
-- bot was @-mentioned, and a different open_id when itself was the
-- target. The only payload field consistent across both perspectives is
-- `union_id` — see the diag-log capture in MUL-2671 review.
--
-- Nullable on purpose: installations created before this migration won't
-- have a union_id until the registration service backfills them (next
-- run of GetBotInfo or a one-shot operator backfill). The decoder
-- short-circuits to its previous open_id-only match when bot_union_id IS
-- NULL, so pre-migration rows continue to work as they did before. New
-- installs populate it during finishSuccess.
ALTER TABLE lark_installation
ADD COLUMN bot_union_id TEXT;