Skip to content

Add working directory logging and Docker workdir for agentic-workflows MCP server#14053

Merged
pelikhan merged 5 commits intomainfrom
copilot/log-cwd-and-set-docker-dir
Feb 6, 2026
Merged

Add working directory logging and Docker workdir for agentic-workflows MCP server#14053
pelikhan merged 5 commits intomainfrom
copilot/log-cwd-and-set-docker-dir

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

The agentic-workflows MCP server needed context logging and proper working directory setup for path resolution within containers.

Changes

  • MCP server startup: Log current working directory before gh CLI version check for debugging
  • Container configuration: Set Docker working directory to ${{ github.workspace }} via -w flag in MCP server args
    • Ensures .github/workflows resolves to workspace/.github/workflows instead of container root
    • Applies to both JSON (Copilot/Claude/Custom) and TOML (Codex) formats

Example

The compiled agentic-workflows MCP configuration now includes:

"agentic_workflows": {
  "type": "stdio",
  "container": "alpine:latest",
  "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw", ...],
  "args": ["-w", "${{ github.workspace }}"],  # <- Added
  "env": { ... }
}

Test updates

Removed obsolete GH_TOKEN expectations from tests (only GITHUB_TOKEN required per ExecGH helper convention).

Original prompt

The mcp-server command should log the current working directory before checking the gh version.

Also make sure the docker container working directory is the workspace directory. The ".github/workflows" folder should resolve to the workspace/.GitHub/workflows folder in the repo


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


Changeset

  • Type: patch
  • Description: Log the working directory in the launcher and ensure Docker runs from the expected folder so filesystem paths stay consistent.

Generated by Changeset Generator

Copilot AI and others added 3 commits February 6, 2026 05:52
…P server

- Log current working directory before checking gh version in mcp-server command
- Add Docker working directory (-w flag) to agentic-workflows MCP server
- Set working directory to ${{ github.workspace }} to ensure .github/workflows resolves correctly

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove GH_TOKEN expectations (only GITHUB_TOKEN is needed now)
- Add args field expectations for working directory
- Update JSON and TOML format tests

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All changes implemented and tests passing:
- MCP server logs current working directory before gh version check
- Docker working directory set to workspace for agentic-workflows container
- All unit tests updated and passing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan added the smoke label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Changeset Generator completed successfully!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

Copilot AI changed the title [WIP] Log current working directory in mcp-server command Add working directory logging and Docker workdir for agentic-workflows MCP server Feb 6, 2026
Copilot AI requested a review from pelikhan February 6, 2026 06:05
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.50.1
curl 8.5.0
gh 2.86.0
node 20.20.0
python3 3.12.3
go 1.24.12
java ⚠️ present but execution issue
dotnet ⚠️ present but execution issue

Result: 10/12 tools fully available ✅, 2 tools present with execution issues ⚠️

Notes:

  • Java and .NET binaries are present in the container (/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7/x64/bin/java, /usr/share/dotnet/dotnet) but encounter execution errors when invoked
  • All other development tools are working correctly
  • Core tools (git, gh, node, python3, go) are all operational

AI generated by Agent Container Smoke Test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Smoke Test Results - Run §21740597360

PRs Reviewed:

✅ GitHub MCP | ✅ Safe Inputs GH CLI | ✅ Serena MCP | ✅ Playwright | ✅ File Writing | ✅ Bash Tool | ✅ Discussion Interaction | ✅ Build gh-aw | ✅ Workflow Dispatch

Status: PASS ✅

cc: @pelikhan @Copilot

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Smoke Test Results ✅

Status: PASS

Test Result
GitHub MCP
Safe Inputs GH CLI
Serena MCP
Make Build
Playwright
Tavily
File Writing
Bash
Discussion
Agentic Workflows MCP

Run: §21740597347

AI generated by Smoke Claude

@pelikhan pelikhan marked this pull request as ready for review February 6, 2026 06:13
Copilot AI review requested due to automatic review settings February 6, 2026 06:13
@pelikhan pelikhan merged commit 7775c70 into main Feb 6, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/log-cwd-and-set-docker-dir branch February 6, 2026 06:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds working directory logging and proper Docker working directory configuration for the agentic-workflows MCP server to ensure consistent path resolution within containers.

Changes:

  • Added current working directory logging to MCP server startup (before gh CLI version check)
  • Set Docker container working directory to ${{ github.workspace }} via -w flag for both JSON and TOML MCP configurations
  • Removed obsolete GH_TOKEN from MCP environment variables (only GITHUB_TOKEN is needed, as ExecGH helper auto-sets GH_TOKEN from GITHUB_TOKEN)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/cli/mcp_server.go Added working directory logging with error handling before gh CLI version check
pkg/workflow/mcp_config_builtin.go Added Docker -w args and removed GH_TOKEN from env vars for both JSON and TOML formats
pkg/workflow/mcp_renderer_test.go Updated tests to remove GH_TOKEN expectations and verify working directory args
pkg/workflow/mcp_config_refactor_test.go Updated tests to expect only GITHUB_TOKEN and verify working directory args
pkg/workflow/mcp_config_compilation_test.go Updated compilation test to verify working directory args in generated lock files
pkg/workflow/importable_tools_test.go Updated importable tools test to verify working directory args
.github/workflows/*.lock.yml (27 files) Regenerated lock files with new args field and without GH_TOKEN
docs/src/content/docs/reference/frontmatter-full.md Enhanced plugins field documentation (unrelated to main PR purpose)
.changeset/patch-log-cwd-set-docker-dir.md Added changeset for patch version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1098 to +1121
# Plugin configuration for installing plugins before workflow execution. Supports
# both array format (list of repos) and object format (repos + custom token).
# (optional)
# This field supports multiple formats (oneOf):

# Option 1: List of plugin repository slugs to install. Each plugin is installed
# using the engine's plugin installation command with default token resolution.
plugins: []
# Array of Plugin repository slug in the format 'org/repo' (e.g.,
# Array items: Plugin repository slug in the format 'org/repo' (e.g.,
# 'github/example-plugin')

# Option 2: Plugin configuration with custom GitHub token. The custom token
# overrides the default token resolution chain.
plugins:
# List of plugin repository slugs to install
repos: []
# Array of Plugin repository slug in the format 'org/repo' (e.g.,
# 'github/example-plugin')

# Custom GitHub token expression to use for plugin installation. Overrides the
# default cascading token resolution (GH_AW_PLUGINS_TOKEN -> GH_AW_GITHUB_TOKEN ->
# GITHUB_TOKEN).
# (optional)
github-token: "${{ secrets.GITHUB_TOKEN }}"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These documentation changes for the plugins field appear unrelated to the PR's stated purpose of adding working directory logging and Docker workdir configuration. The PR description doesn't mention any plugins documentation updates. While the changes themselves look correct (documenting the dual format for plugins configuration), they should either be mentioned in the PR description or moved to a separate PR for better change tracking and review.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants