File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ export class InterruptSession {
1313 observeNative ( entries : unknown [ ] , runId ?: string ) : void {
1414 if ( entries . length === 0 ) throw new Error ( 'Native interrupt outcome must contain interrupts' ) ;
1515 if ( this . isLateObservation ( runId ) ) return ;
16- const parsed = entries . map ( entry => InterruptSchema . passthrough ( ) . parse (
17- isRecord ( entry ) && entry [ 'reason' ] === undefined ? { ...entry , reason : '' } : entry ,
18- ) ) ;
16+ const parsed = entries . map ( entry => {
17+ const normalized = isRecord ( entry ) && entry [ 'reason' ] === undefined ? { ...entry , reason : '' } : entry ;
18+ // Keep the SDK's declared output type across consumer strictness settings.
19+ // Preserve extensions separately instead of re-inferring a passthrough schema.
20+ const validated = InterruptSchema . parse ( normalized ) ;
21+ return { ...( isRecord ( normalized ) ? normalized : { } ) , ...validated } ;
22+ } ) ;
1923 if ( new Set ( parsed . map ( entry => entry . id ) ) . size !== parsed . length ) throw new Error ( 'Duplicate interrupt id' ) ;
2024 this . beginObservation ( runId ) ;
2125 const merged = new Map ( this . state . interrupts . map ( entry => [ entry . id , entry ] ) ) ;
You can’t perform that action at this time.
0 commit comments