Skip to content

fix(mcp): transform raw schema validation errors into helpful "Did you mean?" messages#29406

Merged
pelikhan merged 6 commits intomainfrom
copilot/fix-workflow-name-error
May 1, 2026
Merged

fix(mcp): transform raw schema validation errors into helpful "Did you mean?" messages#29406
pelikhan merged 6 commits intomainfrom
copilot/fix-workflow-name-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

When an MCP tool call includes an unknown parameter, the SDK's JSON schema validator (additionalProperties: false) surfaces a raw internal error directly to the caller instead of a useful message.

Before:

validating "arguments": validating root: unexpected additional properties ["workflow-name"]

After:

Unknown parameter 'workflow-name'. Did you mean 'workflows'?
Run 'agenticworkflows compile --help' for usage.

Changes

  • pkg/cli/mcp_argument_validation.go (new) — MCP receiving middleware that intercepts CallToolResult errors containing unexpected additional properties, extracts the unknown parameter names, finds the closest valid parameter via longest-common-prefix fuzzy matching (≥70% normalized similarity), and returns a human-readable replacement message. Also contains mcpToolParams(), the per-tool parameter registry used for suggestions.

  • pkg/cli/mcp_server.go — Registers argumentValidationMiddleware on the server after all tools are registered.

  • pkg/cli/mcp_argument_validation_test.go (new) — Unit tests for error parsing, fuzzy matching, message construction, and middleware pass-through behavior.

Notes

The parameter registry in mcpToolParams() is a hardcoded map; each entry links via comment to its source-of-truth *Args struct in the corresponding register*Tool function. The middleware applies to all 10 registered tools generically.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm rtcf�� -json om/goccy/go-yaml@v1.19.2/scanner/context.go x_amd64/link GOINSECURE 730255/b047/ GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE qyt2rkmdiK-YsnbcBW/Vpa8Q5oQtl-xB-importcfg rtcf�� 6356/001/stability-test.md om/goccy/go-yaml@v1.19.2/context-w g_.a GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x^remote\..*\.gh-resolved$ (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE x_amd64/compile env t2915964599/.github/workflows GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE 730255/b011/ GOMODCACHE ache/go/1.25.8/x^remote\..*\.gh-resolved$ (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name */*.ts' '**/*.js-p GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go /pre�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv xterm-color x_amd64/vet /usr/bin/git rtcfg pKmvAbdZx k git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git rtcfg GO111MODULE ache/go/1.25.8/xinstall git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git y_only_defaults_git GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE tartedAt,updatedinstall git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv GOMODCACHE x_amd64/compile /usr/bin/git -json arm.go x_amd64/compile git init�� GOMODCACHE x_amd64/compile /usr/bin/git -json .go x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/architecture-guardian.md go /usr/bin/git -json GO111MODULE 64/bin/go git conf�� user.name Test User /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv 730255/b230/_pkg_.a g-gh/tcTLxKIFRze8kq6Gg-gh ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE contextprotocol/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -c 0851-47322/test-2206985922/custom/workflows GOPROXY e/git-receive-pack GOSUMDB GOWORK 64/bin/go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x1 /usr/bin/git Onlymin-integritgit i2Jk/kxQktkbJrdZrev-parse 730255/b219=> git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git 730255/b051/impogit YknE/_O2drKQQrICrev-parse /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv tags/v4 git sv /tmp/TestGuardPogit config /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git )$/\1/p go /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/go-build163730255/b166/_pkg_.a -trimpath 1/x64/bin/node -p crypto/internal/rev-parse -lang=go1.25 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote2 hash�� ithub/workflows/agent-persona-explorer.md -importcfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -buildmode=exe -buildid=1WVZHP2rev-parse -w ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 -buildtags t -errorsas -ifaceassert -nilfunc /usr/lib/git-core/git --gi�� for-each-ref --format=%(objectname) ache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv HIFr/iLX4908EimRzvG1AHIFr go /usr/bin/git .js' --ignore-pagit cpgodebug/mcpgodrev-parse 64/bin/go git 7112�� --show-toplevel l /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet 1 GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuTest User /usr/bin/git 730255/b103/impogit -trimpath es.test git rev-�� --show-toplevel es.test /usr/bin/git runs/20260501-00git -trimpath /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git st-4178340950/.ggit GO111MODULE /opt/hostedtoolcache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel l /usr/bin/git /v2.0.0 GO111MODULE sv git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -goversion go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build163730255/b206/importcfg -pack 1/x6�� -json GO111MODULE ache/go/1.25.8/x-lang=go1.25 GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -goversion go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build163730255/b169/importcfg -pack env */*.ts' '**/*.js-p GO111MODULE 64/bin/go GOINSECURE GOMOD (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE ode GOINSECURE GOMOD GOMODCACHE go tion�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --git-dir NKQxPfr/feDwSjXSInitial commit /usr/bin/sed _.a go 64/bin/go sed -ne s/^session\.gc_maxlifetime=\(.*\)$/\1/p go /usr/bin/git ithub/workflows Kt0zQSK0W ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --git-dir go /usr/bin/git add-source-path-git GO111MODULE de_modules/.bin/--show-toplevel git rev-�� --show-toplevel go /usr/bin/git */*.ts' '**/*.jsgit GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel l /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go node /tmp�� /tmp/TestHashStability_SameInputSameOutput2959876356/001/stability-test.md go /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel 64/pkg/tool/linu/tmp/go-build4257112637/b113/vet.cfg /usr/bin/sed _.a log ache/go/1.25.8/x--show-toplevel sed -ne s/^session\.save_handler=\(.*\)$/\1/p go /usr/bin/git -json nXnE_1jro ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /tmp/TestHashConsistency_InlinedImports2953231930/001/noflag-a.md go /usr/bin/infocmp -json GO111MODULE 64/bin/go infocmp -1 xterm-color l /usr/bin/gh -json GO111MODULE 64/bin/go gh (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ry=1 resolved$ 7112637/b435/_pkg_.a -p crypto/sha3 -lang=go1.25 /bin/sh -c echo "��� Built gh-aw.wasm ($(du -h gh-aw.wasm | cut -f1))" l 1/x64/bin/node -goversion go1.25.8 -c=4 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --show-toplevel SSt3JQqVRjkcjNZiRS1g/SSt3JQqVRjkcjNZiRS1g 1/x64/bin/node -goversion "$k=".$v["localrev-parse -c=4 1/x64/bin/node e=/t�� t0 origin (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ons-test1977884993 config 7112637/b452/_pkg_.a remote.origin.urgit context/xcontextrev-parse 64/bin/go git remo�� GOMODCACHE go om/owner/repo.git 1 GO111MODULE 64/bin/go gh (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /tmp/TestGuardPolicyTrustedUsersRequiresMinIntegv1.0.0 rev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --bare --initial-branch=master /usr/bin/git .github/workflowgit GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/gh ath ../../../.prgit GO111MODULE 64/bin/go gh (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv . st/dist/workers/forks.js odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/git -b full-mode-branchconfig git git init�� -q (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv -q -m rgo/bin/git -b bb2d6bcf k/gh-aw/gh-aw/nogit commit -m 'Initial commit' git init�� -q (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch .go git 1/x64/bin/node --count 5598f1d6c2aaf63e-1 run-script/lib/nxterm-color 1/x64/bin/node ve -q tions/setup/js/node_modules/viteowner=github docker-compose -exist 4e112f2a2158a6e7-C e_modules/.bin/g/home/REDACTED/work/gh-aw/gh-aw/.github/workflows docker-compose (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch k/gh-aw/gh-aw/.gremote.origin.url /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/viteowner=github /tmp/go-build681567225/b001/exe/text-output l --conditions development /tmp/go-build681rev-parse ings�� ithub/workflows git /opt/hostedtoolcache/node/24.14.-f l ings.cjs k/_temp/uv-pytho/home/REDACTED/work/gh-aw/gh-aw /opt/hostedtoolcshow (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel 64/pkg/tool/linuTest User /usr/bin/php8.3 LsRemoteWithRealgit LsRemoteWithRealrev-parse 64/pkg/tool/linu--show-toplevel /usr/bin/php8.3 -c /etc/php/8.3/cgi/php.ini -d /usr/bin/git -r foreach(ini_get_rev-parse ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv graphql -f (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/agent-persona-explorer.md Test User /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -o /tmp/go-build4257112637/b450/_pkg_.a -trimpath /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -p main -lang=go1.25 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv GOMODCACHE (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv GOMODCACHE go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel s /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv . go /usr/bin/git led-with-body-cogit GO111MODULE 64/bin/go git -C /tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_with_repos_array_c3241292184/001 rev-parse /usr/bin/git h ../../../.pretgit GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-24 GOMOD GOMODCACHE x_amd64/compile -c ty-test.md ibility.go 64/pkg/tool/linux_amd64/compile GOSUMDB id 64/bin/go 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-01 GOMOD GOMODCACHE 64/pkg/tool/linu-buildtags -c _.a oding@v0.5.4/jso-ifaceassert 64/pkg/tool/linu-nilfunc GOSUMDB nal/alias 64/bin/go 64/pkg/tool/linu-tests (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-01-31 GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/asm -c "prettier" --check '**/*.cjs' '*--detach GOPROXY 64/pkg/tool/linux_amd64/compile GOSUMDB GOWORK 64/bin/go 64/pkg/tool/linutest@example.com (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile rtcf�� stants.test qbNVEaFt_ ortcfg.link GOINSECURE GOMOD GOMODCACHE nt9zLENvjKcOLdParemote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 m0O72i2Jk ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE /norm GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile env rtcfg aTWjRYknE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 1337-73188/test-2171440496/custom/workflows GO111MODULE e/git-receive-pack GOINSECURE GOMOD GOMODCACHE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE o 64/src/runtime/alist 64/pkg/tool/linu--json env -json BytXhgNOP ache/go/1.25.8/x--created GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 nLaxVxxol 64/pkg/tool/linux_amd64/compile GOINSECURE obyte GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a 57OuoO-7M x_amd64/link GOINSECURE ole GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/link GOINSECURE GOMOD erignore ache/go/1.25.8/x64/pkg/tool/linux_amd64/link env 1337-73188/test-2108741704 GO111MODULE e/git-upload-pack GOINSECURE GOMOD GOMODCACHE 9OTogZf_4YB5l/8BsbsfZgwj1dNLZSql61/fgdupBxWTtzW5config (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE wasm.o 64/src/runtime/agithub.actor 64/pkg/tool/linux_amd64/vet env -json aNsjT_hWR x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD bis 64/pkg/tool/linux_amd64/compile env 2439396035/.github/workflows 5Lj-UidHf ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/xorigin (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD erignore ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet env 1337-73188/test-2108741704 GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name UHEwN-QbQ 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a CLJOlIPxV k GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 QyquJZDcH /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env rtcfg yi2fVdpoL ache/go/1.25.8/x64/pkg/tool/linu-test.short=true GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE ache/node/24.14.1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go t-73�� 1337-73188/test-2171440496 GO111MODULE es.lock.yml GOINSECURE GOMOD GOMODCACHE e/git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name DW6KATJ4J x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env rtcfg FSSLThW2J ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/xremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 o x_amd64/compile GOINSECURE a20poly1305 GOMODCACHE x_amd64/compile rtcf�� g_.a R30X4Bcts ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE til (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE o 64/src/internal/user.email 64/pkg/tool/linutest@example.com env lidations passed" jPRjWWcxh ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 rrG8ct2Bi ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE ack GOMODCACHE ache/go/1.25.8/xTest User env rtcfg Hgqea9f-D k GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-tests (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE ache/node/24.14.1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go t-40�� sistency_GoAndJavaScript3775226301/001/test-frontmatter-with-env-template-expressions.md GO111MODULE e/git GOINSECURE GOMOD GOMODCACHE e/git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name KmEF_rn9z 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link env 5/001/test-empty-frontmatter.md v7mHHZTds ortcfg.link GOINSECURE GOMOD GOMODCACHE 6lOae4WsPt2nvzZ6yM/kanFXMcb9Ib9j3Zv3h0y/rLzSlIqW-tests (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 xpQFH7LFx x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link env g_.a EocudEgAi ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 06/m1mI9m8ZybBw5VAsfaec/Pi1C9UClmDRmydbNI-g3 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE e/git GOINSECURE GOMOD GOMODCACHE e/git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path */*.ts' '**/*.js-p GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE x_amd64/compile env 3412559277/.github/workflows GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build4257112637/b404/cli.test /tmp/go-build4257112637/b404/cli.test -test.testlogfile=/tmp/go-build4257112637/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -nolocalimports -importcfg /tmp/go-build163730255/b208/importcfg -pack env '**/*.ts' '**/*.-p GO111MODULE ules/.bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /tmp/go-build1487416196/b404/cli.test /tmp/go-build1487416196/b404/cli.test -test.testlogfile=/tmp/go-build1487416196/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv tags/v6 ache/go/1.25.8/xremote.origin.url sv -json wu-5/5eOKu2Litucrev-parse 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv xterm-color go /usr/bin/git -json GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel l /usr/bin/git 1337-73188/test-du GO111MODULE /opt/hostedtoolc/tmp/gh-aw/aw-feature-branch.patch git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv -delete GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ortcfg estl�� tions/setup/js/n-errorsas enpy/Bq-sVaQ5wUF-ifaceassert ache/go/1.25.8/x-nilfunc GOINSECURE /go-yaml/ast GOMODCACHE ache/go/1.25.8/x-tests (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv on' --ignore-path ../../../.pret.prettierignore GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile k/gh�� lGitmain_branch4220836483/001' lGitmain_branch4220836483/001' x_amd64/compile GOINSECURE GOMOD erignore x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile k/gh�� -json GO111MODULE x_amd64/compile GOINSECURE GOMOD erignore x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile ache�� -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv /js && npm run lint:cjs GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE 02zfbN4/uSkbk2Boremote env ck 'scripts/**/*.js' --ignore-pa-p 2/compile.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile k/gh�� Gitmain_branch42remote.origin.url Gitmain_branch4220836483/001' x_amd64/compile GOINSECURE GOMOD ode-gyp-bin/node--show-toplevel x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 1362�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv 5/001/test-inlined-imports-enabled-with-body-content.md rtcfg x_amd64/compile GOINSECURE 730255/b087/ GOMODCACHE x_amd64/compile env 730255/b126/_pkg--workflow GO111MODULE ache/go/1.25.8/x--limit GOINSECURE /go-yaml/printerrev-parse 730255/b087/syma--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv b/workflows GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm env /ref/tags/v9 5Hh4AuvTv x_amd64/compile GOINSECURE 730255/b015/ GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE sh faul�� npx prettier --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-premote.origin.url GOPROXY ache/node/24.14.1/x64/bin/node GOSUMDB GOWORK 64/bin/go node (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile env rtcfg GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE fips140/sha512 GOMODCACHE ache/go/1.25.8/x2 (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo de GOINSECURE GOMOD GOMODCACHE go /pre�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name */*.ts' '**/*.js-p GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE /prettier GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch tzQPU-Nb0 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE 730255/b015/ GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile rtcf�� 730255/b149/_pkg_.a rg/x/text@v0.36.0/feature/plural/common.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE /cpu ache/go/1.25.8/x64/src/internal/add ache/go/1.25.8/x64/pkg/tool/linuupstream (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /usr/bin/git -json GO111MODULE 64/bin/go git init�� GOMODCACHE go /usr/bin/gh ned-imports-enabgit GO111MODULE odules/npm/node_--show-toplevel gh (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git e/git init�� e/git git ode_modules/.bin/git =receive test@example.com--git-dir=/tmp/bare-incremental-HN2Vxz /git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 1, 2026 00:14
…lpful messages with Did you mean suggestions

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b4192ef2-4d95-44d3-bcc9-d4c22a63131d

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-of-truth register functions

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b4192ef2-4d95-44d3-bcc9-d4c22a63131d

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cryptic JSON schema error for workflow-name parameter fix(mcp): transform raw schema validation errors into helpful "Did you mean?" messages May 1, 2026
Copilot AI requested a review from pelikhan May 1, 2026 00:22
@pelikhan pelikhan marked this pull request as ready for review May 1, 2026 00:23
Copilot AI review requested due to automatic review settings May 1, 2026 00:23
Copy link
Copy Markdown
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 improves MCP tool-call UX by converting raw JSON-schema additionalProperties: false validation errors into user-friendly “Unknown parameter … Did you mean …?” messages, with per-tool parameter suggestions.

Changes:

  • Added an MCP receiving middleware that detects “unexpected additional properties” validation errors, extracts unknown params, and emits a friendlier error with a suggested closest param.
  • Added a hardcoded per-tool parameter registry (mcpToolParams()) used to drive suggestions.
  • Added unit tests covering error parsing, fuzzy matching, message construction, and middleware behavior.
Show a summary per file
File Description
pkg/cli/mcp_server.go Registers the new receiving middleware after tool registration.
pkg/cli/mcp_argument_validation.go Implements unknown-param extraction, fuzzy suggestion logic, friendly message formatting, and the tool param registry.
pkg/cli/mcp_argument_validation_test.go Adds unit tests for the new parser/matcher/message + middleware pass-through behavior.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread pkg/cli/mcp_argument_validation.go Outdated
Comment on lines +34 to +35
// toolParams maps tool names to their list of valid JSON parameter names. It is
// built from the tool input schemas during server construction.
Comment thread pkg/cli/mcp_argument_validation_test.go Outdated
Comment on lines +189 to +191
// Use a minimal fake request for the tools/call method.
// Since extractMCPToolName uses a type assertion, we pass nil params
// and accept an empty toolName (which skips the help line).
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🧪 Test Quality Sentinel Report

Test Quality Score: 96/100

Excellent test quality

Metric Value
New/modified tests analyzed 8
✅ Design tests (behavioral contracts) 8 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 7 (87.5%)
Duplicate test clusters 0
Test inflation detected No (1.07:1 ratio)
🚨 Coding-guideline violations 0 (mock libraries / missing build tags)

Test Classification Details

View all 8 test classifications
Test File Classification Issues Detected
TestExtractUnknownParams pkg/cli/mcp_argument_validation_test.go ✅ Design Table-driven; covers single, multiple, underscore, no-match, empty string
TestFindSimilarParam pkg/cli/mcp_argument_validation_test.go ✅ Design Table-driven; covers hyphens, underscores, unrelated input, empty params, exact match
TestBuildHelpfulParamError pkg/cli/mcp_argument_validation_test.go ✅ Design Covers suggestion, no-suggestion, multiple unknowns, empty tool name
TestArgumentValidationMiddleware_TransformsAdditionalPropertiesError pkg/cli/mcp_argument_validation_test.go ✅ Design End-to-end middleware transformation verified on output content
TestArgumentValidationMiddleware_PassesThroughNonValidationErrors pkg/cli/mcp_argument_validation_test.go ✅ Design Verifies middleware does not corrupt unrelated error messages
TestArgumentValidationMiddleware_PassesThroughSuccessResults pkg/cli/mcp_argument_validation_test.go ✅ Design Verifies middleware pass-through for successful results
TestArgumentValidationMiddleware_PassesThroughNonToolCallMethods pkg/cli/mcp_argument_validation_test.go ✅ Design Verifies middleware ignores non-tools/call methods
TestMCPToolParams pkg/cli/mcp_argument_validation_test.go ✅ Design Registry completeness + compile tool's required params

Minor Observations (Non-Blocking)

A handful of require / assert calls in the middleware pass-through tests are missing the guideline-required descriptive message argument:

  • require.NoError(t, err)require.NoError(t, err, "middleware should not error")
  • require.True(t, ok)require.True(t, ok, "result should be *mcp.CallToolResult")
  • assert.False(t, toolResult.IsError)assert.False(t, toolResult.IsError, "success result should not be an error")
  • assert.True(t, called)assert.True(t, called, "inner handler should be invoked")

These are not blocking but should be fixed for consistency with the project style guide (every assertion should carry a descriptive message).


Language Support

Tests analyzed:

  • 🟨 JavaScript (*.test.cjs, *.test.js): 0 tests

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). All 8 tests verify observable behavioral contracts — error parsing, fuzzy matching, message content, and middleware input/output transformation. No mock library usage, no missing build tags.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

References: §25196075873

🧪 Test quality analysis by Test Quality Sentinel · ● 403.2K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 96/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). All 8 tests verify behavioral contracts with good edge-case coverage.

…n error transformation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Commit pushed: 3639931

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 1, 2026

@copilot review all comments

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 1, 2026

@copilot review all comments

Addressed both review comments in commit 075b20f:

  1. mcp_argument_validation.go:34-35 — Updated the toolParams doc to say it is "provided by the caller as a hardcoded registry (see mcpToolParams)" instead of the misleading "built from tool input schemas".

  2. mcp_argument_validation_test.go:189-191 — Replaced the incorrect comment ("pass nil params / empty toolName") with one that accurately describes what happens: fakeToolCallRequest("compile") provides a real tool name, extractMCPToolName resolves to "compile", and the help line is included in the output.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

✅ smoke-ci: safeoutputs CLI comment + comment-memory run (25197490032)

Generated by Smoke CI for issue #29406 ·

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Comment Memory

CI lights the path
Green checks bloom at dawn
Quiet bots still sing

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Generated by Smoke CI for issue #29406 ·

@github-actions github-actions Bot mentioned this pull request May 1, 2026
@pelikhan pelikhan merged commit eb66008 into main May 1, 2026
26 checks passed
@pelikhan pelikhan deleted the copilot/fix-workflow-name-error branch May 1, 2026 01:21
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.

[cli-tools-test] compile tool: --workflow-name parameter rejected with cryptic JSON schema error instead of helpful message

3 participants