Skip to content

[Repo Assist] Wire WorkingDirectory config field through to launched process#2181

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-working-directory-support-beffc6cabb401f37
Draft

[Repo Assist] Wire WorkingDirectory config field through to launched process#2181
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-working-directory-support-beffc6cabb401f37

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated pull request from Repo Assist.

Summary

ServerConfig.WorkingDirectory (working_directory in TOML/JSON config) was declared but never applied when launching stdio backend processes. The field was silently ignored at runtime.

Root Cause

mcp.NewConnection created an exec.Cmd but never set cmd.Dir, so the working directory config had no effect.

Changes

  • internal/mcp/connection.go: Added workingDir string parameter to NewConnection; sets cmd.Dir when non-empty
  • internal/launcher/launcher.go: Passes serverCfg.WorkingDirectory when calling mcp.NewConnection; logs the working directory at launch time
  • internal/launcher/getorlaunch_stdio_test.go: Added a test covering the WorkingDirectory config field path

Trade-offs

  • Single-call-site change; no API surface changes beyond the mcp.NewConnection signature (which is internal-only)
  • No behaviour change when working_directory is empty (the existing default)

Test Status

⚠️ Infrastructure limitation: The repository's go.mod requires Go 1.25.0, which is unavailable in this CI environment. Build and test execution could not be completed locally.

The changes are syntactically correct Go — adding a string parameter and conditionally setting cmd.Dir on exec.Cmd is standard library usage. The CI pipeline (which has the correct toolchain) should validate full correctness.

Fixes the silent no-op for working_directory in server config.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

The ServerConfig.WorkingDirectory field was declared but never applied
when launching stdio backend processes. This caused the configuration
option to be silently ignored at runtime.

Changes:
- Add workingDir parameter to mcp.NewConnection and set cmd.Dir when non-empty
- Pass serverCfg.WorkingDirectory from launcher.launchStdioConnection
- Log the working directory at launch time for observability
- Add test covering the WorkingDirectory config field path

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants