agent_crew icon indicating copy to clipboard operation
agent_crew copied to clipboard

feat: Add subagents to running teams from the UI

Open sre-helmcode opened this issue 8 months ago • 1 comments

Summary

Allow users to add, edit, and remove subagents on teams that are already created or running, directly from the team monitor/detail view.

Current State

  • Backend already supports full CRUD for agents on existing teams:
    • POST /api/teams/:id/agents — Create agent
    • PUT /api/teams/:id/agents/:agentId — Update agent
    • DELETE /api/teams/:id/agents/:agentId — Delete agent
    • POST /api/teams/:id/agents/:agentId/skills/install — Install skills at runtime
  • Frontend only allows defining subagents during team creation (TeamBuilderPage.tsx, Step 2)
  • There is no UI to add/edit/remove subagents after the team is created
  • The SkillStatusPanel allows installing skills at runtime but not adding new agents

Proposed Solution

  1. Add an "Add Subagent" button in the team monitor or team detail view (visible when team is in created or running state)
  2. Subagent creation modal/panel with fields:
    • Name (required)
    • Description (required)
    • Model (dropdown: inherit, sonnet, opus, haiku)
    • Skills (optional, same UI as TeamBuilder step 2)
  3. Edit existing subagents — allow modifying description, model, and skills of existing workers
  4. Delete subagents — with confirmation dialog
  5. When team is running: After adding a subagent, the system should regenerate the .md file in the leader container (the backend UpdateAgent endpoint already handles this)

Affected Files

  • src/pages/TeamMonitorPage.tsx — Add subagent management UI
  • src/services/api.ts — Already has agentApi with CRUD methods
  • src/types/index.ts — Types already defined (CreateAgentInput, etc.)
  • Potentially new component: SubAgentManager.tsx

Acceptance Criteria

  • [ ] "Add Subagent" button visible in team detail/monitor view
  • [ ] Modal/panel to create new subagent with all required fields
  • [ ] Edit existing subagent configuration
  • [ ] Delete subagent with confirmation
  • [ ] Changes reflected immediately in the UI
  • [ ] Works for teams in created state (pre-deploy)
  • [ ] Works for teams in running state (hot-reload of agent files)
  • [ ] Proper error handling and feedback

sre-helmcode avatar Mar 19 '26 15:03 sre-helmcode

Implemented in 2e168f0. SubAgentManager integrated as 'Sub-Agents' tab in Settings modal. Full CRUD: create with MarkdownEditor/model/skills, edit, delete with confirmation. Works for stopped and running teams.

sre-helmcode avatar Mar 23 '26 16:03 sre-helmcode