Reject empty and truncated answers and expose complete tool calls

This commit is contained in:
sausheong committed 2026-09-11 23:48:25 +08:00
1 parent 019a38f111
commit 3ca0994437
14 files changed
+278 -7

No files matched your search

+3 -2
View File
@@ -102,7 +102,8 @@ func (s *scriptedStreamLLM) ChatStream(ctx context.Context, _ llm.ChatRequest) (
go func() {
defer close(out)
if n != 1 {
// Subsequent turns: terminate quickly with no tool calls.
// Subsequent turns: answer without further tool calls.
out <- llm.ChatEvent{Type: llm.EventTextDelta, Text: "Answer"}
out <- llm.ChatEvent{Type: llm.EventDone}
return
}
@@ -791,7 +792,7 @@ func TestRun_StreamingCortexAppendIsRaceClean(t *testing.T) {
Model: "test",
MaxTurns: 2,
KG: neverRecallKG{}, // non-nil sentinel; never invoked
IngestSource: "cron", // disables deferred IngestThreadAsync
IngestSource: "cron", // disables deferred IngestThreadAsync
}
// Trivial userMsg "ok" → ShouldRecall returns false → no Recall call on