Skip to content

fix(mxc): preserve JSON arguments in PowerShell 5.1 (NVBug 6843165) - #3893

Merged
shailendra-nv merged 1 commit into
NVIDIA:windowsfrom
prekshivyas:fix/nvbug-6843165
Sep 29, 2026
Merged

shailendra-nv merged 1 commit into
NVIDIA:windowsfrom
prekshivyas:fix/nvbug-6843165

Conversation

@prekshivyas

Copy link
Copy Markdown
Contributor

Summary

Preserve --driver-config-json as one exact native argument when the shipped MXC runners execute under Windows PowerShell 5.1. PowerShell's call operator removed the embedded JSON quotes, so the gateway rejected the argument before sandbox creation.

Related Issue

  • NVBug 6843165
  • No public GitHub issue required: localized Windows PowerShell compatibility bug.

Before / after reproduction

Environment: Windows PowerShell 5.1.28000.30169.

The intended argument was:

{"mxc":{"cwd":"C:/Temp","command":["C:/Windows/System32/cmd.exe","/d","/c","exit 0"]}}

Before this change, native argument capture received:

{mxc:{cwd:C:/Temp,command:[C:/Windows/System32/cmd.exe,/d,/c,exit 0]}}

The local mock gateway then exited 1 with --driver-config-json must be valid JSON and key must be a string at line 1 column 2.

After this change, the identical JSON remains one byte-for-byte argument, including the space in exit 0. The same mock gateway path reaches sandbox phase Ready and launches the harmless command, exit 0.

Changes

  • Add CreateProcess-compatible native argument quoting to both affected PowerShell runners.
  • Invoke the CLI through ProcessStartInfo while preserving captured stdout, stderr, and exit status.
  • Keep OpenClaw output split by line so the existing diagnostic classifier remains unchanged.
  • Add a Windows regression test that extracts the production helpers from both shipped scripts and verifies quote and space preservation under PowerShell 5.1.

Testing

  • mise run pre-commit passes
    • Attempted on Windows ARM64; the aggregate task is blocked while Python 3.14 builds unchanged grpcio-tools 1.78 with incompatible MSVC language-standard flags.
  • Unit tests added/updated
    • powershell_native_arguments: 1 passed.
    • demo_examples: 5 passed.
    • openclaw_appcontainer_compat: 6 passed.
  • E2E tests added/updated (mock gateway create path)
  • Exact PowerShell 5.1 before/after reproduction completed.
  • Both scripts parse in Windows PowerShell 5.1.
  • cargo fmt --all -- --check
  • git diff --check

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

@shailendra-nv shailendra-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff at b6078cd. No blocking findings. Native ARM64 PowerShell 5.1 helper validation passed; Windows CI jobs were skipped. The standalone-test execution-policy dependency is a nonblocking portability suggestion.

@shailendra-nv
shailendra-nv merged commit 4cb6054 into NVIDIA:windows Sep 29, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants