feat: harden jsonl runtime reliability

This commit is contained in:
lpf
2026-04-13 13:41:01 +08:00
parent 36890c7ce0
commit fac235db80
34 changed files with 4370 additions and 757 deletions

View File

@@ -193,10 +193,13 @@ func TestTryFallbackProvidersUsesFallbackProviderOptionsAndPersistsSelection(t *
},
}
resp, providerName, err := loop.tryFallbackProviders(context.Background(), bus.InboundMessage{SessionKey: "chat-1"}, nil, nil, errors.New("primary failed"))
resp, providerName, attempts, err := loop.tryFallbackProviders(context.Background(), bus.InboundMessage{SessionKey: "chat-1"}, nil, nil, errors.New("primary failed"))
if err != nil {
t.Fatalf("expected fallback success, got %v", err)
}
if attempts != 1 {
t.Fatalf("expected one fallback attempt, got %d", attempts)
}
if resp == nil || resp.Content != "fallback" {
t.Fatalf("unexpected fallback response: %#v", resp)
}