multica-ai/multica · error · ErrRobotOwnedBySameWorkspace

dingtalk: this DingTalk robot is already connected to anothe

Error message

dingtalk: this DingTalk robot is already connected to another agent in this workspace

What it means

Error "dingtalk: this DingTalk robot is already connected to another agent in this workspace" thrown in multica-ai/multica.

Source

Thrown at server/internal/integrations/dingtalk/install.go:40

// Stream-mode robot, and pastes its AppKey (client id) + AppSecret (client
// secret) into Multica (the paste path lives in byo_install.go). The
// InstallService owns the at-rest encryption of the AppSecret — so no caller can
// write a channel_installation with a plaintext secret — plus the shared
// persistInstall transaction and the list / get / revoke management surface.

var (
	// ErrInstallationNotFound surfaces "no row matches in this workspace".
	ErrInstallationNotFound = errors.New("dingtalk installation not found")
	// ErrRobotOwnedByAnotherWorkspace is returned when the pasted DingTalk robot
	// is already connected to a live owner in a DIFFERENT Multica workspace — it
	// would collide with the (channel_type, app_id) routing index. A DingTalk
	// robot is one bot identity and maps to one installation/default agent;
	// group-specific routes may target other agents inside that workspace.
	ErrRobotOwnedByAnotherWorkspace = errors.New("dingtalk: this DingTalk robot is already connected to a different Multica workspace")
	// ErrRobotOwnedBySameWorkspace is returned when the robot is already connected
	// to a DIFFERENT (live, non-archived) agent in the SAME workspace, pointing
	// the user at the Disconnect they can actually reach (#4810).
	ErrRobotOwnedBySameWorkspace = errors.New("dingtalk: this DingTalk robot is already connected to another agent in this workspace")
	// ErrRobotOwnedByArchivedAgent is returned when the robot's owning agent is
	// archived (and so still holds the robot, since archiving is reversible). The
	// user recovers by restoring that agent or disconnecting its robot.
	ErrRobotOwnedByArchivedAgent = errors.New("dingtalk: this DingTalk robot is connected to an archived agent in this workspace")
)

// installQueries is the slice of generated queries InstallService needs. WithTx
// returns the same interface bound to a transaction so persistInstall runs its
// upsert atomically (and so tests can inject a fake without a real DB).
type installQueries interface {
	WithTx(tx pgx.Tx) installQueries
	LockDingTalkInstallationOwner(ctx context.Context, arg db.LockDingTalkInstallationOwnerParams) error
	GetDingTalkInstallationOwnerForUpdate(ctx context.Context, arg db.GetDingTalkInstallationOwnerForUpdateParams) (db.GetDingTalkInstallationOwnerForUpdateRow, error)
	DeleteDingTalkInstallationForReplacement(ctx context.Context, arg db.DeleteDingTalkInstallationForReplacementParams) (pgtype.UUID, error)
	UpsertChannelInstallation(ctx context.Context, arg db.UpsertChannelInstallationParams) (db.ChannelInstallation, error)
	ReclaimDeadChannelInstallationByAppID(ctx context.Context, arg db.ReclaimDeadChannelInstallationByAppIDParams) (pgtype.UUID, error)
	GetChannelInstallationOwnerByAppID(ctx context.Context, arg db.GetChannelInstallationOwnerByAppIDParams) (db.GetChannelInstallationOwnerByAppIDRow, error)
	ListChannelInstallationsByWorkspace(ctx context.Context, arg db.ListChannelInstallationsByWorkspaceParams) ([]db.ChannelInstallation, error)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Disconnect the robot from the other agent in this workspace, or use a different robot.

When it happens

Trigger: Thrown at server/internal/integrations/dingtalk/install.go:40 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/0bc66909b4ab6f53. Report an issue: GitHub.