[WIP] Fix mergeAt error by removing field filtering#2760
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Agentic Changeset Generator triggered by this pull request. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a workflow failure caused by requesting an unsupported field (mergedAt) from the gh search prs command. The fix removes the unsupported field from the JSON field list and updates documentation to explain how to obtain merge status through individual PR queries instead.
Key changes:
- Removed
mergedAtfrom the--jsonfield list in thegh search prscommand - Updated workflow documentation to clarify that
gh pr viewmust be used to determine merge status for individual PRs - Recompiled the workflow to generate the updated lock file
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/copilot-pr-prompt-analysis.md |
Removed unsupported mergedAt field from search command and added documentation notes about obtaining merge status via gh pr view |
.github/workflows/copilot-pr-prompt-analysis.lock.yml |
Recompiled workflow with the corrected command and updated documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Merged**: `mergedAt` is not null | ||
| - **Closed (not merged)**: `state` is "CLOSED" and `mergedAt` is null | ||
| - **Note**: The `gh search prs` command doesn't return `mergedAt` in its JSON output | ||
| - To determine merge status, you'll need to use `gh pr view <number> --json mergedAt` for each PR |
There was a problem hiding this comment.
[nitpick] The documentation instructs to check merge status for 'each PR', but this could be inefficient for large datasets (up to 1000 PRs). Consider adding a note about potential performance implications or suggesting batch processing strategies to avoid rate limiting.
| - To determine merge status, you'll need to use `gh pr view <number> --json mergedAt` for each PR | |
| - To determine merge status, you'll need to use `gh pr view <number> --json mergedAt` for each PR | |
| - ⚠️ **Performance Note**: For large datasets (hundreds or thousands of PRs), checking merge status for each PR individually can be inefficient and may lead to GitHub API rate limiting. Consider batching requests, using the GitHub REST API to fetch multiple PRs at once, or limiting the number of PRs processed in a single run. |
| 2. **Categorize the PR outcome**: | ||
| - **Merged**: `mergedAt` is not null | ||
| - **Closed (not merged)**: `state` is "CLOSED" and `mergedAt` is null | ||
| - **Note**: The `gh search prs` command doesn't return `mergedAt` in its JSON output |
There was a problem hiding this comment.
Corrected backtick usage: should use backticks around the command name for consistency with other code references in the document.
🔍 Smoke Test Investigation - Run #50SummarySmoke OpenCode workflow failed due to an Anthropic API error during agent execution. The OpenCode agent successfully initialized (installed plugins, configured MCP servers) but failed when attempting to make the initial API call to Anthropic, preventing any safe-outputs from being created. Failure Details
Root Cause AnalysisPrimary IssueThe Timeline of Events:
Model Requested: The error occurred after session creation but before any actual work could be done, resulting in 0 turns and 0 token usage. Cascading FailureBecause the agent job failed before creating any outputs, the downstream This is a consequence, not a root cause - the create_issue job expects the agent to produce outputs. Failed Jobs and ErrorsFailed: agent (36s)
Failed: create_issue (4s)
Succeeded Jobs
Investigation FindingsPattern AnalysisPattern ID:
Related Historical Failures:
This is a well-established recurring pattern affecting OpenCode workflows. Possible Root CausesBased on the error signature and pattern history:
Recommended Actions🔴 High Priority
🟡 Medium Priority
🟢 Low Priority
Prevention StrategiesImmediate Actions
Long-term Improvements
Historical ContextFrequency Analysis
Similar Past InvestigationsThis is part of an established pattern of OpenCode + Anthropic API failures. Previous investigations recommended:
These recommendations remain valid and should be prioritized. Related PR ContextPR #2760: "Fix mergeAt error by removing field filtering"
The timing is coincidental - smoke tests run on schedule regardless of recent merges. Investigation Metadata
|
✅ Fix mergedAt error in copilot-pr-prompt-analysis workflow
Problem
The workflow
.github/workflows/copilot-pr-prompt-analysis.mdwas usinggh search prswith the--jsonflag requesting themergedAtfield, but this field is not supported by thegh search prscommand, causing the workflow to fail.Root Cause
According to
gh search prs --help, the supported JSON fields are:The
mergedAtfield is NOT in this list. When the workflow tried to fetch PR data withmergedAtincluded in the--jsonparameter, the command would fail.Solution
✅ Removed
mergedAtfrom field filtering ingh search prscommandChanges Made
mergedAtfrom the--jsonfield list in thegh search prscommand in.github/workflows/copilot-pr-prompt-analysis.mdgh pr view <number> --json mergedAtmust be used to get merge status for individual PRsgh pr view <number> --json mergedAt,closedAtcan be used to get merge/close dates.github/workflows/copilot-pr-prompt-analysis.lock.ymlValidation
0 error(s), 0 warning(s)Files Modified
.github/workflows/copilot-pr-prompt-analysis.md- RemovedmergedAtfrom--jsonfield list and updated documentation.github/workflows/copilot-pr-prompt-analysis.lock.yml- Recompiled workflow with updated commandImpact
This fix allows the workflow to successfully fetch Copilot PR data without errors. The workflow can still determine merge status by using
gh pr viewcommands for individual PRs as documented in the updated instructions.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.