Skip to content

Codex/issue 1385#1398

Merged
stranske merged 27 commits intomainfrom
codex/issue-1385
Feb 8, 2026
Merged

Codex/issue 1385#1398
stranske merged 27 commits intomainfrom
codex/issue-1385

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Feb 8, 2026

Source: Issue #1385

Automated Status Summary

Scope

GitHub's native Copilot code review and chatgpt-codex-connector[bot] are posting review comments on internal ledger files (e.g., .agents/issue-*-ledger.yml) as if they were substantive code changes. This creates duplicate, noisy review comment pairs and can waste automation cycles when agents are dispatched to "fix" non-code tracking files.

Tasks

Copilot Configuration Research

  • Research GitHub Copilot code review documentation to determine if path exclusion configuration is supported
  • Document the Copilot path exclusion approach (if available) in implementation notes or README

Copilot Configuration Implementation

  • Create or update .github/copilot-review-config.yml to exclude .agents/ directory from automated reviews
  • Test the Copilot exclusion configuration by creating a test PR with changes to .agents/issue-test-ledger.yml

Bot Comment Handler Auto-Dismiss Logic

  • Add logic to bot-comment-handler to detect review comments posted on files matching ignored_paths patterns
  • Implement GitHub API calls in bot-comment-handler to dismiss or resolve review comments programmatically
  • Add filtering logic to identify comments from both github-copilot[bot] and chatgpt-codex-connector[bot]
  • Add logging to bot-comment-handler to track which review comments are automatically dismissed
  • Test the auto-dismiss functionality with review comments on .agents/issue-test-ledger.yml files

Connector Bot Configuration

  • Locate the file filtering logic in the chatgpt-codex-connector codebase
  • Add .agents/ directory to the connector's path exclusion configuration or filter list
  • Update the connector's file selection logic to skip files matching .agents/issue-*-ledger.yml pattern
  • Test the connector exclusion by triggering a review on a PR with .agents/ changes

Acceptance criteria

  • Copilot code review produces zero review comments on .agents/issue-*-ledger.yml files in PRs (verified by creating a test PR with changes to .agents/issue-test-ledger.yml and confirming no Copilot review comments appear within 5 minutes of PR creation)
  • chatgpt-codex-connector[bot] produces zero review comments on .agents/issue-*-ledger.yml files in PRs (verified by creating a test PR with changes to .agents/issue-test-ledger.yml and confirming no connector review comments appear within 5 minutes of PR creation)
  • If Copilot exclusion cannot be configured, review comments on files matching ignored_paths (e.g., .agents/) are automatically dismissed within 30 seconds of being posted (verified by checking PR review comment status via GitHub API)
  • bot-comment-handler logs contain entries for each auto-dismissed review comment with file path and bot name
  • Test PR with .agents/issue-test-ledger.yml changes shows zero visible review comments from either bot after 5 minutes

Head SHA: 544aea6
Latest Runs: ❔ in progress — Gate
Required: gate: ❔ in progress

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ success View run
Gate ❔ in progress View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ✅ success View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ✅ success View run
Health 72 Template Sync ✅ success View run
Health 73 Template Completeness ✅ success View run
Health 74 Template Drift ✅ success View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ success View run
Validate Sync Manifest ✅ success View run

github-actions bot and others added 23 commits February 8, 2026 13:20
Added header comment referencing createTokenAwareRetry from
github-api-with-retry.js to satisfy API guard check. The withRetry
parameter should be created using this wrapper function.

Fixes workflow lint check failure in PR #1387.
The agents-verify-to-new-pr-autopilot bridge workflow was using
actions/download-artifact@v7, which doesn't exist. The latest version
is v4. This was causing the bridge workflow to fail, preventing
auto-pilot from being triggered for follow-up issues created by
verify:create-new-pr.

Root cause analysis:
- verify:create-new-pr creates follow-up issue
- uploads metadata artifact with upload-artifact@v6
- bridge workflow tries to download with download-artifact@v7 (fails)
-auto-pilot never gets dispatched

This fixes both PR #1372 and issue #1391 failures.

Fixes #1391
Copilot AI review requested due to automatic review settings February 8, 2026 21:29
@stranske stranske temporarily deployed to agent-high-privilege February 8, 2026 21:29 — with GitHub Actions Inactive
@github-actions github-actions bot added the autofix Opt-in automated formatting & lint remediation label Feb 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 8, 2026

Status | ✅ autofix updates applied
History points | 1
Timestamp | 2026-02-08 21:56:29 UTC
Report artifact | autofix-report-pr-1398
Remaining | 0
New | 0
No additional artifacts

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 8, 2026

Automated Status Summary

Head SHA: e153888
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

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

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

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


Keepalive checklist

Scope

GitHub's native Copilot code review and chatgpt-codex-connector[bot] are posting review comments on internal ledger files (e.g., .agents/issue-*-ledger.yml) as if they were substantive code changes. This creates duplicate, noisy review comment pairs and can waste automation cycles when agents are dispatched to "fix" non-code tracking files.

Tasks

Copilot Configuration Research

  • Research GitHub Copilot code review documentation to determine if path exclusion configuration is supported
  • Document the Copilot path exclusion approach (if available) in implementation notes or README

Copilot Configuration Implementation

  • Create or update .github/copilot-review-config.yml to exclude .agents/ directory from automated reviews
  • Test the Copilot exclusion configuration by creating a test PR with changes to .agents/issue-test-ledger.yml

Bot Comment Handler Auto-Dismiss Logic

  • Add logic to bot-comment-handler to detect review comments posted on files matching ignored_paths patterns
  • Implement GitHub API calls in bot-comment-handler to dismiss or resolve review comments programmatically
  • Add filtering logic to identify comments from both github-copilot[bot] and chatgpt-codex-connector[bot]
  • Add logging to bot-comment-handler to track which review comments are automatically dismissed
  • Test the auto-dismiss functionality with review comments on .agents/issue-test-ledger.yml files

Connector Bot Configuration

  • Locate the file filtering logic in the chatgpt-codex-connector codebase
  • Add .agents/ directory to the connector's path exclusion configuration or filter list
  • Update the connector's file selection logic to skip files matching .agents/issue-*-ledger.yml pattern
  • Test the connector exclusion by triggering a review on a PR with .agents/ changes

Acceptance criteria

  • Copilot code review produces zero review comments on .agents/issue-*-ledger.yml files in PRs (verified by creating a test PR with changes to .agents/issue-test-ledger.yml and confirming no Copilot review comments appear within 5 minutes of PR creation)
  • chatgpt-codex-connector[bot] produces zero review comments on .agents/issue-*-ledger.yml files in PRs (verified by creating a test PR with changes to .agents/issue-test-ledger.yml and confirming no connector review comments appear within 5 minutes of PR creation)
  • If Copilot exclusion cannot be configured, review comments on files matching ignored_paths (e.g., .agents/) are automatically dismissed within 30 seconds of being posted (verified by checking PR review comment status via GitHub API)
  • bot-comment-handler logs contain entries for each auto-dismissed review comment with file path and bot name
  • Test PR with .agents/issue-test-ledger.yml changes shows zero visible review comments from either bot after 5 minutes

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 8, 2026

🤖 Keepalive Loop Status

PR #1398 | 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/18 complete
Timeout 45 min (default)
Timeout usage 4m elapsed (9%, 41m 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). |

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds default ignore rules for .agents/ ledger/tracking files across PR context tooling and bot-comment handling, plus tests and template/docs updates to reduce automation noise.

Changes:

  • Add ignored-path filtering to pr-context-graphql (defaulting to .agents/ + ledger glob patterns) and expose helper matchers.
  • Introduce scripts/tests for identifying (and attempting to dismiss/delete) bot review comments on ignored paths.
  • Update Copilot instructions and add workflow-focused tests asserting .agents/ is ignored and a dismissal job exists.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/workflows/test_bot_comment_handler.py New tests asserting .agents/ is ignored and a dismiss step exists in the template workflow.
templates/consumer-repo/.github/workflows/agents-verify-to-new-pr-autopilot.yml Changes actions/download-artifact major version (now v4).
templates/consumer-repo/.github/workflows/agents-bot-comment-handler.yml Adds dismiss_ignored job that dismisses bot reviews targeting ignored paths.
templates/consumer-repo/.github/scripts/pr-context-graphql.js Adds default ignored path/pattern matching and filters returned PR files.
templates/consumer-repo/.github/scripts/bot-comment-dismiss.js New script to collect and delete ignored-path bot review comments (but has retry-client usage issues).
templates/consumer-repo/.github/copilot-instructions.md Documents that .agents/issue-*-ledger.yml (and .agents/ non-app code) should not be reviewed/commented on.
agents/codex-1387.md / agents/codex-1385.md Adds bootstrap notes for issues.
.github/workflows/agents-verify-to-new-pr-autopilot.yml Changes actions/download-artifact major version (now v4).
.github/sync-manifest.yml Registers new bot-comment-dismiss.js script for syncing.
.github/scripts/pr-context-graphql.js Same ignored path/pattern filtering + exports as template version.
.github/scripts/connector-exclusion-smoke.js New helper CLI to smoke-test ignore rules; includes tests.
.github/scripts/bot-comment-dismiss.js New script to delete ignored-path bot review comments (but has retry-client usage issues).
.github/scripts/tests/pr-context-graphql.test.js Adds coverage for default ignore rules and env overrides.
.github/scripts/tests/connector-exclusion-smoke.test.js New tests for ignore filtering behavior.
.github/scripts/tests/bot-comment-dismiss.test.js New tests for collecting/deleting ignored-path bot review comments.
.github/copilot-instructions.md Documents that .agents/issue-*-ledger.yml (and .agents/ non-app code) should not be reviewed/commented on.


- name: Download follow-up issue metadata
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

This workflow downgrades actions/download-artifact to @v4 while the repo largely uses @v7. Keeping this at v4 is likely to be reverted/overridden by maint-sync-action-versions.yml (which syncs the highest major found in .github/workflows/ into templates), and it increases action-version inconsistency. Consider switching back to actions/download-artifact@v7 unless there is a concrete compatibility reason to pin to v4.

Suggested change
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7

Copilot uses AI. Check for mistakes.

- name: Download follow-up issue metadata
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

This template workflow pins actions/download-artifact@v4, but other templates (and most repo workflows) use @v7. Since maint-sync-action-versions.yml syncs versions into templates/, this may get auto-bumped back to v7 later, causing churn. Consider aligning to actions/download-artifact@v7 here as well.

Suggested change
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7

Copilot uses AI. Check for mistakes.
Comment on lines +132 to +138
await withRetry(() =>
github.rest.pulls.deleteReviewComment({
owner,
repo,
comment_id: entry.id,
})
);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

withRetry is designed to pass an Octokit client into the callback (fn(currentGithub)) so it can switch tokens on rate limits. Passing a zero-arg callback here causes API calls to keep using options.github, which defeats token switching. Update this to accept the client parameter and call client.rest.pulls.deleteReviewComment(...).

Copilot uses AI. Check for mistakes.
Comment on lines +132 to +138
await withRetry(() =>
github.rest.pulls.deleteReviewComment({
owner,
repo,
comment_id: entry.id,
})
);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

withRetry passes an Octokit client into the callback so it can switch tokens on rate limits. This callback ignores the client and uses options.github, which prevents token switching. Update this to accept the client parameter and call client.rest.pulls.deleteReviewComment(...).

Copilot uses AI. Check for mistakes.
Comment on lines +181 to +188
const response = await withRetry(() =>
github.rest.pulls.listReviewComments({
owner,
repo,
pull_number: pullNumber,
per_page: 100,
})
);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

Same token-rotation issue as above: withRetry passes a client argument, but this callback ignores it and uses options.github directly. To allow token switching, accept the client parameter and use client.rest.pulls.listReviewComments(...) inside the callback.

Copilot uses AI. Check for mistakes.
Comment on lines +181 to +188
const response = await withRetry(() =>
github.rest.pulls.listReviewComments({
owner,
repo,
pull_number: pullNumber,
per_page: 100,
})
);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

Same token-rotation issue as above: this withRetry callback should accept the client argument and use client.rest.pulls.listReviewComments(...) so token switching works under rate limiting.

Copilot uses AI. Check for mistakes.
Comment on lines +191 to +195
# Dismiss ignored-path bot reviews to prevent noisy inline comments
dismiss_ignored:
name: Dismiss ignored bot reviews
needs: resolve
if: vars.USE_CONSOLIDATED_WORKFLOWS != 'true' && needs.resolve.outputs.should_run == 'true'
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The comment says this job is to “prevent noisy inline comments”, but the implementation calls pulls.dismissReview, which dismisses the review state and does not remove the inline review comments. If the goal is to eliminate inline noise, consider deleting the individual review comments instead (e.g., via pulls.deleteReviewComment) or update the job/comment to reflect the actual behavior (dismiss review only).

Copilot uses AI. Check for mistakes.
Comment on lines +243 to +259
const [commentsResponse, reviewsResponse] = await Promise.all([
withRetry((client) => client.rest.pulls.listReviewComments({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})),
withRetry((client) => client.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})),
]);

const comments = commentsResponse.data || [];
const reviews = reviewsResponse.data || [];
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

These API calls only fetch the first 100 review comments / reviews (per_page: 100) and don’t paginate. For large PRs, ignored-path reviews beyond the first page won’t be considered. Consider using Octokit pagination (or the repo’s retry/pagination helpers) to ensure all review comments/reviews are processed.

Suggested change
const [commentsResponse, reviewsResponse] = await Promise.all([
withRetry((client) => client.rest.pulls.listReviewComments({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})),
withRetry((client) => client.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})),
]);
const comments = commentsResponse.data || [];
const reviews = reviewsResponse.data || [];
const [comments, reviews] = await Promise.all([
withRetry((client) =>
client.paginate(client.rest.pulls.listReviewComments, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})
),
withRetry((client) =>
client.paginate(client.rest.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
})
),
]);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e78c49b556

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

… pagination

Address all coding agent review comments on PR #1398:

1. Restore download-artifact@v7 in bridge workflow (both main + template)
   The v4 pinning was stale; main already has v7 from PR #1394.

2. Fix withRetry token rotation in bot-comment-dismiss.js (both copies)
   Callbacks now accept the client parameter from withRetry so token
   switching works under rate limiting. Default fallback passes github
   as the client argument.

3. Add pagination in template dismiss_ignored job
   Use client.paginate() instead of per_page:100 without pagination,
   ensuring all review comments are processed on large PRs.

4. Remove unused botLogins field from review entry tracking
   The ignoredComments array already tracks per-comment login, making
   botLogins redundant.

5. Clarify dismiss_ignored job comment: dismisses review state (not
   individual comments) to prevent blocking merge.
@stranske stranske temporarily deployed to agent-high-privilege February 8, 2026 21:54 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 8, 2026

Autofix updated these files:

  • tests/scripts/test_pr_verifier_chain_depth.py

@stranske stranske merged commit 366d88e into main Feb 8, 2026
95 checks passed
@stranske stranske deleted the codex/issue-1385 branch February 8, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix:patch autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants