Skip to content

fix(mcp): Pass working directory to spawned qsv processes#3386

Closed
Copilot wants to merge 1 commit intomasterfrom
copilot/sub-pr-3385
Closed

fix(mcp): Pass working directory to spawned qsv processes#3386
Copilot wants to merge 1 commit intomasterfrom
copilot/sub-pr-3385

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

The MCP server was spawning qsv processes without setting their working directory, causing them to run in the Node.js process's cwd instead of the configured working directory. This resulted in secondary output files (e.g., *.stats.bivariate.csv) being written to unexpected locations.

Changes:

  • SkillExecutor: Added workingDirectory property, passed as cwd to spawn(), with getter/setter and debug logging
  • QsvMcpServer: Initialize executor with config.workingDir, sync working directory when qsv_set_working_dir is called
  • executePipeline: Pass working directory from filesystem provider or config to executor to ensure pipeline steps run in correct directory
// Before: executor created without working directory
const executor = new SkillExecutor(config.qsvBinPath);

// After: executor uses configured working directory
const workingDir = filesystemProvider?.getWorkingDirectory() || config.workingDir;
const executor = new SkillExecutor(config.qsvBinPath, workingDir);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix working directory for spawned qsv processes fix(mcp): Pass working directory to spawned qsv processes Jan 25, 2026
Copilot AI requested a review from jqnatividad January 25, 2026 14:05
@jqnatividad jqnatividad marked this pull request as ready for review January 25, 2026 14:07
Base automatically changed from mcp-ensure-current-working-dir-set-to-mcp-working-dir to master January 25, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants