Add JSON Schema if/then conditional validation for field requirements#7601
Closed
Add JSON Schema if/then conditional validation for field requirements#7601
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Add if/then constraint for MCP containers in strict mode requiring network - Add if/then constraint for write permissions requiring safe-outputs in strict mode - Add if/then constraint for sandbox-runtime requiring feature flag - Add if/then constraint for UV packages requiring network access - Add 'network' field to known MCP configuration properties - Rebuild binary with updated embedded schema Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Verified all four conditional validations catch violations correctly - Verified valid configurations still compile successfully - All MCP, Schema, and Strict mode tests pass - Pre-existing test failure in TestCodexAIConfiguration is unrelated to changes Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add if/then conditional validation for field requirements
Add JSON Schema if/then conditional validation for field requirements
Dec 25, 2025
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.
Several field requirements depend on other field values (e.g., MCP containers need network config in strict mode) but were only enforced at compile time. Users discovered these requirements through compilation errors rather than immediate schema validation feedback.
Changes
Added four
if/thenconditional constraints topkg/parser/schemas/main_workflow_schema.json:1. MCP containers in strict mode require network
2. Write permissions require safe-outputs in strict mode
3. Sandbox-runtime requires feature flag
4. UV runtime requires network access
Implementation
allOfsectionnetworkas valid field in bothmcp-config.goandmcp_config_validation.gomake buildto embed updated schemaSchema validation now catches these violations immediately with clear error messages indicating missing required fields, before compilation begins.
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/user/usr/bin/gh gh api user --jq .login te '../../**/*.jGOINSECURE 0/x64/bin/npm 64/bin/go k/gh-aw/gh-aw/.g/bin/sh -tests(http block)/usr/bin/gh gh api user --jq .login d-artifact.git --jq /usr/bin/git l GOWORK 64/bin/go git desc�� k/gh-aw/gh-aw/.g.github/workflows/test.md --always /usr/bin/git l origin 64/pkg/tool/linuuser git(http block)/usr/bin/gh gh api user --jq .login 7/update_issue.js c /usr/bin/git - git 64/bin/go git -C 1558-34581/test-id,name,path,state add e/git-remote-https by/f4ff9dc5e0a81sh git 64/bin/go e/git-remote-https(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.