Skip to content

Don't fail safe_outputs job when a resolve-review-thread ID hits an unrelated repo - #53124

Merged
pelikhan merged 5 commits into
mainfrom
copilot/fix-failed-jobs-pr-sous-chef
Aug 16, 2026
Merged

Don't fail safe_outputs job when a resolve-review-thread ID hits an unrelated repo#53124
pelikhan merged 5 commits into
mainfrom
copilot/fix-failed-jobs-pr-sous-chef

Conversation

Copilot AI commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

The safe_outputs job in PR Sous Chef failed because a resolve_pull_request_review_thread call was made with a thread ID that resolved to an unrelated repository (juju/juju), tripping the allowed-repos check. Since the workflow never configured cross-repo resolution, this was almost certainly a stale or fabricated GraphQL node ID — but the handler treated the mismatch as a fatal error, failing the entire job even though four other safe outputs in the same run had already succeeded.

Handler behavior

  • resolve_pr_review_thread.cjs: in legacy (default, non-cross-repo) mode, a thread resolving to a disallowed repo is now marked skipped: true instead of a hard failure. The action still isn't performed (fail-closed is preserved), but a single bad ID no longer takes down the whole safe_outputs job — same treatment as already-resolved/stale threads. Explicit cross-repo misconfigurations (via target/allowed-repos) still fail fatally, since those indicate real setup errors.
// legacy mode: thread resolves to an unrelated repo
core.warning(`Thread ${resolvedThreadId} repository ${threadRepo} is not allowed in legacy mode; skipping`);
return {
  success: false,
  skipped: true, // was: fatal failure
  thread_id: resolvedThreadId,
  error: legacyRepoValidation.error,
};

Prompt hardening

  • pr-sous-chef.md: instructions now explicitly require copying PRRT_... thread IDs verbatim from reviewThreads output rather than guessing, truncating, or extending them, to reduce the chance of malformed IDs being submitted in the first place.

Tests

  • Updated resolve_pr_review_thread.test.cjs to assert the legacy cross-repo mismatch case is now skipped rather than fatal.
  • Added coverage in safe_output_handler_manager.test.cjs confirming a skipped resolve_pull_request_review_thread result is excluded from fatalFailures while still being counted in the overall skip/failure status (not silently dropped).

Run: https://github.com/github/gh-aw/actions/runs/31950301208> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 5.77 AIC · ⊞ 8.7K ·

Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 8.45 AIC · ⌖ 6.8 AIC · ⊞ 6.3K ·
Comment /souschef to run again


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


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

@github-actions

Copy link
Copy Markdown
Contributor

Hi @pelikhan 👋 — thanks for tasking the Copilot bot with this workflow fix! I see this is a work-in-progress (draft) PR addressing the failed safe_outputs job in the PR Sous Chef workflow (closes #53094).

Since this PR is still in draft with no code changes yet, here are the things to watch for as the implementation progresses:

  • Add concrete changes — Once the fix is ready, make sure the diff clearly addresses the root cause of the safe_outputs job failure.
  • Keep description updated — As noted in the PR, continue updating the description with progress and context so reviewers understand the fix strategy.
  • Consider test coverage — If the fix involves workflow logic or YAML changes, consider adding or updating tests if the project has workflow test patterns.

The PR is properly on-topic and follows the core-team contribution process. Once code is added, we can assess focus and completeness more fully. Looking forward to seeing the fix!

Generated by ✅ Contribution Check · auto · 56.8 AIC · ⌖ 3.74 AIC · ⊞ 9.1K ·

Copilot AI and others added 2 commits August 16, 2026 13:13
…_outputs job

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ropped

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failed jobs in PR Sous Chef workflow Don't fail safe_outputs job when a resolve-review-thread ID hits an unrelated repo Aug 16, 2026
Copilot AI requested a review from pelikhan August 16, 2026 13:19
@pelikhan
pelikhan marked this pull request as ready for review August 16, 2026 13:31
Copilot AI balanced review requested due to automatic review settings August 16, 2026 13:31
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the implementation label and has 0 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship. Reviewed PR #53124 diff for over-engineering; changes are minimal and targeted (added skipped flag, warning message tweak, one prompt-hardening line, matching test updates). Nothing to cut.

Generated by Ponytail Reviewer for #53124

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-16T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable blocking issues in changed lines
  - tests cover skipped-vs-fatal handler classification
files_reviewed:
  - .github/workflows/pr-sous-chef.md
  - actions/setup/js/resolve_pr_review_thread.cjs
  - actions/setup/js/resolve_pr_review_thread.test.cjs
  - actions/setup/js/safe_output_handler_manager.test.cjs
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.81 AIC · ⌖ 5.44 AIC · ⊞ 4.5K ·
Comment /review to run again

@github-actions github-actions Bot 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.

Verdict

Non-blocking from this pass: the changed lines look internally consistent, and the new skipped-vs-fatal behavior is covered by targeted tests.

Highlights
  • The handler still fails closed by refusing the cross-repo resolution, but now marks the legacy-mode mismatch as skipped so one bad thread ID does not sink the entire safe_outputs job.
  • The manager test covers the important accounting edge case: skipped thread-resolution results are excluded from fatal failures while still counting toward skipped item status.
  • I did not find a changed-line regression that clearly warrants blocking merge.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.81 AIC · ⌖ 5.44 AIC · ⊞ 4.5K
Comment /review to run again

@github-actions github-actions Bot mentioned this pull request Aug 16, 2026

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.

Pull request overview

Prevents unrelated review-thread IDs from failing the entire safe_outputs job while preserving repository access restrictions.

Changes:

  • Treats legacy-mode repository mismatches as skipped operations.
  • Hardens PR Sous Chef instructions against fabricated thread IDs.
  • Adds coverage for handler and failure-partitioning behavior.
Show a summary per file
File Description
actions/setup/js/resolve_pr_review_thread.cjs Skips disallowed legacy-mode thread IDs.
actions/setup/js/resolve_pr_review_thread.test.cjs Tests the new skip behavior.
actions/setup/js/safe_output_handler_manager.test.cjs Verifies skipped results remain non-fatal.
.github/workflows/pr-sous-chef.md Requires verbatim thread IDs.
.github/workflows/pr-sous-chef.lock.yml Updates the compiled workflow metadata hash.

Review details

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

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — the fix is targeted, well-reasoned, and backed by good tests. Approving with one minor observation.

📋 Key Themes & Highlights

Key Themes

  • Root cause vs. symptom: The fix correctly identifies that a legacy-mode repo mismatch almost always means a hallucinated/stale ID, not a genuine cross-repo access attempt. Downgrading to skipped rather than fatal is the right call.
  • Fail-closed preserved: Explicit cross-repo misconfigurations (via target/allowed-repos) still fail fatally — the safety boundary is maintained.
  • Test coverage: Both unit files are updated: the handler test asserts skipped: true, and the manager test confirms skipped results flow into itemsSkipped rather than fatalFailures.

Positive Highlights

  • isFailedProcessingResult already gates on classifySafeOutputResult === "failed", so skipped: true results are automatically excluded from fatalFailures without a special-case in partitionFailureResults.
  • ✅ Prompt hardening instruction is precise and actionable.
  • ✅ Test names read as specifications.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 29.4 AIC · ⌖ 8.36 AIC · ⊞ 7.7K
Comment /matt to run again

@github-actions github-actions Bot 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.

The fix is correct and well-tested.

The skipped: true flag on the legacy cross-repo result correctly routes through classifySafeOutputResult"skipped" → excluded from partitionFailureResults fatal failures. Tests cover both the handler-level and manager-level behavior. The companion workflow instruction to copy thread IDs verbatim is a sensible preventive addition.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 25.6 AIC · ⌖ 7.94 AIC · ⊞ 5.6K

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR #53124 looks ready for a final pass.

Quick triage

  • Recent checks visible on the current head SHA look green.
  • I didn't find an active sous-chef cooldown comment on this PR.
  • Please run the pr-finisher skill to do the final merge-readiness sweep and address anything it surfaces.

Next step

  • If the PR is truly ready, finish the branch and move it toward merge.

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

Copilot AI requested a review from gh-aw-bot August 16, 2026 13:55
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR #53124 looks ready for a final pass.

Quick triage

  • Recent checks visible on the current head SHA look green.
  • I did not find an active sous-chef cooldown comment on this PR.
  • Please run the pr-finisher skill to do the final merge-readiness sweep and address anything it surfaces.

Next step

  • If the PR is truly ready, finish the branch and move it toward merge.

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

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

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR #53124 looks ready for a final pass.

Quick triage

  • Recent checks visible on the current head SHA look green.
  • I did not find an active sous-chef cooldown comment on this PR.
  • Please run the pr-finisher skill to do the final merge-readiness sweep and address anything it surfaces.

Next step

  • If the PR is truly ready, finish the branch and move it toward merge.

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

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

@pelikhan
pelikhan merged commit 5b1ffe4 into main Aug 16, 2026
2 checks passed
@pelikhan
pelikhan deleted the copilot/fix-failed-jobs-pr-sous-chef branch August 16, 2026 16:29
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

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.

[aw] Failed jobs: PR Sous Chef

4 participants