Article

GitHub issue statuses to limit duplicate agent runs

For software teams, a guide to preview access, precise status triggers, replay handling and runner costs before connecting agents to GitHub issues.

Editorial illustration for GitHub issue statuses to limit duplicate agent runs: a controlled task flows from input to output. Not documentary evidence.

GitHub’s November 23, 2026 public preview adds issue statuses that software teams can use to hand work to coding agents. To limit duplicate work, select one status-change trigger, check the issue again before acting, and keep a durable record of the task. An event filter alone cannot make an agent run exactly once.

Check preview access before wiring up the agent

Use GET /repos/{owner}/{repo}/planning-statuses with the identity your integration will use. The planning-status API returns selectable statuses and their numeric IDs; fine-grained tokens need Issues read permission. Discover the intended repository’s values instead of copying an example ID. A 404 can mean statuses are unavailable there, so check access and preview eligibility.

Despite the public-preview announcement, the API reference still requires enrollment. It does not establish a universal opt-in route, plan matrix or GitHub Enterprise Server availability. Confirm access before building around it.

Fresh issue reads have another preview restriction: organization repositories expose status to authenticated requests, including app installation tokens and GITHUB_TOKEN; personal repositories require a preview-enabled user’s identity. GitHub’s visibility rules make that distinction. If the worker cannot read current status, hold the task.

Choose the exact change that starts work

Audit existing issues workflows first. Without an explicit types list, they receive the new action too, adding runs when issues are created, closed or reopened. Preserve the existing handlers you need; assign one handler to each agent task. GitHub’s Actions reference requires the workflow file on the default branch.

For a status-only trigger, add this fragment to the workflow:

on:
  issues:
    types: [status_changed]

Then put this condition on the relevant job, replacing 8 with the discovered ID for In review:

if: ${{ github.event.status.id == 8 }}

These are configuration fragments, not a complete or executed integration. They do not check current state, authorize the agent, record completed work or recover failures.

Match an ID for a specific handoff. In progress and In review both belong to started. For a “work began” signal, GitHub’s category-entry example checks the new category and requires the previous category to differ or be absent. Testing only the new category also catches moves within it.

GitHub notes that preview editors may flag status_changed as invalid; this documented warning does not excuse unrelated errors. A skipped job can still leave a visible workflow run.

Do not substitute “pull request linked” for a confirmed target status. The announcement says linking an open pull request moves the issue to In review; the workflow guide describes In progress for eligible issues. The live mapping remains unresolved here.

Read the issue again before starting work

Top-level status and changes describe the saved transition; issue.status is a potentially stale snapshot. Closing or reopening can generate status_changed plus closed or reopened, in either order. Delivery is best effort, without exactly-once guarantees. GitHub documents these delivery limits.

Fetch GET /repos/{owner}/{repo}/issues/{issue_number} using the issue-read API before launching the agent. Recommended checks: the repository is eligible, the issue remains open for the proposed review, the target ID still matches, and your own authorization rule permits the task. Treat missing, null or unfamiliar status values as a reason to hold, not to guess.

This fresh read rejects an obviously stale handoff; it does not lock the issue during a long agent run. Recheck before posting a result or changing code. If the relevant state changed, hold the result for review.

Authors can change status by closing or reopening their issues under GitHub’s permission rules. An event is not privileged approval. For a separate checkpoint, see T3 Code workflows with human approval.

Separate webhook replays from repeated agent tasks

For an external webhook receiver, follow GitHub’s webhook guidance: validate the signature over HTTPS, check the event is issues and the action is status_changed, and respond within ten seconds. Queue long-running work instead of keeping the request open. As an implementation safeguard, durably save the accepted delivery before acknowledging it.

Use X-GitHub-Delivery to recognize a replay: redelivery retains the original value. That header belongs to the HTTP receiver; do not invent an equivalent Actions payload field. Distinct event types still need task-level handling even when neither delivery is a replay.

The engineering recommendation is a second record for the intended operation—idempotency, meaning repeat requests do not repeat its effects. Choose what counts as one task before choosing its key:

  • For “review this code revision once,” include repository, issue, revision and review purpose in the operation identity.

  • For “review on every new entry into In review,” use a distinct, durably recorded handoff identity. A permanent issue-plus-status key would suppress legitimate later reviews.

Claim that operation atomically before starting work. Track received, running, failed and completed states, with a recovery path for interrupted workers. Record downstream operation IDs where available. If a response is lost after an external action, inspect whether the action succeeded before retrying; merely marking the task complete at the end leaves that crash window open.

An Actions concurrency group limits overlapping runs, but does not remember completed work. Its default pending-run policy replaces the older waiting run, and queue order need not reflect the original issue transitions. Use it as an overlap control, not a task ledger. Cancellation cannot undo a comment or code change already made.

GitHub does not automatically resend failed deliveries. Arrange inspection and redelivery, then reconcile current issues with unfinished task records. This recovery design does not establish a cross-system exactly-once guarantee.

Check status writes and chained workflows separately

If the integration also changes statuses, the issue-update API uses a string status value, not a numeric status_id. Writing requires appropriate Issues write access. Status changes can alter open/closed state; explicit state fields must agree. Duplicate additionally requires duplicate_issue_id—the target issue’s ID, not its issue number. An unavailable feature causes the status parameter to be ignored, so read back the result.

Do not assume a successful write launches the next workflow. Under GitHub’s workflow-trigger rules, issue events caused with GITHUB_TOKEN do not start another Actions run. Use deliberate orchestration, such as an explicit dispatch, if chaining is required; broader credentials are not a substitute for deciding which operation should run.

Budget for repeated runner and agent work

GitHub’s current Actions billing page lists standard Linux 2-core x64 runners at US$0.006 per minute. Private-repository usage draws from the owner’s included compute before overage applies. Standard public-repository runners remain free; larger runners are outside that rule.

Illustrative calculation: assume 100 intended jobs, each using five billable minutes on that private-repository runner. Intended usage is 100 × 5 × US$0.006 = US$3. One identical duplicate per task adds US$3, making US$6 in runner usage—not necessarily US$6 payable after included compute. This excludes storage, model usage, tax and other shared usage; it is not a measured duplication rate.

Choose the agent’s execution permissions separately from its trigger. Strands Box setup and sandbox limits covers one possible execution environment, not a ready-made GitHub status integration.

Start with one repository and a review-only task. Before enabling unattended work, check that a replay does not start a second task, an obsolete status holds the action, and a later legitimate review can still proceed. Keep code changes and publication behind the authorization rule you chose.