Skip to content

Fix issue triage: title prefix, prior-run context, PR analysis, and update/create race condition#23

Merged
jeffhandley merged 5 commits intomainfrom
copilot/fix-issue-triage-race-condition
Apr 5, 2026
Merged

Fix issue triage: title prefix, prior-run context, PR analysis, and update/create race condition#23
jeffhandley merged 5 commits intomainfrom
copilot/fix-issue-triage-race-condition

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 5, 2026

The most recent triage run stripped the [C# SDK Issue Triage] prefix from the issue title. Root cause: update-issue safe-output uses title-prefix only for matching (not auto-prepending), unlike create-issue which does auto-prepend. The compiled workflow confirms this asymmetry:

create_issue: "Title will be prefixed with \"[C# SDK Issue Triage] \""
update_issue: "The target issue title must start with \"[C# SDK Issue Triage] \""

Changes

Title prefix fix (.github/workflows/issue-triage.md)

  • create-issue: pass yyyy-MM-dd (N to triage) — prefix auto-prepended
  • update-issue: pass [C# SDK Issue Triage] yyyy-MM-dd (N to triage) — no auto-prepend
  • Added a prominent ⚠️ Critical warning box explaining the asymmetry and a new constraint bullet to reinforce correct usage

Prior-run context (.github/skills/issue-triage/SKILL.md, .github/workflows/issue-triage.md)

  • Step 2 now reads open and closed triage report issues created or updated within the last 4 weeks (not just the current open one) for trend analysis across the window
  • The workflow repository is explicitly noted as potentially being a fork, side repo, or modelcontextprotocol/csharp-sdk itself
  • Workflow's publishing rules also instruct the agent to fetch this context

Exclude automation issues (.github/skills/issue-triage/SKILL.md, .github/workflows/issue-triage.md)

  • Step 3 excludes any issue labeled automation from the triage data set — these are workflow-generated issues (triage reports, tier audits) and are not part of the SDK issue backlog
  • Added as a constraint in the workflow definition

PR analysis (.github/skills/issue-triage/SKILL.md)

  • Added Step 4 (Fetch Recent Pull Requests) to examine open and recently merged/updated PRs from modelcontextprotocol/csharp-sdk (always the upstream repo)
  • Step 7.1 cross-references issues with PR data to identify issues potentially resolved by merged PRs, and adds a "Close — resolved by PR" next-step recommendation

Race condition handling (.github/workflows/issue-triage.md)

  • Publishing now uses try/fallback: attempt update-issue on the existing open issue first; if it fails (e.g., issue closed mid-run), fall back to create-issue

Report format (.github/skills/issue-triage/references/report-format.md)

  • Changed the BLUF section from a paragraph to structured bullet points (open issues, SLA compliance, urgent attention count, top finding, trend)

Housekeeping

  • Renumbered steps 1→10 and sub-steps (6a–6e, 7.0, 7.1) after inserting new Steps 2 and 4
  • Updated all internal cross-references

No lock file recompilation needed — issue-triage.lock.yml uses {{#runtime-import}} to load the .md at runtime.

…race condition

1. Fix title prefix for update-issue: The update-issue safe-output does not
   auto-prepend the title-prefix (unlike create-issue). Updated instructions
   so the agent includes the full prefix when calling update-issue.

2. Incorporate existing triage issue content: Added Step 2 to the skill to
   read the existing triage report issue's body and comments, using that
   as prior-run context for trend analysis and maintainer guidance.

3. Handle race condition: Publishing rules now try update-issue first and
   fall back to create-issue if the target issue was closed during the run.

Agent-Logs-Url: https://github.com/jeffhandley/modelcontextprotocol-csharp-sdk/sessions/1daf4f66-3f2d-48f4-8f4a-b176e02305ad

Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue triage race condition handling Fix issue triage: title prefix, prior-run context, and update/create race condition Apr 5, 2026
Copilot AI requested a review from jeffhandley April 5, 2026 19:42
@jeffhandley
Copy link
Copy Markdown
Owner

@copilot the trend analysis is good. Expand the reading of triage report issues to read triage reports created (opened and closed) going back 4 weeks. And make sure the triage report issues themselves are excluded from the actual issue triage data, expanding that to all issues labeled automation.

The logic for reading the issue triage reports need to understand those are to be read from the workflow repository (that could be a fork or side repo), or it could be the modelcontextprotocol/csharp-sdk repo itself.

Ensure the triage assessment looks at open and closed pull requests in modelcontextprotocol/csharp-sdk (always that upstream repo) to identify issues potentially resolved by pull requests. It might already do that; I don't recall.

Be really darned sure the triage issue title doesn't lose its prefix when edited.

Copilot AI and others added 2 commits April 5, 2026 20:02
…dd PR analysis, reinforce title prefix

1. Read open AND closed triage report issues from the last 4 weeks (not just
   the current open one) for trend analysis across the window.

2. Clarify that triage reports live in the workflow repository (which may be
   a fork/side repo or modelcontextprotocol/csharp-sdk itself).

3. Exclude issues labeled `automation` from the triage data set — these are
   workflow-generated issues and are not part of the SDK issue backlog.

4. Add Step 4 (Fetch Recent Pull Requests) to examine open and recently
   closed/merged PRs in modelcontextprotocol/csharp-sdk. Cross-reference
   with issues during deep-dive review to identify issues potentially
   resolved by merged PRs.

5. Add prominent warning box about the create-issue vs update-issue title
   prefix asymmetry and add title prefix constraint to the Constraints
   section.

Agent-Logs-Url: https://github.com/jeffhandley/modelcontextprotocol-csharp-sdk/sessions/c6b2b7a4-4a43-47f3-b319-8f69e1e8e907

Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Apr 5, 2026

@copilot the trend analysis is good. Expand the reading of triage report issues to read triage reports created (opened and closed) going back 4 weeks. And make sure the triage report issues themselves...

Addressed in 71dff77 and 30e4585:

  1. 4-week triage report history: Step 2 now reads open AND closed triage report issues created or updated within the last 4 weeks (both in the skill and workflow definition).
  2. Exclude automation issues: Step 3 explicitly excludes any issue labeled automation from the triage data set, and this is also added as a constraint in the workflow.
  3. Workflow repo clarity: Both the skill (Step 2) and workflow publishing rules now explicitly state the workflow repository "may be a fork or side repo, or it may be modelcontextprotocol/csharp-sdk itself."
  4. PR analysis: Added Step 4 (Fetch Recent Pull Requests) — fetches open and recently merged/updated PRs from modelcontextprotocol/csharp-sdk. Step 7.1 cross-references issues with PR data, and adds a "Close — resolved by PR" next-step recommendation.
  5. Title prefix reinforcement: Added a prominent ⚠️ Critical warning box explaining the create-issue vs update-issue asymmetry, plus a new constraint bullet: "Always include the [C# SDK Issue Triage] prefix when calling update-issue."

Copilot AI changed the title Fix issue triage: title prefix, prior-run context, and update/create race condition Fix issue triage: title prefix, prior-run context, PR analysis, and update/create race condition Apr 5, 2026
@jeffhandley
Copy link
Copy Markdown
Owner

@copilot make the BLUF content bullets instead of a paragraph

Copy link
Copy Markdown
Author

Copilot AI commented Apr 5, 2026

@copilot make the BLUF content bullets instead of a paragraph

Done in 2a65b04. The BLUF section template now uses structured bullets: open issues, SLA compliance, urgent attention count, top finding, and trend vs. last report.


### Step 4: Fetch Recent Pull Requests

Fetch open **and** recently closed/merged pull requests from `modelcontextprotocol/csharp-sdk` (always the upstream repo). Include PRs that were merged or updated within the last 4 weeks. For each PR, capture:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

For the PRs, we also need semantic analysis of the PR to identify potential issue resolutions that were not linked on the PR but it seems like a match to an open issue.

- **SLA compliance:** {compliant | N violations} — {brief status}
- **Urgent attention:** {N} issues need immediate action
- **Top finding:** {single most important takeaway}
- **Trend:** {compared to last report: improving / stable / declining}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Compared to each of the last 4 weeks, plus the previous report.

@jeffhandley
Copy link
Copy Markdown
Owner

@copilot Address the feedback

@jeffhandley jeffhandley marked this pull request as ready for review April 5, 2026 20:28
Copy link
Copy Markdown
Owner

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

@copilot there is outstanding feedback to address

Copilot stopped work on behalf of jeffhandley due to an error April 5, 2026 21:12
@jeffhandley jeffhandley merged commit 9007907 into main Apr 5, 2026
1 of 2 checks passed
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.

2 participants