You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the last 24 hours, 84 workflow runs were analyzed, resulting in 44 safe output job executions. The overall health of safe output jobs is excellent with a 93% success rate. Only 3 failures were identified, clustered into 2 distinct error patterns.
gh: Resource not accessible by personal access token (HTTP 403)
{"message":"Resource not accessible by personal access token",
"documentation_url":"https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request",
"status":"403"}
Root Cause: The GitHub token used by create_pull_request safe output jobs lacks permissions to request reviewers via the API endpoint /repos/githubnext/gh-aw/pulls/$PR_NUMBER/requested_reviewers. The PR is successfully created, but the subsequent step to add copilot-pull-request-reviewer[bot] as a reviewer fails with HTTP 403.
Impact:
Pull requests are created successfully
Automated reviewer assignment fails
Requires manual reviewer assignment
Job marked as failed even though PR creation succeeded
Technical Details:
gh api --method POST /repos/githubnext/gh-aw/pulls/$PR_NUMBER/requested_reviewers \
-f 'reviewers[]=copilot-pull-request-reviewer[bot]'
This command fails because the GITHUB_TOKEN lacks the necessary scope or the requesting reviewers API endpoint requires additional permissions beyond pull_requests: write.
##[error]Unable to download artifact(s): Artifact not found for name: aw.patch
Please ensure that your artifact is not expired and the artifact was uploaded
using a compatible version of toolkit/upload-artifact.
Root Cause: The push_to_pull_request_branch job depends on an aw.patch artifact that should be uploaded by the agent job. The artifact is either:
Not being uploaded by the agent job
Uploaded with a different name
Failed to upload due to an error in the agent job
Expired before the safe output job executes (unlikely within same workflow)
This suggests the agent job should upload an artifact named aw.patch containing the git patch to be applied.
Root Cause Analysis
Permission-Related Issues
The create_pull_request job failures are permission issues related to the GitHub API. The GITHUB_TOKEN used in the workflow has sufficient permissions to create pull requests but lacks the ability to request reviewers. According to GitHub's API documentation, requesting reviewers requires either:
Problem: Job fails after successfully creating PR when reviewer assignment fails
Fix: Make reviewer assignment optional with graceful error handling
Proposed Code Change:
# Current (fails hard)
gh api --method POST /repos/.../requested_reviewers ...
# Proposed (graceful fallback)if! gh api --method POST /repos/.../requested_reviewers ... 2>/dev/null;thenecho"⚠️ Unable to assign reviewer (permissions required). PR created successfully."echo"Please manually assign reviewers if needed."fi
Affected Jobs: create_pull_request
Configuration Changes
3. Update GITHUB_TOKEN Permissions for Reviewer Requests
Priority: 🟡 Medium
Current: GITHUB_TOKEN has pull_requests: write but cannot request reviewers
Recommended:
If using GitHub App: Add pull_requests: write permission for "Request reviewers"
If using PAT: Ensure token has repo or public_repo scope
If using GITHUB_TOKEN: May need to switch to GitHub App or PAT with elevated permissions
Reason: GitHub's API for requesting reviewers requires additional permissions beyond basic PR creation
Description: The push_to_pull_request_branch safe output job fails because it cannot find the required aw.patch artifact. Investigation is needed to determine why the artifact is not being uploaded by the agent job.
Acceptance Criteria:
Agent job successfully uploads aw.patch artifact in all scenarios
push_to_pull_request_branch job can consistently download the artifact
Add validation/logging to confirm artifact upload success
Add error handling for missing artifacts with clear error messages
Test with at least 3 successful runs of push_to_pull_request_branch
Technical Approach:
Review agent job workflow definition to locate artifact upload step
Check if artifact upload is conditional and why condition might not be met
Verify artifact naming matches exactly between upload and download
Add explicit artifact upload step if missing
Add workflow logging to confirm artifact creation and upload
Test with sample workflow run that triggers push_to_pull_request_branch
Investigation Steps:
# Find where aw.patch should be created
grep -r "aw.patch" .github/workflows/
# Check agent job artifact upload configuration# Look for actions/upload-artifact usage in agent jobs# Verify artifact upload logic in safe output framework
grep -r "upload-artifact" pkg/workflow/
Estimated Effort: Medium (4-8 hours)
2 hours: Investigation and root cause identification
2 hours: Implementation of fix
2-4 hours: Testing and validation
Dependencies: None
Work Item 2: Make Reviewer Assignment Optional in create_pull_request
Type: 🔧 Enhancement
Priority: 🟡 Medium
Description: The create_pull_request job fails after successfully creating a PR when it attempts to assign reviewers but lacks permissions. The job should succeed even if reviewer assignment fails, since the primary goal (PR creation) was achieved.
Acceptance Criteria:
PR creation succeeds even if reviewer assignment fails
Clear warning message when reviewer assignment fails due to permissions
Job marked as successful when PR is created (regardless of reviewer assignment)
Optionally add note to PR body when automatic reviewer assignment fails
Backward compatible with existing workflows
Technical Approach:
Locate reviewer assignment code in create_pull_request safe output job
Wrap reviewer assignment in conditional/error handling
Log warning instead of failing when reviewer assignment fails
Optionally add comment to PR explaining manual reviewer assignment needed
Update job status logic to consider PR creation as primary success criterion
# Add error handling for reviewer requestset +e # Don't exit on error for reviewer assignment
gh api --method POST /repos/githubnext/gh-aw/pulls/$PR_NUMBER/requested_reviewers \
-f 'reviewers[]=copilot-pull-request-reviewer[bot]'2>&1| tee /tmp/reviewer_result.txt
REVIEWER_EXIT=$?set -e
if [ $REVIEWER_EXIT-ne 0 ];thenecho"⚠️ Warning: Unable to assign automatic reviewers (requires additional permissions)"echo"PR #$PR_NUMBER created successfully but reviewer assignment failed"echo"Please manually assign reviewers as needed"# Optionally add comment to PR
gh pr comment $PR_NUMBER --body "⚠️ Automated reviewer assignment failed due to permission constraints. Please manually assign reviewers."elseecho"✅ Reviewers assigned successfully"fi
Estimated Effort: Small (2-4 hours)
1 hour: Code changes
1 hour: Testing
1-2 hours: Documentation and review
Dependencies: None
Work Item 3: Document Token Permission Requirements
Type: 📚 Documentation
Priority: 🟢 Low
Description: Create clear documentation explaining the token permissions required for each safe output job type, especially for operations that require elevated permissions like requesting reviewers.
Acceptance Criteria:
Document all safe output job types and their permission requirements
Add troubleshooting section for common permission errors
Include examples of token configuration for different scenarios (PAT, GitHub App, GITHUB_TOKEN)
Add permission requirement checks to safe output job validation
Link to GitHub's official permission documentation
Technical Approach:
Audit all safe output job types and their API calls
Document minimum required permissions for each API endpoint
Create troubleshooting guide for 403 errors
Add permission validation to safe output job framework
Update README and developer documentation
Content to Include:
Permission matrix: job type → required scopes
How to configure GitHub Apps vs PATs
Common permission errors and solutions
Testing permission configurations
Security best practices
Estimated Effort: Small (2-4 hours)
Dependencies: Work Item 2 (to document recommended approach)
Historical Context
First Audit: This is the inaugural Safe Output Health Report. No historical data is available for trend analysis. Future audits will compare against this baseline.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
🏥 Safe Output Health Report - November 21, 2025
Executive Summary
Over the last 24 hours, 84 workflow runs were analyzed, resulting in 44 safe output job executions. The overall health of safe output jobs is excellent with a 93% success rate. Only 3 failures were identified, clustered into 2 distinct error patterns.
Safe Output Job Statistics
Error Clusters
Cluster 1: Permission Error - Unable to Request Reviewer Bot
create_pull_requestRoot Cause: The GitHub token used by
create_pull_requestsafe output jobs lacks permissions to request reviewers via the API endpoint/repos/githubnext/gh-aw/pulls/$PR_NUMBER/requested_reviewers. The PR is successfully created, but the subsequent step to addcopilot-pull-request-reviewer[bot]as a reviewer fails with HTTP 403.Impact:
Technical Details:
This command fails because the GITHUB_TOKEN lacks the necessary scope or the requesting reviewers API endpoint requires additional permissions beyond
pull_requests: write.Cluster 2: Artifact Not Found - aw.patch Missing
push_to_pull_request_branchRoot Cause: The
push_to_pull_request_branchjob depends on anaw.patchartifact that should be uploaded by the agent job. The artifact is either:Impact:
Technical Details:
The job uses:
This suggests the agent job should upload an artifact named
aw.patchcontaining the git patch to be applied.Root Cause Analysis
Permission-Related Issues
The
create_pull_requestjob failures are permission issues related to the GitHub API. The GITHUB_TOKEN used in the workflow has sufficient permissions to create pull requests but lacks the ability to request reviewers. According to GitHub's API documentation, requesting reviewers requires either:Data/Artifact Issues
The
push_to_pull_request_branchfailure is a dependency chain issue. The job assumes an artifact exists but cannot find it, indicating:Recommendations
Critical Issues (Immediate Action Required)
1. Fix Artifact Upload for push_to_pull_request_branch
push_to_pull_request_branchjobsBug Fixes Required
2. Handle Reviewer Request Permission Gracefully
create_pull_requestsafe output job implementationcreate_pull_requestConfiguration Changes
3. Update GITHUB_TOKEN Permissions for Reviewer Requests
pull_requests: writebut cannot request reviewerspull_requests: writepermission for "Request reviewers"repoorpublic_reposcopeWork Item Plans
Work Item 1: Fix Missing aw.patch Artifact Upload
push_to_pull_request_branchsafe output job fails because it cannot find the requiredaw.patchartifact. Investigation is needed to determine why the artifact is not being uploaded by the agent job.Acceptance Criteria:
aw.patchartifact in all scenariospush_to_pull_request_branchjob can consistently download the artifactpush_to_pull_request_branchTechnical Approach:
push_to_pull_request_branchInvestigation Steps:
Estimated Effort: Medium (4-8 hours)
Dependencies: None
Work Item 2: Make Reviewer Assignment Optional in create_pull_request
create_pull_requestjob fails after successfully creating a PR when it attempts to assign reviewers but lacks permissions. The job should succeed even if reviewer assignment fails, since the primary goal (PR creation) was achieved.Acceptance Criteria:
Technical Approach:
create_pull_requestsafe output jobFiles to Modify:
pkg/safeoutputs/create_pull_request.go(or equivalent)create_pull_requestjobcreate_pull_requestProposed Implementation:
Estimated Effort: Small (2-4 hours)
Dependencies: None
Work Item 3: Document Token Permission Requirements
Acceptance Criteria:
Technical Approach:
Content to Include:
Estimated Effort: Small (2-4 hours)
Dependencies: Work Item 2 (to document recommended approach)
Historical Context
First Audit: This is the inaugural Safe Output Health Report. No historical data is available for trend analysis. Future audits will compare against this baseline.
Trends
add_comment,create_discussion,create_issue,missing_tool(100% success rate)create_pull_request,push_to_pull_request_branch(67% success rate)Metrics and KPIs
add_comment,create_discussion,create_issue,missing_tool(100%)create_pull_request,push_to_pull_request_branch(67%)Next Steps
References:
Beta Was this translation helpful? Give feedback.
All reactions