251d5a91ef
- Fixed model switches deferred during streaming to apply correctly when the stream completes, preventing model changes from being lost. - Added pendingModelSwitch field to track deferred model changes during active streams. - Added flushPendingModelSwitch() method to apply deferred model switches after streaming completes. - Modified switchToPlanModel() to defer model changes when a stream is active instead of applying immediately. - Modified exitPlanMode() to defer model restoration when a stream is active instead of applying immediately. - Modified EventController to call flushPendingModelSwitch() when stream completion is detected.