Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk6 min

How to Prevent Duplicate Runs and Lost Work in an Issue-Driven Coding Agent

Concurrency can stop issue-agent runs from acting at the same time, but durable task state and idempotent writes are what prevent lost work and duplicate side effects.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prevent duplicate runs by controlling which work may execute at the same time; prevent lost work by recording accepted tasks durably; and make retries safe by giving side effects stable identities. A GitHub Actions concurrency group can serialize runs, but it is not a durable work queue and does not make external writes happen exactly once.

Why one issue can start more than one run

An issue is not a single event. Opening it and then adding two labels can trigger three workflow runs if the workflow listens for all three activities. Repeated user actions, webhook delivery, and later issue updates can all produce more work while an earlier run is still active.

As an Amazon Associate I earn from qualifying purchases.

Start by identifying what the system considers a unit of work. It may be the issue itself, a particular issue event, or an independent task generated from the issue. Decide whether a new event should merge into existing work, wait behind it, or replace it. Without that decision, a concurrency setting can suppress work that the agent was expected to perform.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose what should happen to each new event

Policy Use it when Main trade-off
Merge Several updates can be handled together by inspecting the issue’s current state. Intermediate event details may not be processed individually.
Queue Every accepted event or task must eventually be processed. Work can accumulate, so the system needs queue monitoring and a plan for backlogs.
Supersede A newer state makes earlier work obsolete, such as analysis of an outdated commit. Cancellation is data loss if the earlier task had independent work that still mattered.

Be explicit about this policy at the event-admission layer. If the workflow needs every accepted task, do not rely on a mechanism that retains only the latest pending run.

Use concurrency to protect the resource being changed

GitHub Actions permits concurrent jobs and workflow runs by default. A concurrency group can prevent matching runs from executing simultaneously. A common conceptual scope is workflow identity plus issue number: it prevents two runs for the same issue from acting at once without making unrelated issues contend for one slot.

Concurrency is not equivalent to a FIFO queue. GitHub Actions’ documented default keeps one run active and one pending in a group; when another run becomes pending, it can replace the older pending run. That behavior is useful when the latest issue state supersedes earlier analysis, but it can discard an accepted event if each event matters. Choose a queueing design that preserves all required tasks rather than treating serialization as preservation.

  • Include workflow identity in a group when distinct workflows should not affect one another. Reusing a group name can make runs from separate workflows compete.
  • Use a per-issue scope when only one worker should act on an issue at a time.
  • For independent fan-out tasks, give each task a distinct discriminator instead of assigning every job the same static job-level group.

GitHub Agentic Workflows documents a concurrency.job-discriminator for distinguishing fan-out work. That feature is specific to Agentic Workflows; it is not generic GitHub Actions syntax. Check the current platform documentation before relying on any particular concurrency option or configuration syntax.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Persist task progress outside the agent process

A process that holds the only copy of a task’s status or context cannot reliably resume after a crash. Keep orchestration state in durable storage that survives worker restarts. A useful lifecycle might include accepted, running, checkpointed, waiting-for-agent, completed, failed, and canceled states.

For each task, record enough information to decide what to do after interruption:

  • Issue identity and event or task identity.
  • Current state, attempt count, and timestamps.
  • Worker or lease ownership, including when that lease expires.
  • Checkpoint, session handle, or other information needed to resume or reconcile progress.
  • Terminal outcome and any resulting external identifiers, such as a pull request number.

Keep the agent process separate from this bookkeeping. On restart, an orchestrator can inspect durable state, reclaim an expired lease, and either resume from a checkpoint or retry a step. Give steps bounded timeouts and explicit retry policies, and make each step report a recoverable outcome rather than leaving an ambiguous half-finished status. AWS’s Durable Execution guidance describes the same core replay hazard: an interrupted step can run again, so its code must tolerate repetition.

Make writes safe to retry

A timeout does not prove that a remote operation failed. The service may have completed a write while the response was lost. If the agent retries with a new random request identity, it may create a duplicate comment, issue, or pull request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Give each logical operation a stable idempotency key derived from its domain identity and purpose—for example, issue number plus the operation “create pull request.” Persist the key and operation result so a retry can look up or reconcile the prior attempt instead of blindly repeating it. Use provider-supported idempotency where available; otherwise maintain an application-side ledger or outbox that records intended and completed effects.

For an external effect that cannot be made idempotent, choose deliberately among a reconciliation path, a write ledger, or disabling automatic retries for that effect. An at-most-once setting for an individual retry does not establish exactly-once behavior across a whole workflow. The end-to-end guarantee depends on every component, including the external service.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Prevent self-triggering and limit damage

Agent writes can create new issue events and accidentally start another agent run. Filter bot-generated events or otherwise distinguish agent output from human input. Where supported, mediate writes through safe outputs, keep the agent’s direct permissions as narrow as possible, and require review for consequential actions.

Set timeouts, rate limits, and resource limits so a loop or repeated failure cannot run indefinitely. GitHub Agentic Workflows documents safe-output controls, read-only agent permissions with writes mediated through safe outputs, concurrency controls, timeouts, rate limits, and review gates. GitHub’s creation guide describes Agentic Workflows as public preview; verify its current availability and behavior before adopting it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A recovery path for an interrupted issue task

  1. Admit the event. Create or find a durable task record using a stable issue/event identity. Apply the chosen merge, queue, or supersede policy.
  2. Claim work. Acquire the task lease and use concurrency scoped to the resource the worker will change.
  3. Run bounded steps. Save checkpoints and operation identities as work progresses; apply timeouts and step-specific retry rules.
  4. Reconcile uncertain writes. If a call times out, check the idempotency key or operation ledger before issuing the effect again.
  5. Settle the task. Record a terminal result, or return it to a recoverable state with enough information for another worker to continue.

How to diagnose duplicates and missing work

  • Several runs started for one issue: inspect which issue activities match the workflow triggers. The duplicate may originate before the agent starts.
  • A run is active but another did not proceed: inspect its concurrency group and pending-run policy. Determine whether replacement was intentional or whether accepted work needs a durable queue.
  • Independent jobs cancel or block one another: check for an overly broad static job-level concurrency key; scope it to the actual task or resource.
  • A retry created a duplicate external object: compare operation identities and stored results. A fresh random key on each attempt cannot deduplicate the same logical action.
  • A task vanished after a worker stopped: check whether acceptance, checkpoints, and task status existed only in process memory or workflow-run state.
  • Runs keep restarting after agent writes: inspect event filters and bot handling, then narrow write permissions and apply limits.

When evaluating an implementation, check event delivery and pending-work semantics, concurrency scope, checkpoint and replay behavior, external-effect idempotency, task-state observability, write controls, and timeout and rate-limit handling. A concurrency group addresses only part of that design.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.