返回 DeepSeek-Reasonix
subagent_lifecycle_test.go
根目录 / internal / event / subagent_lifecycle_test.go
1 package event
2
3 import "testing"
4
5 type lifecycleAuditSink struct {
6 info []SubagentLifecycleInfo
7 }
8
9 func (s *lifecycleAuditSink) Emit(Event) {}
10
11 func (s *lifecycleAuditSink) RecordSubagentLifecycle(info SubagentLifecycleInfo) {
12 s.info = append(s.info, info)
13 }
14
15 func TestRecordSubagentLifecycleForwardsThroughWrappers(t *testing.T) {
16 inner := &lifecycleAuditSink{}
17 wrapped := Sync(inner)
18 want := SubagentLifecycleInfo{Phase: "child_partial", Ref: "sa_child", Status: "partial", Retryable: true}
19 RecordSubagentLifecycle(wrapped, want)
20 if len(inner.info) != 1 || inner.info[0] != want {
21 t.Fatalf("lifecycle audit = %+v, want %+v", inner.info, want)
22 }
23 }
24
24 lines GO