Agents In Use
What’s new todayLast update
108 use cases added today

How to use Devin to clean closed branch previews

Devin added branch provenance to preview deployments and guarded cleanup with PR-state rechecks, keeping ambiguous or newly deployed resources before merge.

OUR ADAPTATION

Suggested prompt

Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.

Add source-branch provenance to preview deployments and plan cleanup only for unambiguously owned previews whose related PRs all closed after deployment. Preserve reopened PRs, main previews, active deploys, and ambiguous histories. Recheck PR and deployment state immediately before deletion, retain caps/time budgets, and leave untraceable historical resources for manual review.

Evidence at a glance

Sourced account
Original account
Read the source ↗
Published
Source link checked
Reported result
Source-aware preview cleanup merged with ownership guards and last-minute PR/deployment checks; historical untraceable previews required manual cleanup.
Human involvement
The public PR records task constraints and automated review or checks. Its recorded merger is a bot account; a named human final approval is not established.

A linked account supports attribution. It does not mean we independently reproduced its result.

Report an issue with this caseOpen correction email

Opens your email app with the case link included. Nothing is sent automatically.

How the agent did it

  1. The agent added source-branch provenance to preview workflow run names.
  2. It planned deletions only for unambiguously owned previews whose PRs all closed later.
  3. It rechecked PR and deployment state immediately before resource cleanup.

Devin changed Kody's preview cleanup after live branch previews accumulated and exhausted Cloudflare Durable Object namespace capacity. The existing sweep only removed a branch preview once its Worker disappeared, so a still-running preview could survive after every associated pull request had closed.

The patch made workflow run names record the source branch and taught the sweep to recover that ownership. It kept a preview whenever ownership was ambiguous, a deployment was still running or the branch had no associated PR. A preview qualified for deletion only when all source-branch PRs were closed and their final closure followed its deployment.

Before deleting, the tool checked PR state again and looked for a newly started deployment. Cleanup retained the existing resource-removal path, per-run cap and time budget. Tests covered reopened PRs, main-branch previews, deployment ordering and conflicting run histories.

Older previews without the new provenance were removed manually; main-branch expiry remained a separate decision. The PR merged through kody-bot on October 14 after reported checks. Its result is a guarded cleanup policy for newly traceable branch previews, not proof that every historical or main-branch preview now expires automatically.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: GitHub · devin-ai-integration[bot]

Frequently asked questions

Why were live previews accumulating?

The old sweep waited for their Workers to disappear before considering cleanup.

What happens with ambiguous ownership?

The preview is kept rather than guessed to be stale.

Were historical previews automatically fixed?

Older previews lacking provenance were cleaned manually.

More details

About this account

The patch made workflow run names record the source branch and taught the sweep to recover that ownership. It kept a preview whenever ownership was ambiguous, a deployment was still running or the branch had no associated PR. A preview qualified for deletion only when all source-branch PRs were closed and their final closure followed its deployment.

Primary agent-authored PR and public API opened. Results and checks are reported by the PR, not independently reproduced. Bot merge is not evidence of human review. Prompt is suggested by Agents In Use, not a quoted original.

Credit: devin-ai-integration[bot] on GitHub

Source published

Added to Agents In Use

Source checked

Tools and topics

Devin · GitHub · Cloudflare Workers

Repository maintenance · Recorded checks

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.