Fix choice type conversion to JSON Schema in safe-output jobs #7291
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.
Custom safe-output jobs using
type: choicewithoptionsgenerated invalid JSON Schema, causing Claude API calls to fail with schema validation errors. The compiler was passing the GitHub Actionschoicetype through literally instead of converting it to JSON Schema draft 2020-12 format.Changes
type: choicetotype: stringinsafe_outputs_tools_loader.cjswhen building MCP tool schemasdaily-choice-test.mddemonstrating Claude with choice inputsSchema Conversion
Before (invalid):
{ "environment": { "type": "choice", "options": ["staging", "production"] } }After (valid JSON Schema):
{ "environment": { "type": "string", "enum": ["staging", "production"] } }The fix detects
type: "choice"in input definitions and maps it to the JSON Schema equivalent:type: "string"with anenumarray derived fromoptions.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 ithub/workflows -trimpath 0375759/b385/vet.cfg -p github.com/creac-C -lang=go1.18 /tmp/go-build358rev-parse -tes�� pload-artifact/g@{u} -test.v=true e/git -test.run=^Test -nolocalimports -importcfg e/git(http block)/usr/bin/gh gh api user --jq .login k/gh-aw/gh-aw/.github/workflows -buildtags e/git -errorsas -ifaceassert -nilfunc e/git -C om/anchore/sbom-action.git om/anchore/sbom-action.git e/git-remote-https remote.origin.ur/tmp/gh-aw-compile-integration-4238872219/gh-aw git 64/bin/go e/git-remote-htttest-github-copilot(http block)/usr/bin/gh gh api user --jq .login ithub/workflows origin 6feed205c51ef01b5be297f9cce95b7592b/log.json xterm-color git 64/pkg/tool/linuxterm-color e/git 0/x6�� om/actions/cache.git om/actions/cache.git /usr/bin/git t ./...)" ]; the/usr/bin/containerd-shim-runc-v2 ache/go/1.25.0/x-namespace ache/go/1.25.0/xmoby git(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.