Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

Custom safe-output jobs using type: choice with options generated invalid JSON Schema, causing Claude API calls to fail with schema validation errors. The compiler was passing the GitHub Actions choice type through literally instead of converting it to JSON Schema draft 2020-12 format.

Changes

  • JavaScript: Convert type: choice to type: string in safe_outputs_tools_loader.cjs when building MCP tool schemas
  • Tests: Add test coverage for choice type conversion with required fields and enum validation
  • Example workflow: Add daily-choice-test.md demonstrating Claude with choice inputs

Schema 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 an enum array derived from options.

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
    • Triggering command: /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)
    • Triggering command: /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)
    • Triggering command: /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

Fix issue reported in githubnext/agentics#82

Add a daily workflow using Claude to test this scenario. The workflow should have a custom job with choices.


💡 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.

Copilot AI and others added 2 commits December 22, 2025 16:34
… workflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue reported in issue #82 and add daily workflow Fix choice type conversion to JSON Schema in safe-output jobs Dec 22, 2025
Copilot AI requested a review from pelikhan December 22, 2025 16:45
@pelikhan pelikhan marked this pull request as ready for review December 22, 2025 16:51
@pelikhan pelikhan merged commit 8437577 into main Dec 22, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-issue-82-add-daily-workflow branch December 22, 2025 16:51
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.

2 participants