From 40b0c449f1d7c689ef2fc60ec7ff7cca7523e8af Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 26 Oct 2025 11:31:50 +0800 Subject: [PATCH] Enhance robot member creation with additional fields - Added new fields to the robot member creation process, including permissions, restrictions, notes, and metadata, to improve the flexibility and detail of robot member configurations. - Updated the AddMember function to include tracking of the user who invited the member and the team ID, enhancing member management and accountability. - These changes improve the overall functionality and usability of the member management system. --- openapi/oauth/providers/user/member.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openapi/oauth/providers/user/member.go b/openapi/oauth/providers/user/member.go index f0007b65..4d64c705 100644 --- a/openapi/oauth/providers/user/member.go +++ b/openapi/oauth/providers/user/member.go @@ -364,6 +364,8 @@ func (u *DefaultUser) CreateRobotMember(ctx context.Context, teamID string, robo robotFields := []string{ "role_id", "system_prompt", "manager_id", "robot_config", "agents", "mcp_servers", "language_model", "cost_limit", "autonomous_mode", "robot_status", + "permissions", "restrictions", "notes", "metadata", + "__yao_created_by", "__yao_updated_by", "__yao_team_id", "__yao_tenant_id", } for _, field := range robotFields { @@ -412,6 +414,8 @@ func (u *DefaultUser) AddMember(ctx context.Context, teamID string, userID strin "invited_at": time.Now(), "invitation_token": token, "invitation_expires_at": time.Now().Add(7 * 24 * time.Hour), // 7 days expiry + "__yao_created_by": invitedBy, + "__yao_team_id": teamID, } return u.CreateMember(ctx, memberData)