Skip to content

Fix/integration template versions - #968

Merged
stranske merged 7 commits into
mainfrom
fix/integration-template-versions
Jan 19, 2026
Merged

Fix/integration template versions#968
stranske merged 7 commits into
mainfrom
fix/integration-template-versions

Conversation

@stranske

Copy link
Copy Markdown
Owner

No description provided.

Updates the integration-repo template autofix-versions.env to match the
canonical version in .github/workflows/autofix-versions.env.

Fixes drift detected by health-67-integration-sync-check.yml
Addresses issue #943
Problem:
- Issue #1170 on consumer repo showed auto-pilot repeatedly dispatching
  the Codex belt worker without making progress, wasting resources
- Worker dispatch failures were reported silently with generic messages
- PR creation didn't add clickable links back to the issue
- Consumer template had pre-existing line length violations

Solution:
1. Add stall detection with MAX_STALL_RETRIES=3:
   - Count consecutive 'waiting for commits' comments
   - Pause auto-pilot and add needs-human label after 3 failed attempts
   - Show clear stall count in progress messages (e.g., '1/3')

2. Improve worker dispatch error reporting:
   - Show HTTP status code when available
   - Provide specific troubleshooting steps
   - Link to workflow runs for investigation

3. Add PR/branch links to issue comments:
   - Include full clickable URLs for PR and branch
   - Show links section for easy navigation

4. Fix all line length violations (>100 chars):
   - Break long JavaScript string literals into arrays
   - Use shell line continuations for long python commands
   - Extract conditions into variables for readability

5. Add code quality principles to CLAUDE.md:
   - Emphatic instruction to fix ALL issues, not work around them
   - Pre-existing issues are not an excuse

Applied to both:
- .github/workflows/agents-auto-pilot.yml (Workflows repo)
- templates/consumer-repo/.github/workflows/agents-auto-pilot.yml
- Change MAX_STALL_RETRIES from 3 to 5 in both workflows
- Sync the repoMatch check to main workflow (was only in consumer template)
  This ensures we don't match PRs from other repositories

Note: The consumer template legitimately differs from main workflow in script
paths - it uses $WORKFLOWS_SCRIPTS_PATH because it checks out scripts from
the Workflows repo, while main workflow uses local paths.
1. Add exponential backoff for stall retries:
   - Retry 1: 2 min wait
   - Retry 2: 4 min wait
   - Retry 3: 8 min wait
   - Retry 4: 16 min wait (capped)
   - Retry 5: 16 min wait (capped)
   - Posts backoff notice comment before waiting

2. Add missing concurrency block to consumer template:
   - Prevents race conditions when multiple auto-pilot runs target same issue
   - Groups by repository + issue number
   - Does not cancel in-progress runs

The consumer template now has functional parity with the main workflow.
The only remaining differences are script paths:
- Main uses 'scripts/...' (local)
- Consumer uses '$WORKFLOWS_SCRIPTS_PATH/scripts/...' (checked out from Workflows)
- Increase per_page from 20 to 100 for countConsecutiveStalls()
  (Copilot suggestion: ensures accurate stall counting on active issues)
- Use GITHUB_SERVER_URL instead of hardcoded github.com for PR links
  (Codex P2 suggestion: enables GHES/AE compatibility)
Adds explicit behavioral triggers to prevent Claude from:
- Reporting failures as 'needs separate attention'
- Categorizing issues as 'pre-existing' to avoid fixing them
- Moving on without fixing encountered problems

Also adds a mandatory checklist to run before declaring any task complete.
Copilot AI review requested due to automatic review settings January 19, 2026 23:33
@agents-workflows-bot

Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #968. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions

Copy link
Copy Markdown
Contributor

Gate fast-pass: docs-only change detected; heavy checks skipped.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: eb2da2a
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #968 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/0 complete
Timeout 45 min (default)
Timeout usage 1m elapsed (2%, 44m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
per_page: 100

P2 Badge Fetch newest issue comments when counting stalls

The new countConsecutiveStalls() logic reads only the first page of 100 comments with the default sort/direction, which GitHub returns oldest-first unless you explicitly request direction: desc. On issues with >100 comments (or just recent comments beyond page 1), this reverses an old page and can miss the newest “Branch ready” messages, so the stall count is wrong and backoff/pause may never trigger (or may trigger based on stale history). Consider requesting the newest comments (direction: 'desc') and/or paginating to the last page before scanning so the count reflects the latest auto‑pilot messages.

ℹ️ 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".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds new documentation sections to CLAUDE.md about failure handling and end-of-task checklists. Despite the title "Fix/integration template versions", no integration template version files are modified - the changes are purely documentation additions.

Changes:

  • Added "FAILURE TRIGGERS" section with guidelines for handling CI failures, lint errors, and test failures
  • Added "END-OF-TASK CHECKLIST" section with pre-completion verification steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CLAUDE.md
@stranske
stranske merged commit 8fcdfe6 into main Jan 19, 2026
29 of 30 checks passed
@stranske
stranske deleted the fix/integration-template-versions branch January 19, 2026 23:37
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