Skip to content

feat: implement issue #1525 — AGENTS_PAUSED first-class pause state + engine-token preflight - #1529

Merged
don-petry merged 6 commits into
mainfrom
feat/1525-agents-paused
Aug 18, 2026
Merged

don-petry merged 6 commits into
mainfrom
feat/1525-agents-paused

Conversation

@don-petry

@don-petry don-petry commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Closes #1525

Maintainer-approved steering implementation. Makes a deliberate fleet pause a visible, clean state instead of the 2026-08-16 presentation (token withheld to conserve quota → every dispatch failed red at caller secrets evaluation → full diagnostic arc to rediscover a decision already made).

  • dev-lead-reusable.yml: CLAUDE_CODE_OAUTH_TOKEN → required: false (a required: true fails the caller before any step can classify the absence); vars.AGENTS_PAUSED != 'true' gate on all three jobs so a pause skips neutral, never red; an Engine token preflight first step in the engine-consuming jobs (dispatch, resume) so a genuinely missing secret yields one actionable error naming the secret and the pause switch.
  • validate-engines.sh: reports AGENTS_PAUSED=true as a distinct deliberate state (notice + step summary) — never conflated with broken credentials.
  • AGENTS.md: "Pausing the agent fleet" section — pause via the variable, not by withholding the secret.
  • Contract test tests/dev-lead/integration/test_agents_paused_preflight.py (+ agents-paused-preflight job): pins required:false, the pause gate on every job, and preflight-first ordering. (Local bats note: test_validate_engines.bats case 3 fails identically on unmodified main in the local env — pre-existing flake, CI is authority.)
  • Fleet monitor AC: satisfied structurally — a paused run's jobs all skip, the run concludes neutral, never counted as failure.

Rollout (steering action after merge): callers pin @dev-lead/v1-stable (currently 6d362318), so this reaches the fleet only when the channel advances: scripts/cut-release.sh dev-lead 1.2.0 --ref main --channel stable --push. That release also ships the restored trunk (#1487/#1519), the #1496 integrity detector, and the #1497 registry to the fleet. pr-review-side pause gating is deliberately deferred: it already degrades without the token (ran throughout the outage), and its channel tags are mid-migration under #1493.

🤖 Generated with Claude Code


CodeAnt-AI Description

Treat deliberate agent-fleet pauses as a neutral state and report missing engine credentials clearly

What Changed

  • Setting AGENTS_PAUSED=true cleanly skips dispatch, relay, and resume jobs instead of producing failed runs.
  • Engine validation reports the fleet as deliberately paused without probing or misclassifying credentials.
  • When the fleet is not paused and the Claude token is missing, an early check shows one actionable error explaining how to restore the token or pause the fleet.
  • Added workflow contract coverage and documented how to pause and resume the agent fleet.

Impact

✅ Paused runs no longer appear as fleet outages
✅ Clearer missing-token errors
✅ Safer quota-conservation pauses

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

… engine-token preflight

Makes a deliberate fleet pause visible and clean instead of presenting as a
fleet-wide outage (2026-08-16: maintainer disabled CLAUDE_CODE_OAUTH_TOKEN to
conserve quota; every dev-lead dispatch failed red at caller secrets
evaluation and diagnosis took a full steering arc):

- dev-lead-reusable.yml:
  - CLAUDE_CODE_OAUTH_TOKEN declared required:false — required:true fails
    the CALLER before any step can classify the absence.
  - vars.AGENTS_PAUSED != 'true' gate on all three jobs (dispatch, ci-relay,
    resume): a pause skips cleanly (neutral), never red. Variables are
    visible where secrets are not.
  - 'Engine token preflight' FIRST step in the engine-consuming jobs
    (dispatch, resume): a genuinely missing secret now produces one
    actionable error naming the secret and pointing at AGENTS_PAUSED /
    claude setup-token, instead of a secrets-evaluation stack error.
- validate-engines.sh: recognizes AGENTS_PAUSED=true as a distinct,
  deliberate state (notice + step summary), never conflating it with
  missing/broken credentials.
- AGENTS.md: 'Pausing the agent fleet' section documenting the switch.
- tests/dev-lead/integration/test_agents_paused_preflight.py (+ job in
  test-dev-lead.yml): offline contract test pinning required:false, the
  pause gate on every job, and preflight-first ordering.

Rollout note: callers pin @dev-lead/v1-stable, so this takes effect on the
fleet only when the channel advances — cut-release.sh dev-lead 1.2.0
--channel stable after merge (called out in the PR).

Fleet-monitor AC: satisfied structurally — a paused run's jobs all skip, so
the run concludes neutral and never counts as a failure.

Closes #1525

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner August 18, 2026 15:11
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 17fddcb Aug 18, 2026 · 15:11 15:14

@codeant-ai

codeant-ai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e506a0ed-567f-40ef-9c86-2c4d2a4ef9a1

📥 Commits

Reviewing files that changed from the base of the PR and between fafefca and 1bdfbf2.

📒 Files selected for processing (5)
  • .github/workflows/dev-lead-reusable.yml
  • .github/workflows/test-dev-lead.yml
  • AGENTS.md
  • scripts/validate-engines.sh
  • tests/dev-lead/integration/test_agents_paused_preflight.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 18, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for pausing the agent fleet using the AGENTS_PAUSED variable, updating the documentation, skipping engine validation in validate-engines.sh when paused, and adding a Python contract test to verify workflow configurations. The review feedback suggests improving the robustness of the new Python test by defensively checking types and keys when parsing the YAML manifest to avoid generic TypeError or KeyError exceptions.

Comment thread tests/dev-lead/integration/test_agents_paused_preflight.py
Comment thread tests/dev-lead/integration/test_agents_paused_preflight.py
Comment thread tests/dev-lead/integration/test_agents_paused_preflight.py
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 15:14
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry
don-petry disabled auto-merge August 18, 2026 15:22
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 15:24
@don-petry
don-petry disabled auto-merge August 18, 2026 15:29
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 15:31
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-18T16:37:30Z.

@don-petry
don-petry disabled auto-merge August 18, 2026 15:46
@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 15:47
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry
don-petry disabled auto-merge August 18, 2026 15:48
@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 15:49
@don-petry
don-petry disabled auto-merge August 18, 2026 17:05
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #1529
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-18T17:38:02Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-08-18T17:38:02Z

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 17:08
@donpetry-bot donpetry-bot added the needs-human-review Flagged by automated PR review agent label Aug 18, 2026
@don-petry
don-petry disabled auto-merge August 18, 2026 17:22
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 17:24
@don-petry don-petry removed the needs-human-review Flagged by automated PR review agent label Aug 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 18, 2026 22:36
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 18, 2026 22:38
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-18T23:41:20Z.

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 1bdfbf2e12a4995cd2b64f496dc68a8016ed6247
Review mode: triage-approved (single reviewer)

Summary

Confirms the triage assessment: this PR makes a deliberate fleet pause (AGENTS_PAUSED=true Actions variable) a first-class, visible state instead of presenting as a fleet-wide outage. It relaxes CLAUDE_CODE_OAUTH_TOKEN to required:false in dev-lead-reusable.yml, adds a vars.AGENTS_PAUSED pause gate to all three jobs (skip neutral, never red), adds an Engine-token-preflight first step in the engine-consuming jobs (dispatch, resume) with a single actionable error, teaches validate-engines.sh to report the paused state distinctly, documents pause/resume in AGENTS.md, and pins the contract with a new offline YAML test wired into CI.

Linked issue analysis

Closes #1525 — all five acceptance criteria are substantively addressed: (1) the AGENTS_PAUSED variable gate skips dispatch/ci-relay/resume cleanly (neutral, not red); (2) a missing secret while unpaused fails fast in the preflight with one error naming the secret, the pause switch, and the issue; (3) validate-engines.sh reports the paused state distinctly (notice + step summary) without conflating it with broken credentials; (4) the fleet-monitor AC is satisfied structurally — paused runs skip and conclude neutral; (5) AGENTS.md gains the 'Pausing the agent fleet' section. The issue's dev note about caller-side secrets evaluation is correctly handled via required:false plus in-run preflight, and the new contract test pins exactly the three load-bearing properties (required:false, pause gate on every job, preflight-first ordering).

Findings

No blocking findings.

  • Correctness verified: the unset-variable case evaluates `'' != 'true'` → jobs run normally; the resume job's OR condition is correctly re-parenthesized under the new pause gate; the preflight only tests emptiness (`-z`) and never echoes the token.
  • Security posture: no secret exposure; the new agents-paused-preflight CI job uses minimal permissions (contents: read), persist-credentials: false, and SHA-pinned actions. Relaxing required:true → required:false does not weaken enforcement — presence is still enforced in-run with a clearer error. Frozen thin-caller stubs are untouched.
  • Minor (non-blocking) observation: validate-engines.sh honors the `AGENTS_PAUSED` env var, but its consumers (e.g. workflows sourcing it via review-batch.sh) are not wired to pass `vars.AGENTS_PAUSED` into env in this PR — worth adding when the pause switch is expected to reach those paths. dev-lead itself is unaffected since its jobs gate at the job level.
  • Advisory-bot context: CodeRabbit/Codex/Qodo were rate-/billing-limited at this SHA (a prior cycle posted a withhold marker), but advisory coverage is substantial — Gemini reviewed (all 3 threads resolved by follow-up commits), plus CodeAnt, SonarCloud quality gate passed, CodeQL, and AgentShield all green.
  • Secret scan: the run_secret_scanning MCP tool is unavailable in this environment; the gitleaks CI check passed and manual diff inspection found no credentials.
  • Rollout note per the PR body: this reaches the fleet only when the stable channel advances via cut-release.sh — a deliberate post-merge steering action, not a review blocker.

CI status

All checks green at 1bdfbf2: agents-paused-preflight, shellcheck, actionlint, bats, unit/integration tests, CodeQL (actions + python), gitleaks secret scan, SonarCloud quality gate, AgentShield, caller-stub-freeze, reusable-pin-compliance, and all validators SUCCESS; only ecosystem-specific audit jobs skipped as expected.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 40f6c23 into main Aug 18, 2026
58 checks passed
@don-petry
don-petry deleted the feat/1525-agents-paused branch August 18, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make 'agents intentionally paused' a first-class state — deliberate token disable presented as fleet-wide outage (2026-08-16)

2 participants