feat: label agent failure issues with agentic-workflows tag#18842
feat: label agent failure issues with agentic-workflows tag#18842
Conversation
There was a problem hiding this comment.
Pull request overview
Ensures issues created by the “missing tool” / “missing data” handlers are consistently labeled with the agentic-workflows tag to aid triage and tracking.
Changes:
- Added a
defaultLabelsoption tobuildMissingIssueHandlerand merged it with user-providedconfig.labels(with deduplication). - Updated
create_missing_tool_issue.cjsandcreate_missing_data_issue.cjsto always applyagentic-workflows. - Added unit tests to verify default label application, merging, and deduplication.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| actions/setup/js/missing_issue_helpers.cjs | Adds defaultLabels support and merges it with configured labels for created issues. |
| actions/setup/js/missing_issue_helpers.test.cjs | Adds tests for default label application/merge/dedup behavior. |
| actions/setup/js/create_missing_tool_issue.cjs | Passes defaultLabels: ["agentic-workflows"] to ensure consistent labeling. |
| actions/setup/js/create_missing_data_issue.cjs | Passes defaultLabels: ["agentic-workflows"] to ensure consistent labeling. |
Comments suppressed due to low confidence (1)
actions/setup/js/missing_issue_helpers.cjs:44
- The log message
Default labels:currently prints the merged label list (defaults + user labels), which is misleading. Consider logging this asLabels:/Applied labels:or loggingdefaultLabelsanduserLabelsseparately.
core.info(`Title prefix: ${titlePrefix}`);
if (envLabels.length > 0) {
core.info(`Default labels: ${envLabels.join(", ")}`);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { handlerType, defaultTitlePrefix, itemsField, templatePath, templateListKey, buildCommentHeader, renderCommentItem, renderIssueItem, defaultLabels = [] } = options; | ||
|
|
There was a problem hiding this comment.
defaultLabels is merged into the final label list without the same String/trim/filter normalization applied to config.labels. For consistency (and to avoid surprises if a future call site passes non-trimmed/non-string values), consider normalizing defaultLabels the same way before merging/deduping.
| const envLabels = [...new Set([...defaultLabels, ...userLabels])]; | ||
| const maxCount = config.max || 1; // Default to 1 to create only one issue per workflow run |
There was a problem hiding this comment.
envLabels is no longer just labels sourced from the config/environment—it now includes defaultLabels plus user-provided labels. Renaming this variable to something like issueLabels/appliedLabels would make the intent clearer and reduce confusion for future maintenance.
This issue also appears on line 41 of the same file.
See below for a potential fix:
const issueLabels = [...new Set([...defaultLabels, ...userLabels])];
const maxCount = config.max || 1; // Default to 1 to create only one issue per workflow run
core.info(`Title prefix: ${titlePrefix}`);
if (issueLabels.length > 0) {
core.info(`Applied labels: ${issueLabels.join(", ")}`);
Issues created by
create_missing_tool_issueandcreate_missing_data_issuehandlers were not getting the"agentic-workflows"label, unlike the other conclusion job handlers (handle_agent_failure,handle_noop_message,handle_create_pr_error) which already applied it.Changes
missing_issue_helpers.cjs— AddeddefaultLabelsoption tobuildMissingIssueHandler. Always merged (with deduplication) into the final labels alongside any user-providedconfig.labels.create_missing_tool_issue.cjs/create_missing_data_issue.cjs— PassdefaultLabels: ["agentic-workflows"]to guarantee the label is always applied.missing_issue_helpers.test.cjs— Added tests covering: default labels applied when noconfig.labelsset, merge with user labels, and deduplication.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/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/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 m k/gh-aw/node_modorigin git add ranch..feature-branch git ache/go/1.25.0/x64/bin/git user.name Test User /git git(http block)/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/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 gin/feature-bran/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/vit�� nfig/composer/verun 1/x64/bin/node /vit�� -unreachable=false l tions/node_modules/.bin/git ve Initial commit tions/setup/js/ntest:js tions/setup/js/n--(http block)/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/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 --format=%s ode_modules/vite-t ode_modules/vitesecurity /pre�� 296b7a7cacf7b3d7OUTPUT .com/repo.git.ur-d tions/node_modul168.63.129.16 -m Initial commit -branch 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.