| 1 | package agent |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "time" |
| 6 | |
| 7 | "reasonix/internal/event" |
| 8 | ) |
| 9 | |
| 10 | func TestSubagentProgressPartialIsTerminal(t *testing.T) { |
| 11 | clock := newFakeProgressClock(time.Unix(0, 0)) |
| 12 | ch := make(chan event.Event, 16) |
| 13 | trk := newTestTracker(t, clock, chanSink{ch: ch}, "child-partial") |
| 14 | trk.running() |
| 15 | _ = waitEvent(t, ch, "running status") |
| 16 | trk.finish(nil, &SubagentRunError{Outcome: SubagentOutcome{Status: SubagentOutcomePartial, Retryable: true}}) |
| 17 | statuses := collectFor(t, ch, 100*time.Millisecond) |
| 18 | if len(statuses) != 1 || statuses[0].Tool.Output != string(subagentPhasePartial) { |
| 19 | t.Fatalf("partial terminal events = %+v, want one partial status", statuses) |
| 20 | } |
| 21 | } |
| 22 |