Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 5 min read

When a deployment times out, should your agent deploy again?

A real life scenario from my agentic development platform: A deployment watcher times out. The agent has no successful result to report. Should it deploy again? I wouldn’t dispatch it right away. The first deployment m

When a deployment times out, should your agent deploy again?

A real life scenario from my agentic development platform:
A deployment watcher times out. The agent has no successful result to report.

Should it deploy again?

I wouldn’t dispatch it right away. The first deployment may still be running. Starting another attempt can turn a visibility problem into competing side effects.

This is why a useful recovery policy needs more than a red status and a retry button. It needs the failure reason, evidence about the previous action, and a bounded next step.

Here is a practical way to review that policy, using the AOP deployment workflow configured in IssueFlow as an example.
Note: These are configuration examples, not a claim that a particular release succeeded or that the policy has produced measured savings. AOP (Aligned On Purpose) - is the augmented leadership platform I develop using IssueFlow.

This develops one question from How I Manage AI Coding Agents Without Spending My Day Managing Them: when an agent reports failure, what should happen next? The focus here is a testable recovery policy, not the article’s personal time or module-completion claims.

deployment timeout routing to different stages based on failure reason

Separate the action from the observation

There are at least three different questions:

  1. Was the deployment dispatched?
  2. Did its execution finish, and with what result?
  3. Did the deployed application pass the required verification?

A timeout while observing an action does not answer the other two.

In the configuration inspected for this article, deploy-dev dispatches a deployment and waits. If the watch times out, the route escalates rather than immediately dispatching another deployment. A transient source-control problem has a different route: wait five minutes, retry up to three times, then escalate.

Those settings are specific to this workflow. They are not sensible defaults for every deployment system. The transferable principle is to distinguish an uncertain action from an action known to have failed.

Before retrying, retain the run identifier, target repository, commit and environment whenever the provider returns them. If the outcome is uncertain, inspect that same run. Missing evidence is not permission to create a replacement.

A completed tool call is not a healthy release

The next distinction is subtler.

In this workflow, a completed deployment wait can lead to verify even when the action result is unsuccessful. The verifier evaluates what happened instead of treating completion of the waiting operation as success of the software release.

That means the label on an orchestration stage cannot be read in isolation. Ask what the stage promises.

β€œFinished watching” is different from β€œdeployment succeeded.” Both are different from β€œthe application is healthy.”

A useful review should trace the evidence all the way to the claim it is supposed to support. A merged pull request does not prove deployment. A deployment result does not, by itself, prove the relevant behavior works.

Give different failures different next steps

The configured verification stage has several explicit dispositions:

  • Redeploy now: return to deployment, with at most two retries.
  • Redeploy later: wait fifteen minutes, retry at most three times, then escalate.
  • The change broke deployment: return to release scoping.
  • A person is needed: escalate.

The important part is not the spelling of those reasons. It is that the workflow does not ask another implementation agent to rewrite code for every infrastructure failure.

Conversely, a retry should not conceal a code defect. A failure attributed to the change needs a correction and a release scope that includes it, not an endless sequence of identical deployments.

Classification is therefore a consequential decision. Keep the evidence behind it: the failed check, affected commit, comparison baseline and uncertainty. β€œProbably infrastructure” is not a durable explanation.

Keep the release scope stable

Suppose commits A and B were selected for a deployment. While it runs, commit C merges.

If the final recording step simply asks what is currently merged, it can accidentally give C credit for a deployment it never entered.

The AOP configuration separates release-scope from release-mark. The release-mark stage is configured to use the frozen scope produced earlier, rather than a fresh inventory.

That is a useful invariant to test: every recorded deployed issue should belong to the batch that was actually verified. Advancing the branch must not silently expand that batch.

This is about evidence integrity, not just scheduling.

Test the recovery policy before trusting it

Use a sandbox or controlled test harness, not fault injection against a live customer environment. A compact test matrix can include:

  • The watcher loses contact while the original deployment continues. Expect inspection or escalation, not an immediate duplicate dispatch.
  • A transient provider failure occurs. Expect the configured delay and attempt cap.
  • Verification identifies a failure caused by the new batch. Expect a correction path and renewed scope, not blind retry.
  • Another commit merges during verification. Expect the recorded batch to remain unchanged.
  • Evidence is insufficient to choose a safe route. Expect an explicit unresolved state and escalation, not a guessed success.

These are proposed tests, not results from a completed experiment.

For each test, capture the initial state, reason, selected route, attempt count and resulting evidence. Record unexpected transitions as defects in the recovery policy.

Keep the human decision meaningful

Escalation is not necessarily a person at the very first step. Inspect the configured escalation policy separately. When it does reach a person, provide the decision and its consequences, not just a wall of logs.

Should this release wait? Is the failure acceptable for this environment? Does the scope need to change?

The goal is not to remove judgment. It is to stop using another code attempt as the default answer to every kind of uncertainty.

How this relates to IssueFlow

The recovery routes above are an example of the kind of workflow you can configure in IssueFlow, a configurable orchestration platform for AI coding agents. Rather than treating every failure as another coding prompt, IssueFlow coordinates defined delivery stages and routes work according to the outcome, including escalation when a human decision is needed.

See IssueFlow for the platform and a real workflow demonstration.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.