Conversation
…ue, agent-failure-comment messages - parseMessagesConfig now handles detection-failure, agent-failure-issue, agent-failure-comment - mergeMessagesConfig now merges DetectionFailure, AgentFailureIssue, AgentFailureComment - JSON schema now includes agent-failure-issue and agent-failure-comment entries Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes parsing and schema gaps for three safe-outputs message fields that were previously defined in Go/JS but either not parsed (detection-failure) or missing from the schema entirely (agent-failure-issue and agent-failure-comment). The changes enable workflow authors to customize message templates for detection failures and agent failure tracking.
Changes:
- Added parsing logic for
detection-failure,agent-failure-issue, andagent-failure-commentin the frontmatter parser - Added merge logic for these three fields to properly propagate them during workflow imports
- Added JSON schema definitions for
agent-failure-issueandagent-failure-commentto enable validation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_config_messages.go | Adds parsing for detection-failure, agent-failure-issue, and agent-failure-comment from frontmatter map |
| pkg/workflow/imports.go | Adds merge logic for the three new message fields when importing workflow configs |
| pkg/parser/schemas/main_workflow_schema.json | Adds schema entries for agent-failure-issue and agent-failure-comment fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if detectionFailure, exists := messagesMap["detection-failure"]; exists { | ||
| if detectionFailureStr, ok := detectionFailure.(string); ok { | ||
| config.DetectionFailure = detectionFailureStr | ||
| } | ||
| } | ||
|
|
||
| if agentFailureIssue, exists := messagesMap["agent-failure-issue"]; exists { | ||
| if agentFailureIssueStr, ok := agentFailureIssue.(string); ok { | ||
| config.AgentFailureIssue = agentFailureIssueStr | ||
| } | ||
| } | ||
|
|
||
| if agentFailureComment, exists := messagesMap["agent-failure-comment"]; exists { | ||
| if agentFailureCommentStr, ok := agentFailureComment.(string); ok { | ||
| config.AgentFailureComment = agentFailureCommentStr | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
The new message parsing logic for detection-failure, agent-failure-issue, and agent-failure-comment follows the established pattern correctly. However, the existing tests in pkg/workflow/safe_outputs_test.go (specifically TestParseMessagesConfig) don't verify these three new fields. Consider adding test cases that include these fields to ensure they are parsed correctly, similar to the existing test case "all fields" at lines 344-366 in safe_outputs_test.go.
| if result.DetectionFailure == "" && imported.DetectionFailure != "" { | ||
| result.DetectionFailure = imported.DetectionFailure | ||
| } | ||
| if result.AgentFailureIssue == "" && imported.AgentFailureIssue != "" { | ||
| result.AgentFailureIssue = imported.AgentFailureIssue | ||
| } | ||
| if result.AgentFailureComment == "" && imported.AgentFailureComment != "" { | ||
| result.AgentFailureComment = imported.AgentFailureComment | ||
| } |
There was a problem hiding this comment.
The merge logic for the three new message fields follows the established pattern correctly. However, the existing tests in pkg/workflow/safe_outputs_import_test.go (specifically TestMergeSafeOutputsMessagesUnit) don't verify these new fields. The test assertions at lines 610-617 should be extended to also check DetectionFailure, AgentFailureIssue, and AgentFailureComment to ensure they are merged correctly during imports.
Three
messagesfields in safe-outputs were broken:detection-failureexisted in the Go struct and JS but was never parsed from frontmatter or merged during imports;agent-failure-issueandagent-failure-commenthad the same gap plus were missing from the JSON schema entirely, causing validation to reject them.Changes
pkg/workflow/safe_outputs_config_messages.go—parseMessagesConfignow readsdetection-failure,agent-failure-issue, andagent-failure-commentfrom the frontmatter map into their respective struct fieldspkg/workflow/imports.go—mergeMessagesConfignow propagatesDetectionFailure,AgentFailureIssue, andAgentFailureCommentwhen merging imported workflow configs (main takes precedence)pkg/parser/schemas/main_workflow_schema.json— addsagent-failure-issueandagent-failure-commentschema entries so validation no longer blocks these fieldsExample usage now supported end-to-end:
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/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 GO111MODULE 64/bin/go git conf�� user.name Test User(http block)/usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name /usr/bin/infocmp -json GO111MODULE 64/bin/go infocmp -1 xterm-color go /usr/bin/git y-frontmatter.mdgit GO111MODULE x_amd64/compile git(http block)/usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name /opt/hostedtoolcache/node/24.13.0/x64/bin/node -json GO111MODULE 64/bin/go /opt/hostedtoolcache/node/24.13.0/x64/bin/node /tmp�� env.NODE_VERSION go /usr/bin/git le-frontmatter.mgit GO111MODULE 64/bin/go git(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha runs/20260220-154518-27481/test-1015686681/.github/workflows GO111MODULE 847166/b354/vet.cfg l GOMOD GOMODCACHE go env -json GO111MODULE cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 4518-27481/test-2629764644/.github/workflows GO111MODULE cfg GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha auto-triage-issues.md GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE 99580cb4800315b6rev-parse GOMODCACHE go env 4518-27481/test-3462282080 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha y go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel node /usr/bin/git --check **/*.cjs 64/bin/go git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/asm(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 0:00Z rev-parse /usr/bin/git @{u} GOPROXY 64/bin/go git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/xGO111MODULE /opt/hostedtoolcache/node/24.13.0/x64/bin/node /tmp/go-build943git -trimpath 64/bin/go node(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ck 'scripts/**/*GOINSECURE 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/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha vaScript1328698322/001/test-frontmatter-with-env-template-expressions.md GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 4518-27481/test-3462282080 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha blog-auditor.md 99580cb4800315b637c218c4:go.mod /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 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/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go stlo�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go stlo�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 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/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 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/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ty-test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 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/actions/workflows/usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 819410/b381/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE bagabas/go-udiff+x GOMODCACHE go(http block)/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 bracelet/x/exp/g-V=full GOMODCACHE go env LKMt/TwHi_itfwfBGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 819410/b383/importcfg(http block)/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 GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js GO111MODULE /opt/hostedtoolcgit rev-parse --abbrev-ref HEAD go vers�� GOMODCACHE go /usr/bin/git -json GO111MODULE 847166/b273/vet.node git(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2629764644/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/link env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE Xu/X6R5OoPF4X40d7UERB47/kI2eOA--Test User(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 819410/b356/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 819410/b357/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh workflow list --repo owner/repo --json name,path,state /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE 64/bin/go git(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build579847166/b380/cli.test /tmp/go-build579847166/b380/cli.test -test.testlogfile=/tmp/go-build579847166/b380/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ; \ fi(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.