Skip to content

Register replace_label handler in safe-output collect job dispatch map - #58917

Open
dsyme with Copilot wants to merge 5 commits into
mainfrom
copilot/samples-mode-replay-fixes
Open

Register replace_label handler in safe-output collect job dispatch map#58917
dsyme with Copilot wants to merge 5 commits into
mainfrom
copilot/samples-mode-replay-fixes

Conversation

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

replace-label samples compiled and replayed successfully at the MCP layer, but the actual label mutation never ran — the safe output was silently dropped and fixture labels stayed unchanged. call-workflow and dispatch-workflow were already fixed previously (dynamic MCP tool naming + HANDLER_MAP entries) and are confirmed working.

Root cause

  • replace_label.cjs is a fully implemented handler, but it was missing from HANDLER_MAP in actions/setup/js/safe_output_handler_manager.cjs — the map the collect job uses to load/dispatch handlers for each entry in the agent's outputs.jsonl.
  • Everything upstream of that map worked: schema validation, GH_AW_SAMPLES generation, and the MCP tools/call replay itself. Without a HANDLER_MAP entry, the collect job had nothing to invoke for replace_label entries, so they were skipped and no GitHub API mutation occurred.

Changes

  • Add replace_label: "./replace_label.cjs" to HANDLER_MAP so the collect job loads and invokes it.
  • Add "replace_label" to THREAT_WARNING_ABORT_TYPES, alongside add_labels/remove_labels, since it performs the same class of non-reviewable label mutation.
  • Add regression tests in safe_output_handler_manager.test.cjs:
    • static assertion that HANDLER_MAP contains replace_label.cjs
    • functional test that a registered replace_label handler is invoked without a "no handler loaded" error
    • functional test reproducing the original symptom (missing map entry → "No handler loaded for type 'replace_label'")

pr-sous-chef

Run: https://github.com/github/gh-aw/actions/runs/34042322138

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.6 AIC · ⌖ 10 AIC · ⊞ 9.2K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 46.9 AIC · ⌖ 8.67 AIC · ⊞ 8.7K ·
Comment /souschef to run again


$

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 9.29 AIC · ⌖ 8.74 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix samples mode replay issues for safe outputs Register replace_label handler in safe-output collect job dispatch map Sep 6, 2026
Copilot AI requested a review from dsyme September 6, 2026 04:16
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 71/100 (impact 35/50, urgency 22/30, quality 14/20) | Action: fast_track | Batch: workflow-reliability | Note: safe-output handler bug with regression tests and no CI yet.

Generated by 🔧 PR Triage Agent · copilot · mai10 · 19.3 AIC · ⌖ 2.53 AIC · ⊞ 15.4K ·

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 59 (impact 28, urgency 20, quality 13) | Action: fast_track | Batch: workflow-reliability

Generated by 🔧 PR Triage Agent · copilot · mai10 · 24.2 AIC · ⌖ 2.64 AIC · ⊞ 16.5K ·

@github-actions

This comment has been minimized.

@pelikhan
pelikhan marked this pull request as ready for review September 6, 2026 15:02
Copilot AI balanced review requested due to automatic review settings September 6, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Security-gate and exact handler-mapping coverage remain incomplete.

Pull request overview

Registers the replace_label safe-output handler and applies threat-warning abort handling.

Changes:

  • Adds replace_label to handler dispatch and threat-warning classification.
  • Adds regression tests for registration and missing-handler behavior.
  • Two testing nits remain: abort-policy coverage omits replace_label, and the mapping assertion does not verify the exact key-value pair.
File summaries
File Description
actions/setup/js/safe_output_handler_manager.test.cjs Adds registration and dispatch regression tests.
actions/setup/js/safe_output_handler_manager.cjs Registers and classifies replace_label.
Review details

Suppressed comments (2)

actions/setup/js/safe_output_handler_manager.cjs:202

  • The new threat-warning classification is not covered by the existing parameterized abort-policy test, which currently exercises other mutation types but omits replace_label. Add replace_label to that test so a future removal from this security gate cannot silently re-enable label mutation when detection concludes with a warning.
  "replace_label",

actions/setup/js/safe_output_handler_manager.test.cjs:2374

  • This assertion only proves that the filename appears somewhere in HANDLER_MAP; it would still pass if the module were accidentally registered under the wrong key, while the functional test below manually constructs the handler map and therefore cannot catch that mistake. Since the regression is specifically the replace_label key-to-module mapping, assert the exact pair (or exercise loadHandlers({ replace_label: ... })).
      expect(handlerFiles).toContain("replace_label.cjs");
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • Address the remaining review feedback on exact replace_label handler-map coverage and threat-warning abort-policy coverage.
  • Re-run the relevant JS tests, then run the pr-finisher skill.
  • Leave a concise maintainer-facing handoff summarizing whether the security-gate coverage gap is fully closed.

Recent review blockers:

  • add exact key-to-module mapping coverage for replace_label.
  • add abort-policy test coverage so threat-warning handling cannot silently regress.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34042322138

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.6 AIC · ⌖ 10 AIC · ⊞ 9.2K ·
Comment /souschef to run again

…place_label

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Added exact key-to-module mapping test coverage for replace_label in HANDLER_MAP (pairs["replace_label"] === "./replace_label.cjs"), loadHandlers configuration integration test, and threat-detection warning mode abort-policy test coverage for replace_label, add_labels, and remove_labels. All unit tests pass locally.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 74/100 (impact 36/50, urgency 22/30, quality 16/20) | Action: fast_track | Batch: workflow-reliability | CI: unknown

Generated by 🔧 PR Triage Agent · copilot · mai10 · 20.1 AIC · ⌖ 2.64 AIC · ⊞ 16.5K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on PR #58917.

  • Your latest reply says the exact handler-map and threat-warning coverage gaps were added on HEAD.
  • Re-check whether the remaining reviewer concern is now fully addressed on the current head, resolve any still-open review conversation if appropriate, and run the pr-finisher skill.
  • If no further code changes are needed, leave a concise maintainer-facing handoff stating that clearly.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34054283325

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 46.9 AIC · ⌖ 8.67 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Verified that both exact key-to-module mapping test coverage (HANDLER_MAP["replace_label"] === "./replace_label.cjs") and threat-detection warning mode abort-policy test coverage (THREAT_WARNING_ABORT_TYPES abort tests for replace_label, add_labels, and remove_labels) are present on HEAD and all JS unit tests are passing cleanly.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on PR #58917.

  • Re-check the latest branch, review, and CI state on current HEAD.
  • Refresh the branch if appropriate, then run the pr-finisher skill.
  • Provide a concise maintainer-facing handoff describing any remaining blocker.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34056386020

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 9.29 AIC · ⌖ 8.74 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Re-checked current HEAD, branch merge state, and tests for PR #58917. The branch is fully up to date with origin/main, all unit tests pass, and all review feedback has been addressed and verified on HEAD.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Great work! This PR is well-aligned with the project's guidelines and ready for review.

Summary: This is a focused bug fix that registers the replace_label handler in the safe-output handler dispatch map, addressing issue #54811. The PR includes:

  • ✓ Clear problem diagnosis (root cause explanation in PR body)
  • ✓ Targeted fix (2-line change to HANDLER_MAP)
  • ✓ Comprehensive test coverage (regression tests added to catch this class of error)
  • ✓ Security consideration (handler added to THREAT_WARNING_ABORT_TYPES)
  • ✓ Related changes well-organized (only 2 files touched)

The fix is minimal, focused, and includes regression tests to prevent future occurrences of the same issue.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by ✅ Contribution Check · copilot · auto · 53.8 AIC · ⌖ 7.5 AIC · ⊞ 9.3K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

samples mode cannot replay call-workflow, dispatch-workflow, or replace-label

4 participants