Skip to content

fix(flow-chat): keep historical sessions responsive#1006

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/fix-history-session-loading
Jun 1, 2026
Merged

fix(flow-chat): keep historical sessions responsive#1006
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/fix-history-session-loading

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

@limityan limityan commented Jun 1, 2026

Summary

  • Keep ready restored sessions from being skipped by the legacy-to-modern store sync when the modern projection is unexpectedly empty.
  • Cache virtual items for stable completed turns so active-turn updates do not repeatedly rebuild old history turns.
  • Defer large collapsed default tool-card previews from the earlier fix.
  • Remove the hot-path per explore-group debug log that produced thousands of repeated webview log entries during the latest repro.

Root cause

The first logs showed historical hydration completing, but rendering was expensive because collapsed default tool cards still eagerly built detailed previews from large persisted tool results.

The latest repro looks different: the webview logs do not contain historical_session_* / restore_session_view markers or repeated large default WebFetch cards, but they do show thousands of repeated ModernFlowChatStore explore-group projection logs. That points to the UI/store projection path rather than backend history loading. If the active restored session is already ready while ModernFlowChatStore.virtualItems remains empty, the existing sync short-circuit can leave the loading placeholder visible until a session switch forces another sync.

Impact

  • Restored history sessions with renderable content now re-sync if the modern projection is empty instead of staying on the loading shell.
  • Completed historical turns are reused while later active turns change, reducing repeated projection work on large sessions.
  • Collapsed default tool cards still show bounded summaries; expanded details still render on demand.

Validation

  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run src/flow_chat/services/storeSync.test.ts src/flow_chat/store/modernFlowChatStore.test.ts src/flow_chat/components/modern/ModernFlowChatContainer.history-state.test.tsx src/flow_chat/tool-cards/DefaultToolCard.test.tsx
  • pnpm run check:repo-hygiene
  • git diff --check

@limityan limityan force-pushed the yanzhn/fix-history-session-loading branch from 674fe7e to d6c9dd0 Compare June 1, 2026 08:07
@limityan limityan changed the title fix(flow-chat): defer default tool card payload previews fix(flow-chat): keep historical sessions responsive Jun 1, 2026
@limityan limityan force-pushed the yanzhn/fix-history-session-loading branch from d6c9dd0 to 27996a6 Compare June 1, 2026 08:10
Avoid eager default tool-card payload previews, repair empty modern projections for ready restored sessions, and reuse stable completed-turn projections to reduce historical-session render churn.
@limityan limityan force-pushed the yanzhn/fix-history-session-loading branch from 27996a6 to 0e66739 Compare June 1, 2026 08:13
@limityan limityan merged commit 2804443 into GCWing:main Jun 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant