Skip to content

feat: support team member management and cleanup team references on agent removal#153

Merged
jlia0 merged 1 commit intoTinyAGI:mainfrom
mokizzz:main
Mar 3, 2026
Merged

feat: support team member management and cleanup team references on agent removal#153
jlia0 merged 1 commit intoTinyAGI:mainfrom
mokizzz:main

Conversation

@mokizzz
Copy link
Copy Markdown
Contributor

@mokizzz mokizzz commented Mar 3, 2026

Summary

This PR adds team member management commands and fixes stale team references when removing an agent.

It introduces team add-agent and team remove-agent, and updates agent remove to detect team memberships and clean them up safely (including leader reassignment or empty-team deletion when needed).

This PR was completed with assistance from gpt-5.3-codex.

Changes

  • Added new team CLI commands:
  • tinyclaw team add-agent <team_id> <agent_id>
  • tinyclaw team remove-agent <team_id> <agent_id>
  • Added leader-safe removal flow for team remove-agent:
  • prompts for a new leader if the removed member is current leader
  • prevents removing the last team member via remove-agent (requires team remove for full deletion)
  • Enhanced agent remove <agent_id>:
  • checks whether the agent belongs to any teams
  • prompts user that team membership will be removed together
  • removes the agent from all related teams after confirmation
  • auto-reassigns team leader when needed
  • removes team if it becomes empty
  • Updated help/usage text in CLI for new team commands
  • Updated documentation:
  • README.md
  • docs/TEAMS.md
  • docs/AGENTS.md

Type of Change

  • Bug fix
  • New feature
  • Enhancement to existing feature
  • Breaking change
  • Documentation update
  • Refactor / code cleanup

Testing

  • Ran shell syntax checks:
  • bash -n lib/teams.sh
  • bash -n lib/agents.sh
  • bash -n tinyclaw.sh
  • Ran local behavior tests using temporary TINYCLAW_HOME + test settings.json:
  • team add-agent successfully adds member
  • team remove-agent handles leader removal and leader reassignment
  • agent remove warns about team impact and removes team membership together
  • team is deleted automatically when it becomes empty

Checklist

  • I have tested these changes locally
  • My changes don't introduce new warnings or errors
  • I have updated documentation if needed

@jlia0 jlia0 merged commit 37b2c02 into TinyAGI:main Mar 3, 2026
@jlia0
Copy link
Copy Markdown
Collaborator

jlia0 commented Mar 3, 2026

thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants