@@ -42,7 +42,7 @@ async function collect(stream: AsyncGenerator<AdapterEvent>): Promise<AdapterEve
4242 const events : AdapterEvent [ ] = [ ] ;
4343 // Heartbeats are invisible downstream: the bridge consumes them to re-arm its stall
4444 // watchdog and emits nothing. Dropping them here keeps these assertions about the wire
45- // the client actually sees (#2156) .
45+ // the client actually sees.
4646 for await ( const event of stream ) if ( event . type !== "heartbeat" ) events . push ( event ) ;
4747 return events ;
4848}
@@ -924,10 +924,14 @@ describe("openai-chat response_format emission", () => {
924924 } ) ;
925925 } ) ;
926926
927- // #2156: tool-call deltas are BUFFERED until a terminal signal, so this adapter can consume
928- // upstream frames for a long time while yielding nothing downstream. The Responses bridge
929- // arms its stall watchdog on ADAPTER activity, not socket activity, so a model streaming a
930- // large argument payload was indistinguishable from a hung upstream.
927+ // Tool-call deltas are BUFFERED until a terminal signal, so this adapter can consume upstream
928+ // frames for a long time while yielding nothing downstream. The Responses bridge arms its
929+ // stall watchdog on ADAPTER activity, not socket activity, so a model streaming a large
930+ // argument payload was indistinguishable from a hung upstream.
931+ //
932+ // Found while investigating #2156 but deliberately NOT claimed as its fix: a stall abort
933+ // emits `response.incomplete` with `upstream_stall_timeout`, while that report shows the
934+ // adapter's own EOF error with tool calls still pending. This pins the mechanism only.
931935test ( "tool-call deltas emit heartbeats so a long buffering phase is not read as a stall" , async ( ) => {
932936 const adapter = createOpenAIChatAdapter ( provider ( ) ) ;
933937 const frames = [ 'data: ' + JSON . stringify ( { choices : [ { delta : { tool_calls : [ { index : 0 , id : "call_a" , function : { name : "shell" , arguments : "" } } ] } } ] } ) + '\n\n' ] ;
0 commit comments