diff --git a/static/messages.js b/static/messages.js index 2a2299d9b..8319ff748 100644 --- a/static/messages.js +++ b/static/messages.js @@ -5510,6 +5510,8 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){ _clearStreamEndRecovery(); _terminalStateReached=true; if(_persistTimer){clearTimeout(_persistTimer);_persistTimer=null;} + _cancelThrottledSnapshotTimer(); + _clearAnchorProseIncrementalNode(); _streamFinalized=true; _cancelAnimationFramePendingStreamRender(); _streamFadeCleanupReduceMotionListener(); @@ -5711,6 +5713,8 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){ _clearStreamEndRecovery(); _terminalStateReached=true; if(_persistTimer){clearTimeout(_persistTimer);_persistTimer=null;} + _cancelThrottledSnapshotTimer(); + _clearAnchorProseIncrementalNode(); _streamFinalized=true; _cancelAnimationFramePendingStreamRender(); _streamFadeCleanupReduceMotionListener(); @@ -5861,6 +5865,8 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){ if(!session) return returnStatus?'missing':false; if(session.active_stream_id||session.pending_user_message) return returnStatus?'active':false; if(_persistTimer){clearTimeout(_persistTimer);_persistTimer=null;} + _cancelThrottledSnapshotTimer(); + _clearAnchorProseIncrementalNode(); _streamFinalized=true; _cancelAnimationFramePendingStreamRender(); _streamFadeCleanupReduceMotionListener(); @@ -5955,6 +5961,8 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){ // Opus review Q1: mirror done/apperror/cancel finalization so any pending rAF // cannot fire after renderMessages() has settled the DOM with the error message. if(_persistTimer){clearTimeout(_persistTimer);_persistTimer=null;} + _cancelThrottledSnapshotTimer(); + _clearAnchorProseIncrementalNode(); _streamFinalized=true; _cancelAnimationFramePendingStreamRender(); _streamFadeCleanupReduceMotionListener(); diff --git a/static/ui.js b/static/ui.js index 5342cc881..bdc3a70a9 100644 --- a/static/ui.js +++ b/static/ui.js @@ -10538,13 +10538,19 @@ function _anchorSceneNodeForRow(row, opts){ const proseKey=row.local_id||row.row_id||''; if(!settled && proseKey && typeof window.__anchorProseIncrementalNode==='function'){ const inc=window.__anchorProseIncrementalNode(proseKey,text); - if(inc) return inc; + // Route the incremental node through the shared row-decoration block below + // (data-anchor-scene-row / -row-id / -row-role / -source-event-type) instead + // of returning early — otherwise live incremental prose rows lose the + // identity attributes the scene reconciler matches on. (Codex gate #5466) + if(inc){ node=inc; } + } + if(!node){ + node=document.createElement('div'); + node.className='assistant-segment'; + node.setAttribute('data-anchor-scene-prose','1'); + node.dataset.rawText=text; + node.innerHTML=`