fix(dispatch): execute runcommands shell actions (VA-132) #131
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-132-runcommands-dispatch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes VA-132. The console "Run command" sends
action=runcommands(a shell command string), but the agent only handledexecutecommand(explicit program + args), soruncommandshit the unhandled-action path and never executed. Proven during VA-129 macOS validation: atouchvia Run command created no file, and the agent loggedunhandled JSON action action="runcommands".Change
runcommandsarm inroute_jsonthat runs the command via the platform shell through the existinghost::exec:/bin/sh -c <cmds>on Unix,cmd /Cor (fortype1)powershell -Commandon Windows. Fire-and-forget - no reply frame, matching the server's ack-routed contract; runs on a detached task so a long command can't stall the dispatch loop.run_shell_command) split from the fire-and-forget wrapper (spawn_runcommands) so it's deterministically unit-testable.runAsUser != 0is not yet supported and logs a warning (the console sends 0 = the agent's user).Why not
executecommandexecutecommand(program + args, output capture + reply) has no live client - MCP'sexeccallshost::execdirectly, and the console usesruncommands. The two are kept distinct; this adds the missingruncommandsconsumer rather than changing the client.Tests / verification
unixarm is shared by macOS):runcommands_shell_unix_wraps_in_sh_dash_c,runcommands_executes_shell_string(asserts a marker file is actually created),runcommands_action_is_fire_and_forget(no reply frame; missingcmdsignored).cargo clippy --all-targets -- --deny warningsandcargo fmt --checkclean.check-windows.Cross-platform: the dispatcher is platform-agnostic; the gap affected Linux/Windows too. Surfaced during VA-129.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QJiqE8CSatRaZysXtLHeVS