Conversation
Automated sync from stranske/Workflows Template hash: aa87958cbd5c Changes synced from sync-manifest.yml
|
Health 45 Agents Guard stopped this pull request. What we found
Next steps
Files seen in this run
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81761ede30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const workflowFile = 'agents-81-gate-followups.yml'; | ||
| // Reduce attempts for auto-escalated PRs (they weren't agent-initiated) | ||
| const isEscalated = labels.includes('autofix:escalated'); | ||
| const maxAttempts = isEscalated |
There was a problem hiding this comment.
Count only autofix runs when enforcing retry limit
Switching workflowFile to agents-81-gate-followups.yml makes previousRuns include every completed run of the consolidated workflow for the same head_sha, not just autofix attempts. In this file, keepalive/manual followup runs can complete on the same commit and inflate attemptCount, which can trip attemptCount > maxAttempts and skip autofix before it actually gets its intended number of retries.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Syncs this consumer repository’s automation workflows/docs to the latest consolidated templates from stranske/Workflows, including removing deprecated standalone workflows and updating references to the new “event hub” + “gate followups” entrypoints.
Changes:
- Updated docs to reference consolidated workflows (
agents-80-pr-event-hub.yml,agents-81-gate-followups.yml) instead of deprecated templates. - Removed deprecated workflow templates (verify-to-issue v1/v2, PR meta, keepalive loop, autofix loop, bot comment handler).
- Updated consolidated workflow wiring (auto-pilot dispatch targets; autofix dispatcher messaging; gate followups attempt tracking).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/LABELS.md | Updates workflow references for label-triggered automation. |
| docs/CODEX_TOKEN_REFRESH.md | Updates token-refresh verification command to use consolidated gate followups workflow. |
| WORKFLOW_USER_GUIDE.md | Updates troubleshooting guidance to point at the consolidated PR event hub workflow. |
| .github/workflows/agents-autofix-dispatcher.yml | Converts dispatcher into a no-op bridge message for consolidated handling. |
| .github/workflows/agents-auto-pilot.yml | Dispatches consolidated PR event hub + gate followups after PR creation. |
| .github/workflows/agents-81-gate-followups.yml | Updates internal autofix attempt tracking to reference the consolidated workflow file. |
| .github/scripts/keepalive_orchestrator_gate_runner.js | Adds keepalive self-healing + draft PR disposition logic. |
| .github/workflows/agents-pr-meta.yml | Removed (deprecated; replaced by consolidated PR event hub). |
| .github/workflows/agents-keepalive-loop.yml | Removed (deprecated; replaced by consolidated gate followups). |
| .github/workflows/agents-autofix-loop.yml | Removed (deprecated; replaced by consolidated gate followups). |
| .github/workflows/agents-bot-comment-handler.yml | Removed (deprecated; replaced by consolidated PR event hub). |
| .github/workflows/agents-verify-to-issue.yml | Removed (deprecated). |
| .github/workflows/agents-verify-to-issue-v2.yml | Removed (deprecated; replaced by consolidated PR event hub). |
Comments suppressed due to low confidence (1)
.github/workflows/agents-81-gate-followups.yml:897
previousRunsis computed by listing all completed runs ofagents-81-gate-followups.ymlfor the head SHA. Since this workflow can also run for PR label events / manual dispatch, those non-autofix runs will inflateattemptCountand can prematurely hit the autofix attempt limit. Filter the workflow runs to the relevant event type (Gateworkflow_run) and/or otherwise scope the query so only actual autofix-attempt runs are counted.
const workflowFile = 'agents-81-gate-followups.yml';
// Reduce attempts for auto-escalated PRs (they weren't agent-initiated)
const isEscalated = labels.includes('autofix:escalated');
const maxAttempts = isEscalated
? Math.min(2, Number(outputs.max_attempts))
: Number(outputs.max_attempts);
const previousRuns = await paginateWithRetry(github.rest.actions.listWorkflowRuns, {
owner,
repo,
workflow_id: workflowFile,
head_sha: run.head_sha,
per_page: 100,
status: 'completed',
});
| - name: Checkout workflow helpers | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| token: ${{ steps.app_token.outputs.token || github.token }} | ||
| sparse-checkout: | | ||
| .github/actions/setup-api-client | ||
| .github/scripts/github-api-with-retry.js | ||
| .github/scripts/github-rate-limited-wrapper.js | ||
| .github/scripts/token_load_balancer.js | ||
| sparse-checkout-cone-mode: false | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Setup API client | ||
| uses: ./.github/actions/setup-api-client | ||
| with: | ||
| secrets: ${{ toJSON(secrets) }} | ||
| github_token: ${{ steps.app_token.outputs.token || github.token }} | ||
|
|
||
| - name: Dispatch autofix workflow | ||
| - name: Acknowledge consolidated autofix handling | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 | ||
| with: | ||
| github-token: ${{ steps.app_token.outputs.token || github.token }} | ||
| script: | | ||
| const { createTokenAwareRetry } = require('./.github/scripts/github-api-with-retry.js'); | ||
| const { withRetry } = await createTokenAwareRetry({ | ||
| github, | ||
| core, | ||
| task: 'dispatch-autofix-loop', | ||
| }); | ||
|
|
||
| const payload = context.payload.client_payload || {}; | ||
| const prNumber = Number(payload.pr_number); | ||
| const gateRunId = String(payload.gate_run_id || ''); | ||
| const headSha = String(payload.head_sha || ''); | ||
| if (!Number.isFinite(prNumber) || prNumber <= 0) { | ||
| core.setFailed(`Invalid pr_number in payload: ${payload.pr_number}`); | ||
| return; | ||
| } | ||
| if (!gateRunId) { | ||
| core.setFailed('Missing gate_run_id in payload'); | ||
| return; | ||
| } | ||
| const owner = context.repo.owner; | ||
| const repo = context.repo.repo; | ||
| const defaultBranch = context.payload.repository?.default_branch || 'main'; | ||
| const ref = `refs/heads/${defaultBranch}`; | ||
| try { | ||
| await withRetry((client) => | ||
| client.request( | ||
| 'POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', | ||
| { | ||
| owner, | ||
| repo, | ||
| workflow_id: 'agents-autofix-loop.yml', | ||
| ref, | ||
| inputs: { | ||
| gate_run_id: gateRunId, | ||
| pr_number: String(prNumber), | ||
| head_sha: headSha, | ||
| }, | ||
| } | ||
| ) | ||
| ); | ||
| const shaNote = headSha ? `, headSha=${headSha}` : ''; | ||
| const trace = `gateRunId=${gateRunId}${shaNote}`; | ||
| core.info( | ||
| `Triggered agents-autofix-loop for PR #${prNumber} (${trace}).` | ||
| ); | ||
| } catch (error) { | ||
| core.setFailed(`Failed to dispatch autofix workflow: ${error.message}`); | ||
| } | ||
| const shaNote = headSha ? `, headSha=${headSha}` : ''; | ||
| const trace = `gateRunId=${gateRunId}${shaNote}`; | ||
| core.info( | ||
| `Autofix for PR #${prNumber} is handled by agents-81-gate-followups via Gate workflow_run (${trace}).` | ||
| ); |
| let draftRequiresHuman = false; | ||
| if (pr.draft) { | ||
| addReason('pr-draft'); | ||
| } else { | ||
| if (headSha) { | ||
| const checkboxCounts = countMarkdownCheckboxes(pr.body || ''); | ||
| summary | ||
| .addRaw( | ||
| `Pull request is draft; evaluating disposition (checked=${checkboxCounts.checked}, unchecked=${checkboxCounts.unchecked}).` | ||
| ) | ||
| .addEOL(); | ||
|
|
||
| const allChecklistWorkComplete = checkboxCounts.checked > 0 && checkboxCounts.unchecked === 0; | ||
| if (allChecklistWorkComplete) { | ||
| const ready = await markDraftReadyForReview({ github, pr, core, summary }); | ||
| if (ready) { | ||
| pr.draft = false; | ||
| } else { | ||
| draftRequiresHuman = true; | ||
| await routeDraftToHuman({ github, owner, repo, prNumber, currentLabels, checkboxCounts, core, summary }); | ||
| addReason('pr-draft-ready-failed'); | ||
| } | ||
| } else { | ||
| draftRequiresHuman = true; | ||
| await routeDraftToHuman({ github, owner, repo, prNumber, currentLabels, checkboxCounts, core, summary }); | ||
| addReason('pr-draft-needs-human'); |
|
Closing as stale because a newer sync workflow templates PR exists for this repository in the current cleanup campaign. |
Sync Summary
Files Updated
Files Skipped
Review Checklist
Source: stranske/Workflows
Source SHA:
a7734417f00b3989ec261d80c03d9cbf1439e5cdTemplate hash:
aa87958cbd5cSync branch:
sync/workflows-aa87958cbd5cConsumer repo:
stranske/Trend_Model_ProjectManifest:
.github/sync-manifest.yml