Skip to content

refactor/session persistence architecture#8

Merged
chryzxc merged 3 commits into
mainfrom
refactor/session-persistence-architecture
Jul 12, 2026
Merged

refactor/session persistence architecture#8
chryzxc merged 3 commits into
mainfrom
refactor/session-persistence-architecture

Conversation

@chryzxc

@chryzxc chryzxc commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added clearer activity timelines, expandable search previews, queued-message indicators, and persistent detail modals.
    • Added cancelled status support for subagent activity, including updated icons and timeline presentation.
    • Added optional live-event diagnostics and performance visibility.
  • Bug Fixes

    • Improved streaming responsiveness, scrolling, event ordering, and duplicate handling.
    • Prevented late events from restarting stopped responses.
    • Improved session recovery by correctly cancelling interrupted subagent tasks.
    • Improved error reporting and transcript placement.
  • Style

    • Refined assistant response headers, activity cards, system messages, toasts, and plan comments.

@chryzxc chryzxc merged commit 9502c21 into main Jul 12, 2026
1 check failed
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 364a2fa1-3564-4d08-8f84-d771160fc259

📥 Commits

Reviewing files that changed from the base of the PR and between 58640c9 and 2e8848d.

📒 Files selected for processing (88)
  • package.json
  • src/extension.ts
  • src/providers/ChatViewProvider.ts
  • src/providers/chat/SessionHandler.ts
  • src/providers/chat/StreamEventHandler.ts
  • src/providers/chat/StructuredOutputProcessor.ts
  • src/providers/chat/SubagentPersistence.ts
  • src/providers/chat/index.ts
  • src/providers/chat/types.ts
  • src/services/MessageStreamService.ts
  • src/services/SessionService.ts
  • src/services/SubagentTracker.ts
  • src/services/subagents/SubagentProjectionRecovery.ts
  • src/shared/createPlainObjectSnapshot.ts
  • src/utils/InspectorNetworkCompatibility.ts
  • src/utils/Logger.ts
  • tests/integration/subagent-tracker.test.ts
  • tests/providers/chat-send-deduplication-regression.test.mjs
  • tests/providers/chat-send-pipeline.test.mjs
  • tests/providers/stream-event-orchestration.test.mjs
  • tests/regression/stop-button-interrupted-badge-regression.test.mjs
  • tests/regression/subagent-parent-response-raw-events.test.mjs
  • tests/regression/subagent-restart-cancellation.test.mjs
  • tests/regression/subagent-text-delta-progress-regression.test.mjs
  • tests/services/create-plain-object-snapshot.test.ts
  • tests/services/logger-sanitization.test.mjs
  • tests/services/message-stream-service.test.mjs
  • tests/services/session-crud.test.mjs
  • tests/services/structured-output-streaming.test.mjs
  • tests/unit/activity-timeline-collapse.test.mjs
  • tests/unit/inspector-network-compatibility.test.mjs
  • tests/webview/activity-timeline-finished-response-cancellation.test.mjs
  • tests/webview/activity-timeline-redundant-content-regression.test.mjs
  • tests/webview/assistant-header-thinking-variant.test.mjs
  • tests/webview/assistant-message-collapsed-logic.test.mjs
  • tests/webview/centralized-debug-panel-performance.test.mjs
  • tests/webview/centralized-render-source-of-truth-regression.test.mjs
  • tests/webview/centralized-session-error-ordering.test.ts
  • tests/webview/chat-history-performance-regression.test.mjs
  • tests/webview/chat-streaming-readability.test.mjs
  • tests/webview/live-stream-response-rendering.test.mjs
  • tests/webview/session-error-banner.test.mjs
  • tests/webview/session-status-rendering.test.mjs
  • tests/webview/stream-event-main-thread-performance.test.mjs
  • tests/webview/stream-performance-debug.test.mjs
  • tests/webview/subagent-initiator-transcript-filter.test.mjs
  • tests/webview/subagent-inline-card-block-deduplication.test.mjs
  • tests/webview/subagent-modal-layout.test.mjs
  • tests/webview/subagent-raw-hydration-priority.test.mjs
  • tests/webview/subagent-status-icon-regression.test.mjs
  • tests/webview/todowrite-pending-checklist-regression.test.mjs
  • webview/shared/src/chat/ChatShell.tsx
  • webview/shared/src/chat/MessageComponents.tsx
  • webview/shared/src/chat/PanelComponents.tsx
  • webview/shared/src/chat/StreamingComponents.tsx
  • webview/shared/src/chat/SubagentDetailModal.tsx
  • webview/shared/src/chat/ToastOverlay.tsx
  • webview/shared/src/chat/components/activity-steps/ActivityTimelineItem.tsx
  • webview/shared/src/chat/components/activity-steps/BackgroundOutputStep.tsx
  • webview/shared/src/chat/components/activity-steps/CallOmoAgentStep.tsx
  • webview/shared/src/chat/components/activity-steps/DiffPreviewStep.tsx
  • webview/shared/src/chat/components/activity-steps/SearchActivityPreview.tsx
  • webview/shared/src/chat/components/activity-steps/SubagentActivityStep.tsx
  • webview/shared/src/chat/index.css
  • webview/shared/src/chat/lib/assistantBlockPresentation.test.ts
  • webview/shared/src/chat/lib/assistantBlockPresentation.ts
  • webview/shared/src/chat/lib/backgroundTaskOwnership.ts
  • webview/shared/src/chat/lib/conversationProjection.ts
  • webview/shared/src/chat/lib/logger.ts
  • webview/shared/src/chat/lib/messageHandler.test.ts
  • webview/shared/src/chat/lib/messageHandler.ts
  • webview/shared/src/chat/lib/sessionProcessing.test.ts
  • webview/shared/src/chat/lib/sessionProcessing.ts
  • webview/shared/src/chat/lib/store.test.ts
  • webview/shared/src/chat/lib/store.ts
  • webview/shared/src/chat/lib/subagents/centralExtractor.ts
  • webview/shared/src/chat/lib/subagents/dataNormalizer.ts
  • webview/shared/src/chat/lib/subagents/eventNormalizer.ts
  • webview/shared/src/chat/lib/subagents/hydrationSource.ts
  • webview/shared/src/chat/lib/subagents/stateManager.ts
  • webview/shared/src/chat/lib/subagents/types.ts
  • webview/shared/src/chat/lib/subagents/uiFormatter.ts
  • webview/shared/src/chat/lib/transcriptMessageClassification.ts
  • webview/shared/src/chat/lib/types.ts
  • webview/shared/src/chat/lib/usePersistentModalOpen.ts
  • webview/shared/src/components/ui/StepIndicator.tsx
  • webview/shared/src/config.ts
  • webview/shared/src/plan/PlanShell.tsx

📝 Walkthrough

Walkthrough

This PR centralizes raw event and subagent persistence, improves stream batching and stop handling, adds restart cancellation recovery, refactors transcript and activity rendering, introduces snapshot sanitization and inspector compatibility, and expands regression coverage.

Changes

Centralized chat and subagent pipeline

Layer / File(s) Summary
Centralized persistence and recovery
src/services/*, src/services/subagents/*, webview/shared/src/chat/lib/subagents/*
Raw event tapes and scoped subagent projections use versioned centralized session data, serialized writes, bounded raw events, entity-store merging, and restart cancellation recovery.
Host stream delivery
src/providers/ChatViewProvider.ts, src/providers/chat/*
Streaming delivery is batched and capped, subagent events are persisted centrally, prompt dispatch consults SDK session status, history uses centralized projections, and stop requests finalize local state before aborting remotely.
Webview stream and state handling
webview/shared/src/chat/lib/store.ts, webview/shared/src/chat/lib/messageHandler.ts, webview/shared/src/chat/lib/sessionProcessing.ts
The webview adds centralized event batches, live debug mirrors, stopped-session fences, modular subagent hydration, delta-aware reasoning updates, queued-message computation, and unified live-event routing.
Transcript and response rendering
webview/shared/src/chat/ChatShell.tsx, webview/shared/src/chat/MessageComponents.tsx, webview/shared/src/chat/lib/*
Transcript ownership classification, visible-row ordering, assistant block presentation, streaming placeholders, cancellation propagation, queued messages, and activity collapse behavior are revised.
Activity and modal UI
webview/shared/src/chat/components/activity-steps/*, webview/shared/src/chat/SubagentDetailModal.tsx, webview/shared/src/chat/ToastOverlay.tsx
Shared activity components, raw tool timelines, persistent modal state, cancelled indicators, search previews, and in-flow live event banners are added or updated.
Snapshot and compatibility utilities
src/shared/createPlainObjectSnapshot.ts, src/services/MessageStreamService.ts, src/utils/Logger.ts, src/utils/InspectorNetworkCompatibility.ts
Runtime values are converted to bounded plain snapshots before persistence or logging, and an inspector network compatibility shim is installed before extension services initialize.
Supporting UI and validation changes
tests/*, webview/shared/src/config.ts, webview/shared/src/plan/PlanShell.tsx, package.json
Regression and unit tests cover stream ordering, cancellation, persistence, rendering, sanitization, and inspector behavior; centralized debug is disabled by default and plan comment controls are restyled.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • chryzxc/vscode-opencode#7: Touches the centralized chat transcript, session-error, and live toast/session-status routing paths.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/session-persistence-architecture

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

webview/shared/src/chat/index.css

Parsing error: Expression expected.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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