Sibling of #318 (env), found while fixing it.
What happens: cwd passed via dapLaunchArgs is silently dropped on the ruby launch path. It survives transformLaunchConfig into the DAP launch request, but with rdbg --open -c -- ruby <script> the debuggee is already running when that request arrives, so it's never applied. The debuggee inherits the proxy worker's working directory instead.
Code trace (why it's structural):
AdapterCommand is { command, args, env } — no cwd field (packages/shared/src/interfaces/debug-adapter.ts), so buildAdapterCommand has no channel for it.
- The ruby policy's spawn config passes
env but not cwd (packages/shared/src/interfaces/adapter-policy-ruby.ts:205-212).
- The spawn layer itself already supports it:
dap-proxy-adapter-manager.ts:86-88 sets spawnOptions.cwd when provided — the value just never arrives.
Expected: launchConfig.cwd applied to the rdbg child's spawn options (same shape as the #318 env fix: route it through AdapterCommand/spawn config at spawn time, since the DAP launch request is an ack for rdbg -c).
Contrast: other adapters honor cwd via the DAP launch request because their debuggee starts at DAP-launch time (e.g. debugpy applies it); ruby is the only adapter whose debuggee starts at adapter-spawn time.
Environment: main, all platforms (structural).
Sibling of #318 (env), found while fixing it.
What happens:
cwdpassed viadapLaunchArgsis silently dropped on the ruby launch path. It survivestransformLaunchConfiginto the DAPlaunchrequest, but withrdbg --open -c -- ruby <script>the debuggee is already running when that request arrives, so it's never applied. The debuggee inherits the proxy worker's working directory instead.Code trace (why it's structural):
AdapterCommandis{ command, args, env }— nocwdfield (packages/shared/src/interfaces/debug-adapter.ts), sobuildAdapterCommandhas no channel for it.envbut notcwd(packages/shared/src/interfaces/adapter-policy-ruby.ts:205-212).dap-proxy-adapter-manager.ts:86-88setsspawnOptions.cwdwhen provided — the value just never arrives.Expected:
launchConfig.cwdapplied to the rdbg child's spawn options (same shape as the #318 env fix: route it throughAdapterCommand/spawn config at spawn time, since the DAP launch request is an ack for rdbg -c).Contrast: other adapters honor
cwdvia the DAP launch request because their debuggee starts at DAP-launch time (e.g. debugpy applies it); ruby is the only adapter whose debuggee starts at adapter-spawn time.Environment: main, all platforms (structural).