fix(runtime): consolidate runtime recovery safeguards#947
Closed
luoye520ww wants to merge 8 commits into
Closed
Conversation
This was referenced Jul 14, 2026
Collaborator
|
感谢针对白屏/运行时恢复的投入。关闭当前聚合 PR 的原因是主体能力已在当前 当前 PR 因此与核心、UI 和 smoke 路径大面积重叠并冲突,不应再整体合入。 仍有价值的差异请基于最新 |
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
Runtime failures were handled by several independent PRs: expected exit classification, crash-loop policy, reconnect UI, renderer recovery, and the error boundary. In isolation they could race each other, lose a composer draft during a health transition, or leave packaged smoke tests clicking an inactive control.
Root cause
Runtime generations and stop reasons were not carried consistently from the process controller to the supervisor. Renderer recovery and reconnect state had separate lifecycle assumptions, while the packaged smoke helper treated a wrapper element click as proof that the extension guest was attached.
Scope
This PR consolidates the runtime recovery chain and the packaged-smoke reliability fix. It keeps the crash-loop breaker as a pure policy module; it does not add a second runtime, safe mode, or unrelated provider/storage features.
Changes
Safety
Typecheck
Both passed.
Tests
npm.cmd exec vitest run src/main/runtime/crash-loop-breaker.test.ts src/main/kun-runtime-supervisor.test.ts src/main/runtime/kun-process-controller.test.ts src/main/renderer-process-recovery.test.ts src/renderer/src/components/AppErrorBoundary.test.ts src/renderer/src/components/RuntimeStatusBanner.test.ts src/renderer/src/components/workbench/useWorkbenchComposerSubmitController.test.ts src/renderer/src/lib/runtime-banner-visibility.test.ts src/renderer/src/store/chat-store-thread-actions.test.ts scripts/smoke-packaged-extension-desktop.test.cjs npm.cmd run lint npm.cmd run build git diff --check upstream/develop...HEADResults: 9 test files, 76/76 tests passed; lint, build, and diff check passed.
Actual validation
Review performed
PR size
Non-goals
Supersedes
Part of #885; this PR does not auto-close the umbrella issue.