Skip to content

Handle keepalive pause and avoid auto relabel - #25

Merged
stranske merged 2 commits into
mainfrom
codex/keepalive-gate-runner
Dec 21, 2025
Merged

Handle keepalive pause and avoid auto relabel#25
stranske merged 2 commits into
mainfrom
codex/keepalive-gate-runner

Conversation

@stranske

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 21, 2025 00:21
@stranske

Copy link
Copy Markdown
Owner Author

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

@github-actions

github-actions Bot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: d52ff93
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

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 77.97%
Baseline 0.00%
Delta +77.97%
Minimum 70.00%
Status ✅ Pass

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

@stranske
stranske merged commit 8c6f2eb into main Dec 21, 2025
32 checks passed

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 support for pausing keepalive operations via an agents:pause label and removes automatic remediation behaviors (auto-labeling and auto-assignment) to give users more explicit control.

Key changes:

  • Introduces agents:pause label handling to halt keepalive operations
  • Removes auto-labeling logic that previously added missing keepalive labels automatically
  • Removes auto-assignment logic that attempted to assign human owners to PRs lacking assignees
  • Adds pre-gate check result handling to the orchestrator for better visibility

Reviewed changes

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

File Description
.github/scripts/keepalive_gate.js Adds PAUSE_LABEL constant and integrates pause label checking into the gate evaluation logic, returning hasPauseLabel status and setting ok=false with reason 'keepalive-paused' when detected
.github/scripts/keepalive_orchestrator_gate_runner.js Adds pre-gate result handling, implements pause label detection, removes auto-labeling for missing keepalive labels, removes auto-assignment for missing human assignees, and changes no-assignee behavior from attempting assignment to skipping keepalive

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

if (agentAlias) {
requiredLabels.push(`agent:${agentAlias}`);
}
const missingLabels = requiredLabels.filter((label) => !currentLabels.has(label));

Copilot AI Dec 21, 2025

Copy link

Choose a reason for hiding this comment

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

The variable missingLabels is computed but never used. Since the auto-labeling logic has been removed, this line should be deleted as well to avoid unnecessary computation and improve code clarity.

Suggested change
const missingLabels = requiredLabels.filter((label) => !currentLabels.has(label));

Copilot uses AI. Check for mistakes.
Comment on lines +197 to +201
if (currentLabels.has('agents:pause')) {
addReason('keepalive-paused');
summary.addRaw('Keepalive paused by agents:pause label.').addEOL();
}

Copilot AI Dec 21, 2025

Copy link

Choose a reason for hiding this comment

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

The pause label check here is redundant with the pre-gate evaluation. The evaluateKeepaliveGate function already checks for the pause label and returns hasPauseLabel in its result (and sets ok=false with reason='keepalive-paused' when the label is present). This reason has already been added at line 167 via addReason(preGate.reason || 'pre-gate-failed'). Consider removing this duplicate check and instead use preGate.hasPauseLabel if needed, or rely on the pre-gate check result that's already being processed at lines 166-175.

Suggested change
if (currentLabels.has('agents:pause')) {
addReason('keepalive-paused');
summary.addRaw('Keepalive paused by agents:pause label.').addEOL();
}

Copilot uses AI. Check for mistakes.

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

Copy link
Copy Markdown

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.

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

Comment on lines 7 to +10
const MAX_RUNS_PREFIX = 'agents:max-runs:';
const SYNC_REQUIRED_LABEL = 'agents:sync-required';
const ACTIVATED_LABEL = 'agents:activated';
const PAUSE_LABEL = 'agents:pause';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Detect pause label using correct name

The new pause handling checks for agents:pause, but the rest of the keepalive stack uses the agents:paused label (see scripts/keepalive-runner.js line 483 and the paused fixture in tests/workflows/fixtures/keepalive/paused.json). With the name mismatch, PRs already marked agents:paused will not be treated as paused by this gate, so keepalive runs continue even though the pause label is present.

Useful? React with 👍 / 👎.

stranske added a commit that referenced this pull request May 10, 2026
… systems

The opener cron selects work by `priority:high|normal|low` label. The
weekly repo-review's design-vs-impl pass selects by traced gap. Issues
created manually with `enhancement` or `feature` labels but no
`priority:*` label fall into a hole: neither system sees them.

Worked example surfaced 2026-05-07: Inv-Man-Intake #25, #26, #27 were
created 2026-03-01 with `enhancement` + `milestone:B-extraction-queue-images`
only. 71 days later, no activity, no agent ever picked them up.

New `scripts/repo_review_backlog_scan.py`:

  - Scans all active repos via `gh issue list`
  - Surfaces issues with `enhancement` OR `feature` label that:
    - have NO `priority:*` label (opener would already see them)
    - have NO `agent:*` label (an agent owns it)
    - have NO dependabot / sync* / process-eval label (other automations)
    - have NOT been updated in the past `--stale-days` days (default 7)
  - Sorts oldest-stale-first; writes JSON to --out

Coordinator runs the scan after the final evaluator pass and feeds the
result to the notify step. The desktop file now includes a "Backlog
needing your attention" section listing each stale item with the exact
three `gh issue edit/close` commands to promote / deprioritize / close
it. macOS notification subtitle shows both queue and backlog counts.

Goal: an enhancement issue sits unaddressed for at most 1-2 weekly
cycles before the human surfaces it.

Smoke-test against current state: found 4 items in Inv-Man-Intake
(#27, #26, #25 at 71 days; #10 at 14 days) — exactly the pattern the
user's report identified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
stranske added a commit that referenced this pull request May 10, 2026
…mans

The 2026-05-10 feedback: surfacing every unaddressed enhancement issue
for human triage is heavier than necessary. The system should label the
clear-cut cases itself and only ask for human input when the issue shape
is ambiguous.

Two-tier classification in `repo_review_backlog_scan.py`:

**auto-labelable** — leaf enhancement issues. Heuristic priority:
- has `milestone:*` label → `priority:normal` (declared planned work)
- created >90 days ago without milestone → `priority:low` (likely stale)
- otherwise → `priority:normal` (default)

With `--apply` (the cron default), the scanner calls `gh issue edit
--add-label priority:X` for each leaf. The opener picks them up on its
next pass.

**needs-human** — surfaced for decision, not auto-labeled:
- title contains epic/tracker/umbrella/roadmap/rollup/parent issue
- has `epic`/`umbrella`/`tracker`/`meta`/`parent`/`needs-triage`/`discussion`
- has any `blocked*` label
- body has ≥2 task-checkbox lines mentioning #NNN (umbrella tracking children)
- body has a "Children: #..." or "Child issues: #..." declaration

Validated against the user's worked example: #25/#26/#27 → leaf
(auto-label `priority:normal`); #10 → umbrella detected via 4 child
checkboxes (surface for human); #7 → umbrella detected via "epic" in
title. Matches the user's stated preference exactly.

The desktop reminder now renders two backlog subsections:
- **Auto-labeled this week (N items) — FYI, no action required**: brief
  one-line summary per item with applied priority.
- **Backlog needing your decision (M items)**: full three-command resolution
  block per item (promote / deprioritize / close).

macOS notification text now distinguishes the cases: clean weeks with
auto-labels only show "no action required"; weeks with needs-human items
show "decisions needed".

Coordinator now passes `--apply` to the scanner so the cron actually
mutates labels (dry-run is still the default when running the scanner
standalone for testing).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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