Skip to content

fix(runtime): recover missing replies after SSE disconnect#657

Merged
XingYu-Zhong merged 1 commit into
developfrom
codex/fix-issue-653-missing-reply
Jun 30, 2026
Merged

fix(runtime): recover missing replies after SSE disconnect#657
XingYu-Zhong merged 1 commit into
developfrom
codex/fix-issue-653-missing-reply

Conversation

@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

Summary

  • Treat local SSE terminated stream reads as transient disconnects so the main process reconnects from the last delivered sequence instead of ending the stream.
  • Reconcile completed turns from persisted Kun thread detail when the renderer receives completion without any visible assistant text.
  • Add regression coverage for terminated SSE reconnects and completion-time assistant reply recovery.

Changes

  • Broadened runtime SSE transient error classification to cover abrupt local stream termination/socket errors.
  • Added a guarded completion reconciliation path in the chat event sink that only fetches thread detail when the completed turn has no local assistant text, and skips state replacement if the user switched threads or started another turn.
  • Hardened turn completion notification against non-browser test environments.

Tests

  • npm test -- src/main/runtime-sse-ipc.test.ts src/renderer/src/store/chat-store-runtime.test.ts
  • npm run typecheck
  • npm run build
  • npx eslint src/main/runtime-sse-ipc.ts src/main/runtime-sse-ipc.test.ts src/renderer/src/store/chat-store-runtime.ts src/renderer/src/store/chat-store-runtime.test.ts
  • npm run lint currently fails on existing baseline react-hooks/rules-of-hooks in src/renderer/src/components/chat/message-timeline-process.tsx:248 plus existing hook dependency warnings.

Fixes #653

@XingYu-Zhong XingYu-Zhong marked this pull request as ready for review June 30, 2026 12:44
@XingYu-Zhong XingYu-Zhong merged commit fa80e2a into develop Jun 30, 2026
3 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