Problem
PR #1428 adds new behavior (SessionId enrichment, mandatory activity sink, OTel trace correlation) but has no tests covering these changes.
What Needs Testing
- SessionId enrichment — Verify that sub-agent log events include a
SessionId property matching the parent session when spawned within a session context.
- Discard channel behavior — Verify that when
activitySink is null, a discard channel is created and passed to the sub-agent without errors.
- OTel trace correlation — Verify that the spawner's Activity has the correct parent trace ID set.
- Tool START events — Verify that tool execution logs include a
tool start event (separate from the existing result event).
- Tool denial logging — Verify that tool denials appear at INFO level (previously DEBUG).
Proposed Tests
- Unit test:
SubAgentSpawnerTests — SessionIdEnrichment_WhenSpawned_InSessionContext
- Unit test:
SubAgentSpawnerTests — ActivitySink_IsDiscardChannel_WhenNotProvided
- Integration test:
SubAgentActorTests — ToolStartEvents_Emitted_WithCallId
- Integration test:
SubAgentActorTests — SummaryLog_IncludesCumulativeStats
- Integration test:
SubAgentSpawnerTests — ToolDenials_LogAtInfoLevel
References
Problem
PR #1428 adds new behavior (SessionId enrichment, mandatory activity sink, OTel trace correlation) but has no tests covering these changes.
What Needs Testing
SessionIdproperty matching the parent session when spawned within a session context.activitySinkis null, a discard channel is created and passed to the sub-agent without errors.tool startevent (separate from the existingresultevent).Proposed Tests
SubAgentSpawnerTests—SessionIdEnrichment_WhenSpawned_InSessionContextSubAgentSpawnerTests—ActivitySink_IsDiscardChannel_WhenNotProvidedSubAgentActorTests—ToolStartEvents_Emitted_WithCallIdSubAgentActorTests—SummaryLog_IncludesCumulativeStatsSubAgentSpawnerTests—ToolDenials_LogAtInfoLevelReferences
SubAgentSpawner.csSubAgentActor.cs