mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-11-13 15:57:22 +01:00
Delete the Eino model adapters, callbacks, middleware, orchestration, summarization and single-agent runner together with their dependencies. Chat, batch tasks, workflow Agent nodes and sub-agents now share the Pi runtime, and dispatch is a single code path instead of an engine switch. Configuration migrates eino_middleware/eino_skills to runtime/skills and drops the retired callback settings while old files still load. Settings, i18n and docs describe Pi only. Also carry the Pi follow-up fixes: empty required lists are omitted from tool schemas, historical tool results stay with their call batch, model proxies work over HTTP/1.1, single-query retrieval skips query expansion, and finalization docs match Pi lifecycle events.
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package multiagent
|
|
|
|
import "testing"
|
|
|
|
func TestIsEmptyResponseResult(t *testing.T) {
|
|
empty := &RunResult{
|
|
Response: "(Pi single-agent session completed but no assistant text was captured. Check process details or logs.) " +
|
|
"(Pi 单代理会话已完成,但未捕获到助手文本输出。请查看过程详情或日志。)",
|
|
}
|
|
if !IsEmptyResponseResult(empty) {
|
|
t.Fatal("expected empty placeholder response")
|
|
}
|
|
ok := &RunResult{Response: "扫描完成,发现 2 个开放端口。"}
|
|
if IsEmptyResponseResult(ok) {
|
|
t.Fatalf("expected real response, got placeholder match")
|
|
}
|
|
if IsEmptyResponseResult(nil) {
|
|
t.Fatal("nil result should be false")
|
|
}
|
|
}
|
|
|
|
func TestHasResumeTrace(t *testing.T) {
|
|
if HasResumeTrace(nil) {
|
|
t.Fatal("nil")
|
|
}
|
|
if HasResumeTrace(&RunResult{LastAgentTraceInput: "[]"}) {
|
|
t.Fatal("enable resume on empty trace")
|
|
}
|
|
if !HasResumeTrace(&RunResult{LastAgentTraceInput: `[{"role":"user","content":"hi"}]`}) {
|
|
t.Fatal("expected resume trace")
|
|
}
|
|
}
|
|
|
|
func TestEmptyResponseContinueMaxAttemptsFromConfig(t *testing.T) {
|
|
if got := EmptyResponseContinueMaxAttemptsFromConfig(nil); got != defaultEmptyResponseContinueMaxAttempts {
|
|
t.Fatalf("default: got %d want %d", got, defaultEmptyResponseContinueMaxAttempts)
|
|
}
|
|
}
|