-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Parent Issue
Sub-issue of #344 (Leverage Additional SDK v0.2.25 Capabilities)
Follow-up to #348 (Phase 2a)
Feature Type
SDK integration (Agent SDK)
Problem or Need
SDKTaskNotificationMessage is currently captured as a generic SDKEventCapture in sdk_events[] on ExecutionResult (implemented in #348 Phase 1). This provides basic storage but loses the opportunity to correlate task notifications with existing SubagentCapture entries, which would enrich subagent lifecycle tracking for Stage 4 evaluation.
The SDKTaskNotificationMessage contains:
task_id— correlates withSubagentCapture.agentIdstatus—"completed" | "failed" | "stopped"output_file— path to task outputsummary— LLM-generated summary of task result
Proposed Solution
Move SDKTaskNotificationMessage from generic capture to targeted SubagentCapture enrichment:
-
Extend
SubagentCaptureinsrc/types/transcript.tswith optional fields:taskStatus?: "completed" | "failed" | "stopped"taskOutputFile?: stringtaskSummary?: string
-
Update
SDKEventCollector.processMessage()insrc/stages/3-execution/sdk-event-collector.ts:- Accept
subagentCaptures: SubagentCapture[]as a third parameter - Handle
isTaskNotificationMessage()with targeted enrichment (correlatetask_id→agentId) - Fall through to generic capture if no matching
SubagentCaptureis found
- Accept
-
Update callers in
agent-executor.tsandsession-batching.tsto passsubagentCapturestoprocessMessage() -
Add tests for correlation logic, including edge cases:
- Task notification matching an existing SubagentCapture
- Task notification with no matching SubagentCapture (falls to generic)
- Overlap with SubagentStop hook data (complementary, not conflicting)
Files Affected
src/types/transcript.ts— ExtendSubagentCapturesrc/stages/3-execution/sdk-event-collector.ts— Add targeted enrichmentsrc/stages/3-execution/agent-executor.ts— PasssubagentCapturesto collectorsrc/stages/3-execution/session-batching.ts— PasssubagentCapturesto collectortests/unit/stages/3-execution/sdk-event-collector.test.ts— New test cases
Risk Assessment
Low risk. Additive optional fields on SubagentCapture. The type guard isTaskNotificationMessage() already exists from #348. No state migration needed.
Priority Rationale
Medium value — enriches subagent tracking with completion status and summaries. Low effort given the foundation from #348.
🤖 Created with Claude Code