Skip to content

fix(mcp): refuse strict=true in compile tool, remove strict schema default - #49893

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/cli-tools-test-fix-strict-mode-default
Closed

fix(mcp): refuse strict=true in compile tool, remove strict schema default#49893
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/cli-tools-test-fix-strict-mode-default

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The MCP compile tool had AddSchemaDefault(..., "strict", true), causing LLM clients to always pass strict: true even when not explicitly requested. This silently recompiled non-strict workflows with --strict, producing unwanted lock-file diffs (e.g. GH_AW_COMPILED_STRICT: "false""true", dropped Enforce strict mode policy step).

Changes

  • Remove schema default: Drop AddSchemaDefault(compileSchema, "strict", true) — LLMs no longer receive a default: true hint for strict, so unspecified calls compile without --strict
  • Refuse strict=true at runtime: Add an early guard that returns CodeInvalidParams when strict: true is passed, directing users to gh aw compile --strict
  • Remove dead code: Drop the now-unreachable --strict flag append
  • Update descriptions: Strict field and tool description updated to reflect the not-supported status
  • Tests: Inverted the elicitation-defaults test to assert no strict default; added TestMCPServerUnit_CompileToolRejectsStrict; updated the integration test to expect an error on strict: true
// Before: schema default caused LLMs to always pass strict: true
AddSchemaDefault(compileSchema, "strict", true)

// After: no default; strict=true is refused at runtime
if args.Strict {
    return nil, nil, newMCPError(jsonrpc.CodeInvalidParams,
        "compile with strict=true is not supported via the MCP tool; use gh aw compile --strict for strict mode compilation", nil)
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix agenticworkflows compile tool defaults to strict mode fix(mcp): refuse strict=true in compile tool, remove strict schema default Aug 3, 2026
Copilot AI requested a review from pelikhan August 3, 2026 04:50
@pelikhan pelikhan closed this Aug 3, 2026
@github-actions
github-actions Bot deleted the copilot/cli-tools-test-fix-strict-mode-default branch August 11, 2026 02:41
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] agenticworkflows compile MCP tool defaults to strict mode, causing unwanted lock-file diffs

2 participants