fix(desktop): harden Windows managed-agent lifecycle recovery - #4180
Draft
OpenSpek wants to merge 1 commit into
Draft
fix(desktop): harden Windows managed-agent lifecycle recovery#4180OpenSpek wants to merge 1 commit into
OpenSpek wants to merge 1 commit into
Conversation
Signed-off-by: Luke Westlake <35435298+LukeWestlake@users.noreply.github.com>
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.
Status
Draft / help wanted — not merge-ready.
This contribution hardens Windows managed-agent Stop, shutdown, restore, and crash-recovery behavior. It is intentionally being posted for upstream collaboration rather than held locally for another open-ended repair cycle.
A final independent review pass found two unresolved safety concerns, documented below. Passing tests do not overrule those counterexamples.
What this changes
(agent, relay/workspace)pair.Known review concerns
1. Shutdown diagnostics may broaden exact-pair uncertainty
shutdown.rscan append a shutdown diagnostic to canonical recovery detail throughruntime_types.rs. A later reconciliation may treat the same exact key/PID with changed detail as conflicting evidence, escalate it into agent-wide quarantine, and block a clean sibling pair.Help requested: separate ordinary diagnostic history from canonical recovery identity/provenance, or otherwise ensure diagnostic enrichment cannot manufacture conflicting ownership evidence.
2. Some Stop/shutdown paths may retire Child/Job authority before the primary record commits
The shared synchronization path preserves the finalized runtime token through primary-record persistence, but explicit Stop, pair-runtime Stop, and shutdown paths still appear able to clear/retire finalized Child/Job authority before the caller's managed-agent record save succeeds.
Help requested: decide where the durable commit barrier belongs in the Stop API so a failed primary-record save retains equivalent retry authority and cannot publish a terminal state prematurely.
Validation
Exact current-main port commit:
0262a73ac2f419aa8cdf04a6a284594437ca888bWindows MSVC (
rustc 1.95.0):cargo check --workspace --all-targets --all-features: passedcargo fmt --check: passedgit diff --check: passedLinux-target validation was not run because this test host has only the Windows MSVC standard library installed.
Coordination check
I searched open and recent Buzz PRs before publication. The closest items were:
No existing PR appeared to implement or clearly supersede this exact Windows recovery-authority work.
Review request
Windows, Rust lifecycle, and persistence reviewers: please help resolve or challenge the two commit-barrier/reconciliation concerns above. Architectural guidance or focused follow-up commits are welcome. This draft should remain non-merge-ready until those concerns are resolved or maintainers explicitly determine that the current behavior is acceptable.