fix(runtime): classify expected and unexpected process exits#889
Closed
luoye520ww wants to merge 3 commits into
Closed
fix(runtime): classify expected and unexpected process exits#889luoye520ww wants to merge 3 commits into
luoye520ww wants to merge 3 commits into
Conversation
2ab95be to
d7e77f9
Compare
This was referenced Jul 13, 2026
Collaborator
Author
|
The remaining macOS packaged failure is isolated to the desktop smoke guest-target wait; the packaged resource smoke passed, and the same smoke focus change is green on #888. I reran the failed checks to distinguish runner flakiness from a deterministic regression. |
Collaborator
Author
|
Correction: GitHub does not allow me to rerun this workflow because the fork token lacks repository admin rights. The failure remains isolated to the macOS desktop guest-target wait; the packaged resource smoke passed, and the same smoke focus change is green on #888. |
Collaborator
Author
|
Superseded by consolidated runtime recovery PR #947, which passed Typecheck, Linux, macOS, and Windows packaged checks. Closing this duplicate to keep the review surface focused. |
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
The GUI could treat a delayed exit from an older Kun child as a crash of the current child. Expected settings, provider, health, update, and application shutdowns also lacked a stable reason, making recovery noisy and causing stale callbacks to race with a newly started runtime.
Root cause
Process lifecycle state was tracked by child presence and boolean intentional-stop flags. That could not distinguish generations or classify the reason that initiated a stop. The Linux packaged desktop smoke also dispatched a click while the Xvfb workbench was not necessarily foregrounded, so the extension guest was never created.
Scope
This PR adds generation-aware exit classification and fixes the packaged desktop smoke click race. It does not add Supervisor crash-loop policy; that remains a separate follow-up.
Changes
Part of #885.Behavior before
An old child exit could trigger recovery for the current child, and expected restarts were reported as unexpected exits. Linux desktop smoke could time out after a visually successful click with only the workbench target present.
Behavior after
Only the active, ready generation with no explicit stop reason can report an unexpected exit. Duplicate and stale callbacks are ignored. The desktop smoke brings the workbench to the foreground before dispatching the contribution click.
Typecheck
Passed locally.
Tests
node --test scripts/smoke-packaged-extension-desktop.test.cjs npm.cmd exec vitest run src/main/runtime/kun-process-controller.test.ts src/main/kun-runtime-supervisor.test.ts src/main/kun-process.test.ts npm.cmd run lint -- --quiet npm.cmd run buildResults: 16 desktop smoke tests passed; 3 Runtime test files / 63 tests passed; lint and build passed.
Actual validation
Review performed
Issue
Part of #885