{"record":{"id":"c96c41650f0844e8","repo":"multica-ai/multica","slug":"dingtalk-this-dingtalk-robot-is-connected-to-an-a","errorCode":null,"errorMessage":"dingtalk: this DingTalk robot is connected to an archived agent in this workspace","messagePattern":"dingtalk: this DingTalk robot is connected to an archived agent in this workspace","errorType":"http","errorClass":"ErrRobotOwnedByArchivedAgent","httpStatus":409,"severity":"error","filePath":"server/internal/integrations/dingtalk/install.go","lineNumber":44,"sourceCode":"// persistInstall transaction and the list / get / revoke management surface.\n\nvar (\n\t// ErrInstallationNotFound surfaces \"no row matches in this workspace\".\n\tErrInstallationNotFound = errors.New(\"dingtalk installation not found\")\n\t// ErrRobotOwnedByAnotherWorkspace is returned when the pasted DingTalk robot\n\t// is already connected to a live owner in a DIFFERENT Multica workspace — it\n\t// would collide with the (channel_type, app_id) routing index. A DingTalk\n\t// robot is one bot identity and maps to one installation/default agent;\n\t// group-specific routes may target other agents inside that workspace.\n\tErrRobotOwnedByAnotherWorkspace = errors.New(\"dingtalk: this DingTalk robot is already connected to a different Multica workspace\")\n\t// ErrRobotOwnedBySameWorkspace is returned when the robot is already connected\n\t// to a DIFFERENT (live, non-archived) agent in the SAME workspace, pointing\n\t// the user at the Disconnect they can actually reach (#4810).\n\tErrRobotOwnedBySameWorkspace = errors.New(\"dingtalk: this DingTalk robot is already connected to another agent in this workspace\")\n\t// ErrRobotOwnedByArchivedAgent is returned when the robot's owning agent is\n\t// archived (and so still holds the robot, since archiving is reversible). The\n\t// user recovers by restoring that agent or disconnecting its robot.\n\tErrRobotOwnedByArchivedAgent = errors.New(\"dingtalk: this DingTalk robot is connected to an archived agent in this workspace\")\n)\n\n// installQueries is the slice of generated queries InstallService needs. WithTx\n// returns the same interface bound to a transaction so persistInstall runs its\n// upsert atomically (and so tests can inject a fake without a real DB).\ntype installQueries interface {\n\tWithTx(tx pgx.Tx) installQueries\n\tLockDingTalkInstallationOwner(ctx context.Context, arg db.LockDingTalkInstallationOwnerParams) error\n\tGetDingTalkInstallationOwnerForUpdate(ctx context.Context, arg db.GetDingTalkInstallationOwnerForUpdateParams) (db.GetDingTalkInstallationOwnerForUpdateRow, error)\n\tDeleteDingTalkInstallationForReplacement(ctx context.Context, arg db.DeleteDingTalkInstallationForReplacementParams) (pgtype.UUID, error)\n\tUpsertChannelInstallation(ctx context.Context, arg db.UpsertChannelInstallationParams) (db.ChannelInstallation, error)\n\tReclaimDeadChannelInstallationByAppID(ctx context.Context, arg db.ReclaimDeadChannelInstallationByAppIDParams) (pgtype.UUID, error)\n\tGetChannelInstallationOwnerByAppID(ctx context.Context, arg db.GetChannelInstallationOwnerByAppIDParams) (db.GetChannelInstallationOwnerByAppIDRow, error)\n\tListChannelInstallationsByWorkspace(ctx context.Context, arg db.ListChannelInstallationsByWorkspaceParams) ([]db.ChannelInstallation, error)\n\tGetChannelInstallationInWorkspace(ctx context.Context, arg db.GetChannelInstallationInWorkspaceParams) (db.ChannelInstallation, error)\n\tSetChannelInstallationStatus(ctx context.Context, arg db.SetChannelInstallationStatusParams) error\n}\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/integrations/dingtalk/install.go#L26-L62","documentation":"Error \"dingtalk: this DingTalk robot is connected to an archived agent in this workspace\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/integrations/dingtalk/install.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore the archived agent or disconnect the robot from it before reconnecting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}