Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions .github/workflows/issue-processing-ai-triage-nonblazor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
issues: write
contents: read
pull-requests: read

steps:
# =========================================================================
# STEP 1: POST WELCOME MESSAGE
Expand Down Expand Up @@ -73,14 +74,47 @@ jobs:
# - Post the analysis as a comment on the issue
# =========================================================================
- name: Run Copilot Issue Triage
uses: github/copilot-action@v1
uses: actions/github-script@v7
with:
agent: .github/agents/issue-triage-nonblazor.agent.md
prompt: |
Analyze issue #${{ github.event.issue.number }} and post your triage report as a comment on the issue.
Issue URL: ${{ github.event.issue.html_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');

// Load the existing Copilot agent instructions
const agentInstructions = fs.readFileSync('.github/agents/issue-triage-nonblazor.agent.md', 'utf8');

const issue = context.payload.issue;

// Combine instructions and issue details into one string
const promptLines = [
agentInstructions,
'',
`Analyze issue #${issue.number} and post your triage report as a comment on the issue.`,
`Issue URL: ${issue.html_url}`,
'',
'Title:',
issue.title,
'',
'Body:',
issue.body
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The issue body might be null or undefined in certain edge cases. While GitHub typically provides an issue body, it's possible for issues to be created with empty bodies. Consider adding a check or default value to handle cases where 'issue.body' might be null or undefined to prevent the workflow from failing unexpectedly.

Copilot uses AI. Check for mistakes.
];

const prompt = promptLines.join('\n');

// Invoke GitHub Models
const response = await github.rest.models.runInference({
Comment on lines +103 to +104
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The GitHub REST API does not have a github.rest.models.runInference() method. GitHub Models is accessed through a different API endpoint. The correct approach would be to use the Octokit REST API client with the proper endpoint for GitHub Models, or use a direct HTTP request to the GitHub Models API.

You'll need to verify the correct API endpoint and request format for GitHub Models. As of my knowledge, GitHub Models may require using a different authentication approach and API structure.

Suggested change
// Invoke GitHub Models
const response = await github.rest.models.runInference({
// Invoke GitHub Models via the generic Octokit request API
const response = await github.request('POST /models/{model}/inference', {

Copilot uses AI. Check for mistakes.
model: 'gpt-4.1-mini',
input: prompt
});

const report = response.data.output_text;

await github.rest.issues.createComment({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
});
Comment on lines +79 to +129
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

There is no error handling for the AI inference API call or the file read operation. If the GitHub Models API call fails, the file doesn't exist, or the response is malformed, the workflow will fail without providing helpful error messages. Consider wrapping these operations in try-catch blocks to handle failures gracefully and provide informative error messages.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback


# =========================================================================
# STEP 4: ADD TRIAGE LABEL
# Apply the "ai-triage-action-plan" label to indicate this issue has been
Expand Down