feat: agent self evolution (#2847)

* feat: add agent self-evolution

* fix ci

* delete unused doc

* fix lint

* fix evolution review issues
This commit is contained in:
lxowalle
2026-05-11 16:13:27 +08:00
committed by GitHub
parent 894c6251c5
commit b3a7b7ad64
63 changed files with 15631 additions and 56 deletions
+25
View File
@@ -0,0 +1,25 @@
package evolution
import (
"context"
"time"
)
const (
llmTaskSuccessJudgeTimeout = 15 * time.Second
llmPatternClusterTimeout = 45 * time.Second
llmDraftGenerationTimeout = 60 * time.Second
)
func withLLMCallTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) {
if parent == nil {
parent = context.Background()
}
if timeout <= 0 {
return context.WithCancel(parent)
}
if deadline, ok := parent.Deadline(); ok && time.Until(deadline) <= timeout {
return context.WithCancel(parent)
}
return context.WithTimeout(parent, timeout)
}