Skip to content

[BUG] ruby launch ignores launchConfig.cwd — debuggee runs in the proxy's working directory #320

Description

@debugmcpdev

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions