fix: stop stale chat renders after session switches

Roll back aggressive chat reuse paths that froze message parts, tool state, and completed assistant bodies when sessions were inactive or backgrounded.
This commit is contained in:
Bohdan Triapitsyn
2026-04-07 20:33:55 +03:00
parent c16d767dff
commit 605e4bf42c
10 changed files with 90 additions and 523 deletions
@@ -2024,8 +2024,7 @@ const ToolPart: React.FC<ToolPartProps> = ({
const childSessionIsActive =
childSessionActivity.phase === 'busy'
|| childSessionActivity.phase === 'retry'
|| childSessionHasInFlightTools
|| (!isFinalized && activeLatched);
|| childSessionHasInFlightTools;
if (childSessionIsActive) {
if (!taskChildSeenActive) {
@@ -2106,7 +2105,7 @@ const ToolPart: React.FC<ToolPartProps> = ({
const childSessionActive = childSessionActivity.phase === 'busy' || childSessionActivity.phase === 'retry';
const shouldPoll =
!taskChildPollingStopped
&& (isActive || childSessionHasInFlightTools || childSessionActive || childSessionTaskSummaryEntries.length === 0);
&& (childSessionHasInFlightTools || childSessionActive || childSessionTaskSummaryEntries.length === 0);
const shouldFetchSnapshot = childSessionTaskSummaryEntries.length === 0 || shouldPoll;
if (!shouldFetchSnapshot) {
return;