Delegate permet de lancer et de gérer des processus de tâches asynchrones, vous permettant d'exécuter des sessions de clavardage Kiro avec des agents spécifiques en parallèle de votre conversation principale. Les subagents étendent cette capacité en fournissant des agents spécialisés capables de gérer de façon autonome des tâches complexes avec un suivi de progression en temps réel.
La fonctionnalité delegate vous permet de :
kiro-cli settings chat.enableDelegate true
Ou utilisez la commande expérimentale :
/experiment # Select "Delegate" from the list
Utilisez le langage naturel pour demander à Kiro de lancer une tâche en arrière-plan :
> Can you create a background task to analyze the performance of our API endpoints?
Kiro va :
Tâches avec agents :
Tâches sans agents :
Une fois déléguées, les tâches fonctionnent de façon indépendante. Vous pouvez :
> Can you create a background task to analyze the performance of our API endpoints? I'll create a background task to analyze your API performance. Agent: performance-analyzer Tools: read, shell, aws Resources: api-docs, performance-metrics Approve this agent? (y/n): y ✓ Task created: api-performance-analysis Task ID: task-abc123 Status: Running You can continue working while the analysis runs in the background. > Great! Now help me with the frontend code... # Continue main conversation > Check the status of my API analysis task Let me check on that task... Task: api-performance-analysis (task-abc123) Status: Complete Duration: 2m 34s Results: - Analyzed 15 API endpoints - Found 3 performance bottlenecks - Generated optimization recommendations Would you like me to show you the detailed results?
> Run our test suite in the background while I work on the new feature I'll start the test suite in a background task. ✓ Task created: test-suite-run Task ID: task-def456 Status: Running # Continue working on feature > How's the test suite doing? Let me check... Task: test-suite-run (task-def456) Status: Running (45% complete) Progress: 127/283 tests passed Still running. I'll let you know when it's complete.
> Generate API documentation in the background I'll create a task to generate your API documentation. ✓ Task created: api-docs-generation Task ID: task-ghi789 Status: Running # Work on other things > Show me the results from the documentation task Task: api-docs-generation (task-ghi789) Status: Complete Generated documentation for: - 23 API endpoints - 15 data models - 8 authentication methods Documentation saved to: docs/api/
> Create a background task to [description]
Kiro analyse la demande et détermine :
Si un agent est requis, vous verrez :
Agent: task-agent-name Description: What this agent does Tools: List of tools it can use Resources: Files it can access Approve this agent? (y/n):
La tâche s'exécute en arrière-plan pendant que vous poursuivez votre conversation principale.
Vérifiez le statut à tout moment :
> Check on [task name] > What's the status of my background task? > Show me task progress
Une fois terminé, vous pouvez :
> Show me the results from [task name] > What did the background task find?
Supprimez les tâches une fois terminées :
> Delete the [task name] task > Clean up completed tasks
Examinez toujours les détails de l'agent avant l'approbation :
Les tâches sans agents s'exécutent avec des permissions élevées :
Vérifiez que delegate est activé :
kiro-cli settings chat.enableDelegate
Vérifiez les erreurs : Recherchez les messages d'erreur dans le clavardage
Essayez une tâche plus simple : Testez d'abord avec une tâche de base
Vérifiez l'ID de la tâche : Assurez-vous d'utiliser le bon nom/ID de tâche
Vérifiez si la tâche est terminée : Les tâches terminées peuvent avoir été nettoyées
Listez toutes les tâches : Demandez à Kiro d'afficher toutes les tâches actives
Examinez attentivement les détails de l'agent : Assurez-vous de bien comprendre les permissions
Vérifiez que l'agent existe : Vérifiez que l'agent est correctement configuré
Essayez sans agent : Certaines tâches peuvent s'exécuter sans agent spécifique
Créez des agents spécialisés pour les tâches en arrière-plan courantes :
{ "name": "test-runner", "description": "Runs test suites in background", "tools": ["shell", "read"], "allowedTools": ["shell"], "toolsSettings": { "shell": { "allowedCommands": ["npm test", "pytest", "cargo test"] } } }
Tâches d'analyse :
> Analyze code quality in the background > Run security scan as a background task > Generate performance report in background
Tâches de build :
> Build the project in the background > Compile and run tests as a background task > Generate production bundle in background
Tâches de surveillance :
> Monitor log files in the background > Watch for file changes as a background task > Track system metrics in background
Delegate