Tüm roadmap'e dön
topiccore
Döngü Sonlandırma Stratejileri
Agent ne zaman durmalı? 4 sinyal: goal complete, max iter, repetition, confidence.
2 saat1 önkoşul
1. Goal completion: model <task_complete> token'ı veya stop_reason="end_turn" döndürür. En temizi.
2. Max iterations: hard limit (ör. 30). Önemli safety net.
3. Repetition detection: model son 3 turn'de aynı tool'u aynı parametreyle çağırıyorsa → loop'ta sıkışmış, kır.
4. Confidence threshold: her turn sonunda model'e "Hedefe % kaç yaklaştın?" sor, %95+ ise bitir.
5. Budget exhaustion: token / cost limit aşılırsa graceful stop + summary.
Production örnek: Claude Code 25 iterasyon default; çok karmaşık görevde "Devam edeyim mi?" diye kullanıcıya sorar.