File tree Expand file tree Collapse file tree
packages/opencode/src/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -578,6 +578,7 @@ export const Assistant = Schema.Struct({
578578 structured : Schema . optional ( Schema . Any ) ,
579579 variant : Schema . optional ( Schema . String ) ,
580580 finish : Schema . optional ( Schema . String ) ,
581+ responseHeaders : Schema . optional ( Schema . Record ( Schema . String , Schema . String ) ) ,
581582} )
582583 . annotate ( { identifier : "AssistantMessage" } )
583584 . pipe ( withStatics ( ( s ) => ( { zod : zod ( s ) } ) ) )
Original file line number Diff line number Diff line change @@ -471,6 +471,8 @@ export const layer: Layer.Layer<
471471 ctx . assistantMessage . finish = value . finishReason
472472 ctx . assistantMessage . cost += usage . cost
473473 ctx . assistantMessage . tokens = usage . tokens
474+ if ( value . response . headers && Object . keys ( value . response . headers ) . length > 0 )
475+ ctx . assistantMessage . responseHeaders = value . response . headers
474476 yield * session . updatePart ( {
475477 id : PartID . ascending ( ) ,
476478 reason : value . finishReason ,
You can’t perform that action at this time.
0 commit comments