Skip to content

Comments

Fix safe-outputs message parsing and schema gaps for detection-failure and agent-failure-*#17207

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-safe-outputs-message-parsing
Feb 20, 2026
Merged

Fix safe-outputs message parsing and schema gaps for detection-failure and agent-failure-*#17207
pelikhan merged 2 commits intomainfrom
copilot/fix-safe-outputs-message-parsing

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

Three messages fields in safe-outputs were broken: detection-failure existed in the Go struct and JS but was never parsed from frontmatter or merged during imports; agent-failure-issue and agent-failure-comment had the same gap plus were missing from the JSON schema entirely, causing validation to reject them.

Changes

  • pkg/workflow/safe_outputs_config_messages.goparseMessagesConfig now reads detection-failure, agent-failure-issue, and agent-failure-comment from the frontmatter map into their respective struct fields
  • pkg/workflow/imports.gomergeMessagesConfig now propagates DetectionFailure, AgentFailureIssue, and AgentFailureComment when merging imported workflow configs (main takes precedence)
  • pkg/parser/schemas/main_workflow_schema.json — adds agent-failure-issue and agent-failure-comment schema entries so validation no longer blocks these fields

Example usage now supported end-to-end:

safe-outputs:
  create-issue: ~
  messages:
    detection-failure: "⚠️ Detection failed in [{workflow_name}]({run_url})."
    agent-failure-issue: "> Failure tracked by [{workflow_name}]({run_url})"
    agent-failure-comment: "> Update from [{workflow_name}]({run_url})"

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

This section details on the original issue you should resolve

<issue_title>[deep-report] Fix safe-outputs message parsing and schema gaps (detection-failure, agent-failure-*)</issue_title>
<issue_description>### Description
The schema-consistency report shows two safe-outputs message fields that are either ignored or schema-blocked. messages.detection-failure is defined and consumed by JS but not parsed/merged in Go. messages.agent-failure-issue and messages.agent-failure-comment exist in Go+JS but are missing from the schema and parser, so validation blocks them. Update parser (parseMessagesConfig), import merging, and the schema, and align docs.

Expected Impact

Workflow authors can configure these message templates, schema validation matches runtime behavior, and safe-outputs messaging becomes consistent across Go/JS/docs.

Suggested Agent

copilot-swe-agent

Estimated Effort

Medium (1-4 hours)

Data Source

Discussion #17118 — Schema Consistency Check (2026-02-20)

Generated by DeepReport - Intelligence Gathering Agent

  • expires on Feb 22, 2026, 3:30 PM UTC

Comments on the Issue (you are @copilot in this section)


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

…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>
Copilot AI changed the title [WIP] Fix safe-outputs message parsing and schema gaps Fix safe-outputs message parsing and schema gaps for detection-failure and agent-failure-* Feb 20, 2026
Copilot AI requested a review from pelikhan February 20, 2026 15:51
@pelikhan pelikhan marked this pull request as ready for review February 20, 2026 15:53
Copilot AI review requested due to automatic review settings February 20, 2026 15:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and agent-failure-comment in the frontmatter parser
  • Added merge logic for these three fields to properly propagate them during workflow imports
  • Added JSON schema definitions for agent-failure-issue and agent-failure-comment to 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.

Comment on lines +82 to +99
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
}
}

Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +686 to +694
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
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit 6807136 into main Feb 20, 2026
120 checks passed
@pelikhan pelikhan deleted the copilot/fix-safe-outputs-message-parsing branch February 20, 2026 16:04
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.

[deep-report] Fix safe-outputs message parsing and schema gaps (detection-failure, agent-failure-*)

2 participants