ReviewOS

craft-native/craft

shell.spawn silently discards its args array

#69
Closed chris opened this 10 days ago ·
10 days ago

The JS facade sends an args array: craft-bridge.js:545-548 posts {id, command, cwd, args} for spawn. But SpawnParams in bridge_shell.zig:266 declares only id/command/cwd — with ignore_unknown_fields, args is parsed and dropped. So craft.shell.spawn('git', ['status']) runs git with no arguments and no error.

Two clean fixes, pick one:

  • Add args: ?[]const []const u8 to SpawnParams and append them to the argv, or
  • If spawn is meant to take a full command string (it currently goes through sh -c), drop args from the JS signature and the .d.ts so the API stops advertising a parameter it ignores.

The first matches what the JS types promise. Flagged during a bridge-surface audit.

🤖 Generated with Claude Code

Sign in to comment on this issue.