-
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 2b)
Feature Type
SDK integration (Agent SDK)
Problem or Need
SDKFilesPersistedEvent is currently captured as a generic SDKEventCapture in sdk_events[] on ExecutionResult (implemented in #348 Phase 1). The raw payload is preserved but not structured for programmatic use. A dedicated capture type would improve checkpoint debugging and enable Stage 4 to reason about file persistence reliability.
The SDKFilesPersistedEvent contains:
files[]—{ filename: string, file_id: string }[]— successfully persisted filesfailed[]—{ filename: string, error: string }[]— files that failed to persistprocessed_at— ISO timestamp of persistence operation
Proposed Solution
Move SDKFilesPersistedEvent from generic capture to a dedicated type:
-
Add
FilesPersistedCaptureinsrc/types/transcript.ts:export interface FilesPersistedCapture { files: { filename: string; file_id: string }[]; failed: { filename: string; error: string }[]; processed_at: string; timestamp: number; }
-
Add optional field to
ExecutionResult:files_persisted_events?: FilesPersistedCapture[]
-
Update
SDKEventCollectorinsrc/stages/3-execution/sdk-event-collector.ts:- Handle
isFilesPersistedEvent()with targeted capture instead of generic - Store structured data in a separate array
- Handle
-
Wire through
agent-executor.tsandsession-batching.tsresult building -
Add tests for the new capture path
Files Affected
src/types/transcript.ts— NewFilesPersistedCaptureinterface, extendExecutionResultsrc/types/index.ts— Export new typesrc/stages/3-execution/sdk-event-collector.ts— Targeted capture for files_persistedsrc/stages/3-execution/agent-executor.ts— Wire through to resultsrc/stages/3-execution/session-batching.ts— Wire through to resulttests/unit/stages/3-execution/sdk-event-collector.test.ts— New test cases
Risk Assessment
Low risk. New optional field on ExecutionResult. No state migration needed. The type guard isFilesPersistedEvent() already exists from #348.
Priority Rationale
Low-medium value — primarily useful for debugging checkpoint issues. Low effort given the foundation from #348. Could be deferred until file checkpointing problems are encountered in practice.
🤖 Created with Claude Code