sync: auto-sync from GURU-5070 at 2026-07-01 15:49:56
Author: Mike Swanson Machine: GURU-5070 Timestamp: 2026-07-01 15:49:56
This commit is contained in:
@@ -159,6 +159,24 @@ Use `python` only when explicitly writing a Python script. Use `script` for save
|
||||
|
||||
**VALID `command_type` values ONLY: `shell`, `powershell`, `python`, `script`, `claude_task` (plus alias `cmd` → shell = cmd.exe).** The agent deserializes `command_type` into a Rust enum; an UNKNOWN value (e.g. a made-up type) fails the agent's whole-message JSON parse and the command is **silently dropped — no ack, no result, no error** — which is indistinguishable from a network black-hole and has caused a long mis-diagnosis. On Windows: `powershell` runs powershell.exe (UTF-8 output fixed in-agent); `shell` or `cmd` runs cmd.exe. If a dispatched command sits un-acked forever, FIRST suspect an invalid `command_type` before chasing the network. (Newer agents NAK an unparseable command so it fails fast with a clear stderr instead of black-holing.)
|
||||
|
||||
### Quote-safe dispatch for real scripts (PREFERRED for anything with quotes/UNC/$)
|
||||
|
||||
Any PowerShell payload containing embedded double-quotes, UNC `\\` paths, or `$`
|
||||
that must survive literally should NOT be inlined into the JSON dispatch — the
|
||||
RMM->cmd.exe layer strips/mangles them (see memory `feedback_windows_quote_stripping`).
|
||||
Write the script to a file (with the Write tool — bash heredocs collapse `\\`),
|
||||
then dispatch it byte-exact via `-EncodedCommand`:
|
||||
|
||||
```bash
|
||||
bash .claude/scripts/ps-encoded.sh rmm "$AGENT_ID" script.ps1 --timeout 120 [--user-session]
|
||||
# or print a paste-safe one-liner for ScreenConnect / plink:
|
||||
bash .claude/scripts/ps-encoded.sh encode script.ps1
|
||||
```
|
||||
|
||||
Size limit: the agent fails on ~7KB command bodies and encoding inflates ~2.67x,
|
||||
so keep scripts under ~2KB raw (the helper warns at 4KB encoded, refuses at 6KB).
|
||||
Inline dispatch below remains fine for simple quote-free commands.
|
||||
|
||||
### Basic dispatch
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user