#25951 Race condition in /team/member_add — concurrent requests lose team members
## Bug Description
`POST /team/member_add` has a race condition when multiple concurrent requests add members to the same team. Only 1-2 members get persisted per batch — the rest are silently lost.
## Root Cause
The `team_member_add` function in `team_endpoints.py` uses a **read-modify-write** pattern without any locking or transaction:
1. **READ**: Fetches current `members_with_roles` from `LiteLLM_TeamTable` 2. **MODIFY**: Appends new member to the list in memory 3. **WRITE**: Overwrites the entire `members_with_roles` column with `json.dumps()`
When two requests execute concurrently: 1. Request A reads members: `[alice, bob]` 2. Request B reads members: `[alice, bob]` (same snapshot) 3. Request A writes: `[alice, bob, carol]` 4. Request B writes: `[alice, bob, dave]` → **carol is lost**
The last write wins, silently dropping members added by concurrent requests.
## Steps to Reproduce
1. Create a team 2. Send 5+ `POST /team/member_add` requests concurrently (e.g., via Terraform with default parallelism) 3. Check `GET /team/info` → only 1-2 of the 5 members are in `members_with_roles` 4. The API returns 200 for all requests — no errors reported
## Expected Behavior
All …