-
Notifications
You must be signed in to change notification settings - Fork 12
refactor: extract runners to dedicated package and remove agent functionality #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this 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 is a major architectural refactoring that extracts runner implementations to a dedicated package and removes agent functionality (now in the Don project).
Changes:
- Extracted all runner implementations (exec, sandbox-exec, firejail, docker) from
pkg/commandto newpkg/runnerpackage - Removed entire agent package and related code (agent functionality moved to Don project)
- Added shell completion command for better CLI usability
- Updated Go version and dependencies
- Comprehensive documentation updates reflecting the changes
Reviewed changes
Copilot reviewed 75 out of 76 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated Go version to 1.25.5 and removed agent dependencies (OpenAI SDK, cagent, etc.) |
| pkg/runner/*.go | New dedicated runner package with exec, sandbox-exec, firejail, and docker implementations |
| pkg/command/*.go | Updated imports to use new runner package |
| pkg/server/server.go | Removed agent-related methods (GetOpenAITools, ExecuteTool) |
| pkg/utils/home.go | Added MCPShellAgentConfigEnv constant |
| cmd/agent*.go | Deleted agent command and subcommands |
| cmd/completion.go | New shell completion command |
| tests/agent/*.sh | Removed agent test files |
| docs/*.md | Updated documentation to remove agent references and point to Don project |
| examples/README.md | Fixed typo ("paramters" → "parameters") |
| mcpshell.code-workspace | Added VS Code workspace with Don project reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Alvaro Saurin <saurin@adobe.com>
Runner options (Docker image, user, network settings, etc.) are now only taken from the server-side tool configuration. External callers (MCP clients, CLI users) cannot override these options to prevent privilege escalation attacks. This addresses the security concern raised in PR review where a malicious client could specify a different Docker image or user.
The agent functionality was removed, so this constant is no longer needed.
The function handles multiple config paths, so the plural form is more semantically correct.
Restore tests that were removed during the runner package extraction: - TestDocker_Run_Networking: tests network isolation - TestDocker_Run_PrepareCommand: tests prepare_command option - TestExec_Optimization_SingleExecutable: tests single executable optimization - Expanded TestNewDockerOptions assertions for all fields - Expanded TestSandboxExec_Run with template and env variable tests
085b2b6 to
e620370
Compare
Alpine Linux uses ash (via /bin/sh) and doesn't have bash installed. The Docker runner test was failing because it tried to execute 'bash -c' inside the Alpine container.
Environment variables with spaces in their values were causing the docker command to be parsed incorrectly. For example, 'TEST_MESSAGE=Hello from Docker' was being split, causing 'from' to be interpreted as the image name. Using %q format specifier ensures proper quoting.
The previous fix using Go's %q format didn't work correctly when the docker command was passed through sh -c, as the nested quoting caused issues. Added shellQuote() helper function that uses single quotes with proper escaping for shell-safe quoting of values containing spaces or special characters.
When environment variables with spaces (e.g., 'Hello from Docker container') were passed to the Docker runner, the script was generating unquoted export statements like: export TEST_MESSAGE=Hello from Docker container This caused the shell to only assign 'Hello' to TEST_MESSAGE. Now using shellQuote() to properly quote values: export TEST_MESSAGE='Hello from Docker container' Fixes CI failure in test_runner_docker.sh environment variable test.
…ne issues YAML literal blocks (|) include trailing newlines, causing commands like 'grep --version\n' to be passed to the shell. When quoted with %q, this becomes 'grep --version\n' which the shell interprets as '--versionn'. Now trimming whitespace from commands before embedding in the script.
Summary
Major refactoring that extracts the runner implementations into a dedicated \ package and removes the agent functionality (now available in the Don project).
Changes
Architecture
Agent Removal
New Features
Documentation
Maintenance
Testing