Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes dry-run MCP argument validation by allowing commands to validate the actual MCP tool arguments (including required-but-not-displayed fields), while keeping dry-run output limited to safe display metadata. It also introduces a shared execution layer to reduce drift between dry-run and real execution paths.
Changes:
- Update many command handlers to build a single
argsmap and pass it both toValidateDryRun(..., display, args)andCallTool(..., args). - Add
internal/commands/execto centralize MCP query/mutation execution + output rendering (used by several commands like mail/calendar/sharepoint). - Add MCP test recorder utilities and expand tests to cover explicit dry-run validation and executor behavior.
Show a summary per file
| File | Description |
|---|---|
| internal/testutil/testutil.go | Adds MCP call recorder + refactors test server setup to support recording and schemas. |
| internal/commands/word/word.go | Reuses a single MCP args map for dry-run validation and execution. |
| internal/commands/triggers/triggers.go | Aligns dry-run validation args with execution args for trigger mutations. |
| internal/commands/teams/chats.go | Aligns dry-run validation args with execution args for chat mutations. |
| internal/commands/teams/channels.go | Aligns dry-run validation args with execution args for channel mutations. |
| internal/commands/splists/splists.go | Aligns args; routes one mutation through the new shared executor. |
| internal/commands/splists/splists_test.go | Adds test ensuring dry-run validates actual MCP args for list-item update. |
| internal/commands/sharepoint/sharepoint.go | Aligns args; routes some mutations through the new shared executor. |
| internal/commands/sharepoint/sharepoint_test.go | Adds test ensuring dry-run validates selected tool + actual args for binary writes. |
| internal/commands/root_test.go | Adds test proving ValidateDryRun uses explicit MCP args while preserving display-only output. |
| internal/commands/planner/planner.go | Aligns dry-run validation args with execution args across planner commands. |
| internal/commands/onedriveremote/onedriveremote.go | Aligns dry-run validation args with execution args across OneDrive Remote commands. |
| internal/commands/mail/mail.go | Moves selected commands to shared executor; aligns dry-run validation args for several mutations. |
| internal/commands/mail/mail_test.go | Adds test ensuring dry-run validates actual args for message update. |
| internal/commands/knowledge/knowledge.go | Aligns dry-run validation args with execution args for knowledge mutations. |
| internal/commands/exec/exec.go | New shared MCP executor for queries/mutations (dry-run validation, confirmation, rendering). |
| internal/commands/exec/exec_test.go | Tests executor query rendering, dry-run mutation behavior, and destructive confirmation behavior. |
| internal/commands/excel/excel.go | Reuses a single MCP args map for dry-run validation and execution. |
| internal/commands/calendar/calendar.go | Moves update mutation to executor; aligns dry-run validation args with execution args elsewhere. |
| internal/commands/calendar/calendar_test.go | Adds test ensuring dry-run validates actual args for calendar update. |
| internal/commands/admin365/admin365.go | Aligns dry-run validation args with execution args for several admin365 mutations. |
| internal/commands/admin/admin.go | Aligns dry-run validation args with execution args for license updates. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 22/22 changed files
- Comments generated: 2
Comment on lines
48
to
49
| "action": "admin365.bulk-add", | ||
| "fileContent": c.FileContent, |
| @@ -222,6 +228,7 @@ func (c *ODRWriteCmd) Run(ctx *commands.Context) error { | |||
| "filename": c.Filename, | |||
| "contentText": c.ContentText, | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation