mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-27 14:07:29 +08:00
feat: harden jsonl runtime reliability
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user