@@ -2150,6 +2150,13 @@ it.layer(McpProviderSessions.layer)("OpenCode2 adapter", (it) => {
21502150 const { runtime, thread } = yield * resumed ( [
21512151 out ( "session.prompt" , { sessionID : SESSION , id : PROMPT_ID , text : "<any>" } ) ,
21522152 promptAccepted ,
2153+ event ( "session.step.started" , {
2154+ sessionID : SESSION ,
2155+ assistantMessageID : "msg_before_gap" ,
2156+ agent : "build" ,
2157+ model : { id : "big-pickle" , providerID : "opencode" , variant : "default" } ,
2158+ started : 1 ,
2159+ } ) ,
21532160 event ( "session.step.ended" , {
21542161 sessionID : SESSION ,
21552162 assistantMessageID : "msg_before_gap" ,
@@ -2171,15 +2178,15 @@ it.layer(McpProviderSessions.layer)("OpenCode2 adapter", (it) => {
21712178 "command_execution:completed" ,
21722179 ] ) ;
21732180 assert . deepInclude ( collected . at ( - 1 ) , { type : "turn.terminal" , status : "completed" } ) ;
2174- // Steps that ended during the gap sent no tokens, so the measured step is only part of it .
2181+ // Steps that ended during the gap sent no tokens or models , so both stay incomplete .
21752182 const settled = collected . findLast (
21762183 ( event ) =>
21772184 event . type === "provider_turn.updated" && event . providerTurn . completedAt !== null ,
21782185 ) ;
2179- assert . deepInclude (
2180- settled ?. type === "provider_turn.updated" ? settled . providerTurn . turnTokenUsage : undefined ,
2181- { usageStatus : "partial" , inputTokens : 100 , outputTokens : 10 } ,
2182- ) ;
2186+ const usage =
2187+ settled ?. type === "provider_turn.updated" ? settled . providerTurn . turnTokenUsage : undefined ;
2188+ assert . deepInclude ( usage , { usageStatus : "partial" , inputTokens : 100 , outputTokens : 10 } ) ;
2189+ assert . notProperty ( usage , "models" ) ;
21832190 } ) . pipe ( Effect . scoped ) ,
21842191 ) ;
21852192
0 commit comments