feat(events): consolidate IPC and SSE reliability#945
Closed
luoye520ww wants to merge 1 commit into
Closed
Conversation
This was referenced Jul 14, 2026
Collaborator
|
感谢 IPC/SSE 可靠性方向的投入。关闭当前聚合 PR 的原因是:当前 在未接线前一次性固化约 900 行新 API,会增加维护面且与现有实现分叉。 如仍有明确缺口,请基于最新 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
IPC and SSE reliability work had been split across several small PRs, making the contracts difficult to review and leaving cursor persistence, gap recovery, cancellation, and projection replay validation disconnected.
Root cause
The renderer and main process had no single bounded contract for IPC errors/cancellation or sequenced runtime events. Resume cursors were not represented as a durable, validated, single-writer state, and event projection lacked deterministic replay/fuzz coverage.
Scope
This PR consolidates the IPC/SSE reliability contracts into one independently testable change. It supersedes the overlapping implementation PRs listed below; it does not wire cancellation into every long-running operation or replace the existing runtime transport.
Changes
AppIpcErrorand long-operation cancellation envelopes that exclude raw stacks and arbitrary objects.Safety
Typecheck
Both passed.
Tests
npm.cmd exec vitest run src/shared/ipc-cancellation.test.ts src/shared/ipc-error.test.ts src/shared/sse-sequence.test.ts src/shared/sse-gap.test.ts src/shared/sse-recovery.test.ts src/main/services/sse-resume-cursor-store.test.ts src/renderer/src/store/chat-projection-reducer.fuzz.test.ts npm.cmd run lint npm.cmd run build git diff --check upstream/develop...HEADResults: 7 test files, 32/32 tests passed; lint, build, and diff check passed.
Review performed
PR size
Non-goals
Supersedes
Part of the broader reliability work; no issue is auto-closed by this PR.