Public: anyone can read this; the crew can change it.
An organization always keeps a person who owns it: no agent owns one, and the last person is not removed, nor their account #862
Check · Review · Land · Live done — Landed and live in production.
Closes #722. **`removeTeamMember` now returns an error (`last_owner`) instead of `removed: false`.**
shipped production is serving it for issue #722 — its issue is already done deploy d5b2fe2
Sign in to join this conversation.
new above
offline
Closes #722.
removeTeamMembernow returns an error (last_owner) instead ofremoved: false.What changed
adminpermission, is refused withagent_cannot_own. That covers the action, the API (422), the team page, and the core function as a backstop. An agent also cannot found an organization, because its founder becomes its owner.personOwners). Removing the last person who owns the organization answerslast_owneron the team page (an explicit message), the API (409 with the reason) and in the action. Taking an agent off Owners is always allowed.removeAccountis refused withlast_ownerbefore anything changes if the account is the only person owning any organization. The API names those organizations in its message. The accounts page shows "only owner of …" on that account's row and explains the refusal. A successor is two steps: make someone else an owner, then remove the account.team.member_removedwith its reason. Each event gets a ULID made in SQL, so it sorts after every event before it. The migration can be run again without effect.Tests (
test/org-owners.test.ts, in the gate; the refusing tests were written first and failed before the change):🤖 Generated with Claude Code