mxc icon indicating copy to clipboard operation
mxc copied to clipboard

[WSLc] Set `operation` and `nativeCode` on container lifecycle errors from WSLc SDK calls

Open adpa-ms opened this issue 4 weeks ago • 1 comments

Description of the task

IsolationSession sets operation and nativeCode when a container lifecycle operation fails in a platform call; docs/development/architecture/container-lifecycle.md lists it as the only backend that does. The WSLc backend has the same detail: WslcError::Sdk { context, hr, sdk_msg } (src/mxc-sdk/src/backends/wslc/common/error.rs) holds a failing WSLc SDK call and its HRESULT. It reaches the caller only as text in message:

  1. WslcError::into_response renders it as text, including the HRESULT, in a ScriptResponse's error_message.
  2. The daemon's sr_err (src/mxc-sdk/src/bin/wslc_daemon/session_manager.rs) keeps only that text, using the failure phase to pick the error kind.
  3. DaemonResponse::Err (src/mxc-sdk/src/backends/wslc/common/daemon_protocol.rs) carries only kind and message.
  4. map_daemon_error (src/mxc-sdk/src/backends/wslc/common/state_aware.rs) builds the MxcError from kind and message alone.

Expected outcome: when a WSLc container lifecycle operation fails in a WSLc SDK call, the error's operation names the call and nativeCode holds its HRESULT.

Additional context

#1167, fixed by #1240, carried the failure's classification across the daemon protocol, but not the call or its status. Carrying them needs a PROTOCOL_VERSION change, which, as that constant's comment notes, strands whatever a running daemon holds.

adpa-ms avatar Nov 03 '26 02:11 adpa-ms

https://github.com/microsoft/mxc/pull/1671 https://github.com/microsoft/mxc/pull/1711

SohamDas2021 avatar Nov 18 '26 22:11 SohamDas2021