unify all panic event to panic log file (#2250)

This commit is contained in:
Cytown
2026-04-01 23:26:49 +08:00
committed by GitHub
parent 31afad6e87
commit e2a9bb97c7
6 changed files with 34 additions and 11 deletions
+1
View File
@@ -991,6 +991,7 @@ func (al *AgentLoop) ReloadProviderAndConfig(
go func() {
defer func() {
if r := recover(); r != nil {
logger.RecoverPanicNoExit(r)
panicErr = fmt.Errorf("panic during registry creation: %v", r)
logger.ErrorCF("agent", "Panic during registry creation",
map[string]any{"panic": r})
+1
View File
@@ -427,6 +427,7 @@ func spawnSubTurn(
// 7. Defer cleanup: deliver result (for async), emit End event, and recover from panics
defer func() {
if r := recover(); r != nil {
logger.RecoverPanicNoExit(r)
err = fmt.Errorf("subturn panicked: %v", r)
result = nil
logger.ErrorCF("subturn", "SubTurn panicked", map[string]any{