Verify prepared notification ownership and cleanup
This commit is contained in:
@@ -46,10 +46,12 @@ func TestPublicRetryRepairSequenceKeepsUsageAndEventsConsistent(t *testing.T) {
|
||||
}
|
||||
var events []promptkit.ExecutionEvent
|
||||
req := simpleGenerationRequest()
|
||||
notifications := 0
|
||||
req.OnPrepared = func(context.Context, promptkit.PreparedRun) { notifications++ }
|
||||
req.Validation = &promptkit.OutputContract{Format: promptkit.FormatJSON, ValidationMode: promptkit.ValidationJSON, RepairAttempts: 1}
|
||||
req.Observer = func(event promptkit.ExecutionEvent) { events = append(events, event) }
|
||||
result, err := engine.Run(context.Background(), req)
|
||||
if err != nil || result == nil || !result.Validation.IsValid || calls != 4 {
|
||||
if err != nil || result == nil || !result.Validation.IsValid || calls != 4 || notifications != 1 {
|
||||
t.Fatalf("result=%+v error=%v calls=%d", result, err, calls)
|
||||
}
|
||||
if len(events) != 8 {
|
||||
|
||||
Reference in New Issue
Block a user