Add files via upload

This commit is contained in:
公明
2026-08-15 02:14:36 +08:00
committed by GitHub
parent 9f38fda15f
commit ee4676a591
72 changed files with 11131 additions and 0 deletions
@@ -0,0 +1,23 @@
package workflow
import (
"strings"
"testing"
)
func TestTruncateWorkflowToolOutputBoundsBytesAndKeepsExecutionReference(t *testing.T) {
out := truncateWorkflowToolOutput(strings.Repeat("响应正文", 1000), 256, "exec-123")
if len(out) > 256 {
t.Fatalf("workflow output bytes=%d, want <=256", len(out))
}
if !strings.Contains(out, "exec-123") || !strings.Contains(out, "truncated") {
t.Fatalf("missing truncation reference: %q", out)
}
}
func TestTruncateWorkflowToolOutputLeavesBoundedContentUntouched(t *testing.T) {
const want = "small-result"
if got := truncateWorkflowToolOutput(want, 256, "exec-123"); got != want {
t.Fatalf("got %q want %q", got, want)
}
}