Context
PR #375 added significant orchestration recovery logic (premature idle recovery, dead event stream fallback, lazy session resume). The test coverage is currently mostly structural (source-code pattern checks via Assert.Contains) rather than behavioral.
Missing behavioral test coverage
EnsureSessionConnectedAsync — no end-to-end test for resume + fresh-create fallback + GetClientForGroup routing
- Premature idle recovery loop — no test with real
ManualResetEventSlim signaling and OnSessionComplete events
bestResponse multi-round accumulation — no test verifying longest response wins across recovery rounds
- DateTime filtering correctness — no test verifying
dispatchTime filter works with local timestamps
- OCE handling — no test verifying
bestResponse is preserved when inner recovery CTS fires
- Dead event stream recovery — no test for
LoadHistoryFromDiskAsync fallback with temp events.jsonl
Suggested approach
Create integration-style tests using Demo mode stubs that simulate the event sequences (premature idle, dead streams, OCE). The MultiAgentRegressionTests pattern with StubCopilotSession could be extended.
Priority
Medium — structural tests catch regressions at the code-pattern level, but behavioral tests would catch logic bugs that structural tests miss.