[WSLC] Preserve backend failure classification across the state-aware daemon protocol - #1240
Merged
Soham Das (SohamDas2021) merged 1 commit intoSep 22, 2026
Conversation
…aemon protocol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dce3a7ac-f357-4bee-a2bc-38b1d1d873bd
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Soham Das (SohamDas2021)
September 22, 2026 23:08
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation preserves compatibility and includes appropriate seam-level coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves WSLc failure classifications across the state-aware daemon boundary.
Changes:
- Adds typed unavailable/rejected daemon errors.
- Maps them to existing SDK error codes.
- Provides forward-compatible unknown-kind handling and tests.
| File | Description |
|---|---|
session_manager.rs |
Preserves step failure phases. |
state_aware.rs |
Maps daemon kinds to SDK errors. |
daemon_protocol.rs |
Extends error kinds compatibly. |
wslc-state-aware.md |
Documents error mapping and compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Branden Bonaby (bbonaby)
approved these changes
Sep 22, 2026
Collaborator
There was a problem hiding this comment.
I'm wondering if we'll one day be able to move this daemon to be the mxc-daemon rather than wslc specific. I guess that only really makes sense if we have more than one using it.
I say this assuming there is no way to make wslc state aware completely in proc right?
Soham Das (SohamDas2021)
deleted the
sohamdas2021-wslc-state-aware-error-classification
branch
September 22, 2026 23:43
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.
📖 Description
A host that cannot run WSLc now returns
backend_unavailableto state-aware callers, and a policy the backend refuses returnspolicy_validation. Both previously arrived asbackend_error, so the state-aware and one-shot surfaces disagreed about the same host condition and a caller had to string-match the message to tell an unusable host from a rejected policy.The daemon's step helpers already attributed each failure to a phase, but the daemon threw that away when it reduced the step result to a bare message before replying over its named pipe. Every failure — unusable host, rejected policy, busy container — arrived flattened. The classification now survives the pipe, so all four non-exec phases (provision / start / stop / deprovision) report the same code the one-shot surface reports.
🔗 References
Resolves #1167. Split out of #843 (defect 4); originally raised in review on #1045. Typed backend errors came from #794.
🔍 Validation
cargo fmt --all -- --checkandcargo clippy --all-targets -- -D warnings, clean — including the feature-gated consumers (wxc,mxc_engine,mxc_ffiwith--features wslc).cargo test --workspace, plus new unit tests covering the classification at each seam: phase → error kind in the daemon, kind → wire code on the client, and an unrecognized kind decoding to the catch-all.#[ignore]dfull_lifecycle_over_pipetest, which drives provision → start → exec → stop → deprovision through the daemon over a live named pipe. This is the regression check that unit tests cannot reach.run_wslc_state_aware_tests.ps1: 76/77.✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see docs/pull-requests.md)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow