Files
CyberStrikeAI/internal/workflow/agent_progress_test.go
T
Sycun cfaa95d7bd refactor(runtime): remove Eino and make Pi the sole agent engine
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.
2026-11-12 17:55:36 +08:00

26 lines
1.0 KiB
Go

package workflow
import "testing"
func TestWorkflowAgentProgressForwardsToolActivityWithNodeIdentity(t *testing.T) {
state := newWorkflowLocalState(nil, "test-only-run")
node := graphNode{ID: "agent-1", Type: "agent", Label: "Agent"}
events := []string{}
callback := workflowAgentProgress(func(kind, message string, data interface{}) {
events = append(events, kind)
m, ok := data.(map[string]interface{})
if !ok || m["workflowNodeId"] != node.ID || m["workflowRunId"] != state.WorkflowRunID {
t.Fatalf("missing workflow identity: %#v", data)
}
}, state, node)
for _, kind := range []string{"iteration", "tool_call", "tool_result"} {
callback(kind, "test-only activity", map[string]interface{}{"iteration": 1, "agentScope": "main"})
}
for _, kind := range []string{"response_start", "response_delta", "response", "done"} {
callback(kind, "", nil)
}
if len(events) != 3 || events[0] != "iteration" || events[1] != "tool_call" || events[2] != "tool_result" {
t.Fatalf("activity not forwarded or nested terminal leaked: %v", events)
}
}