agent-exec transport fb210f7fecc330e94bf619a5fb064a9c/3e52e52b4541

This commit is contained in:
agent-exec-transport
2026-10-21 05:38:29 +00:00
parent 07228aa381
commit 9a6f0f880f
9 changed files with 101 additions and 10 deletions
+10 -3
View File
@@ -25,7 +25,7 @@ func TestMaterialFinalReserveAfterTwoCheckpoints(t *testing.T) {
turn("", toolCall(workCheckpointTool, strings.Replace(checkpointJSON(), `"cp1"`, `"cp2"`, 1))),
turn("整理完成"),
}, nil)
calls, finalOnly, identityStable := 0, false, false
calls, finalOnly, identityStable, reminderHasBrevity := 0, false, false, false
firstSystem, firstUser := "", ""
r := &SubLLMRunner{Stream: func(ctx context.Context, model string, msgs []agentllm.Message, decls []agentllm.ToolDecl, opts agentllm.StreamOptions) <-chan agentllm.Event {
calls++
@@ -59,14 +59,21 @@ func TestMaterialFinalReserveAfterTwoCheckpoints(t *testing.T) {
reminder = reminder || (msg.Role == agentllm.RoleSystem && strings.Contains(msg.Content, "不再发布检查点"))
}
finalOnly = finalOnly && reminder
reminderHasBrevity = false
for _, msg := range msgs {
if msg.Role == agentllm.RoleSystem && strings.Contains(msg.Content, "不再发布检查点") {
reminderHasBrevity = strings.Contains(msg.Content, "约1500字以内") && strings.Contains(msg.Content, "一次写完") && strings.Contains(msg.Content, "不要逐条复述材料原文")
break
}
}
}
return base(ctx, model, msgs, decls, opts)
}}
if err := r.Execute(rc); err != nil {
t.Fatal(err)
}
if calls != 3 || len(rc.checkpoints) != 2 || !finalOnly || !identityStable {
t.Fatalf("final-only transition or evaluator identity missing: calls=%d checkpoints=%d finalOnly=%v identityStable=%v", calls, len(rc.checkpoints), finalOnly, identityStable)
if calls != 3 || len(rc.checkpoints) != 2 || !finalOnly || !identityStable || !reminderHasBrevity {
t.Fatalf("final-only transition, evaluator identity, or brevity reminder missing: calls=%d checkpoints=%d finalOnly=%v identityStable=%v brevityReminder=%v", calls, len(rc.checkpoints), finalOnly, identityStable, reminderHasBrevity)
}
}