When an agent times out during payment authorization, the result may be committed, rejected, or still unknown. Recovery has to establish which state is true before it chooses another action or tells the user to try again.

Why this Skill is needed

Agent workflows span tools, services, and user-visible messages. A failure can happen after one step wrote state but before the next step completed. The Agent Failure Recovery Testing Skill helps teams trace that partial journey and decide whether to retry, reconcile, compensate, escalate, or stop.

What the Skill helps you do

Build a failure matrix from evidence the project actually provides:

FailureConfirmed write stateRetryabilityRecovery actionRecovered state and evidence
Transient and no write confirmedAuthoritative sources and a complete query scope confirm no committed effectOnly if policy permitsRetry or poll with the original operation identityVerify one final effect and user notice
Permanent rejectionRejection is confirmedNot by repeating unchanged inputStop and explain or escalatePreserve rejection and handoff record
Indeterminate timeoutCommit state is not establishedDo not assume safe replayQuery by operation ID or idempotency key; then follow the contractKeep unresolved until records reconcile
Partial workflow successSome steps are committedDepends on each remaining stepReconcile completed and remaining steps; compensate only with protocol and authorityVerify every step and any compensation outcome

Use AFR-## findings to connect the failure point, evidence, recovery choice, user-visible outcome, owner, and close condition. The matrix supports a review or test plan; it does not prove runtime recovery happened. Awesome QA Skills: https://github.com/naodeng/awesome-qa-skills organizes Skills by language and testing stage; the series overview: https://inaodeng.com/en/blog/ai-testing/introduction_of_awesome_qa_skills/ explains the shared installation model.

Scope and limits

The Skill does not define a universal retry count, timeout, fallback, or compensation policy. It cannot treat a timeout as proof of no write, authorize a refund or rollback, or claim recovery from missing logs. The accountable system owner must confirm policy, and runtime claims need run records and state evidence.

What to inspect

Recovery concernEvidence questionDecision it supports
Failure certaintyWas the action rejected, never sent, accepted, or left indeterminate?Classify as transient, permanent, or unknown
Prior writesWhich steps committed before the failure?Prevent repeating completed side effects
Retry safetyIs the original operation ID or idempotency key reusable under the contract?Retry, poll, or hold for reconciliation
CompensationDoes an approved protocol allow reversing the completed step?Compensate only with authority; otherwise escalate
User communicationWhat state can the system prove to the user?Say pending, complete, failed, or under review only when supported
Recovery evidenceDo logs, state transitions, attempts, and user notice agree?Close as verified or retain an evidence gap

A recovery action is not complete when a retry succeeds. Compare the before and after state, attempt count, side effects, resources, and user-visible outcome.

Audit inputs before designing recovery tests

Needed inputUse in the reviewMissing-input treatment
Workflow steps and failure injection pointsShow where partial completion is possibleBound the scenario to known steps
Operation ID, request ID, or idempotency keyFind the original attempt and committed effectsDo not replay an indeterminate write without a safe contract path
Retry, fallback, and compensation policyDecide which actions are allowedLeave the recovery choice open for its owner
State sources and user messagesCompare system truth with what the agent reportsMark recovery unverified if logs or state are absent
Stop conditions and escalation ownerPrevent endless retries and unauthorized repairRecord who must take over and what blocks continuation

Separate facts, assumptions, conflicts, stale records, and out-of-scope steps. Missing evidence limits the conclusion; it is not automatically a product failure.

Worked scenario: authorization timeout in an order agent

This scenario is a design example, not an executed payment test. The agent submits one authorization request, times out before receiving a result, and the order remains pending.

Recovery sequence

  1. Keep the original operation ID and idempotency key; record the timeout and attempt number.
  2. Within the authorized access scope, query the payment provider and internal ledger using those identifiers before issuing another write.
  3. If authorization is confirmed, reconcile the order state and continue the documented confirmation path. Do not charge again to make the order look complete.
  4. If the provider reports no operation, follow the contract’s retry rule with the original identity. A missing lookup result is not proof of failure if the source can be delayed or incomplete.
  5. If records conflict or remain indeterminate, stop automated replay and escalate with both records attached.
  6. Tell the user only what the evidence supports—for example, that confirmation is pending while the payment status is checked.

If the workflow partly succeeded, list completed and remaining steps separately. A refund or other compensation requires an approved protocol and an authorized owner; record the result and escalate if compensation itself fails.

Example finding

The fields below are a recording pattern, not a real incident or run result:

FieldExample
ID and scenarioAFR-01 — payment authorization timed out before the order agent received a result
Confirmed write stateUNKNOWN until provider and internal records are reconciled
Retryability and actionUNASSESSED; query the original operation before any replay
User impact and priorityState the effect supported by evidence; use NOT_SCORED until the project scale can be applied
Owner and stop conditionName the payment/workflow owner; keep automated replay stopped while commit state is indeterminate
Close conditionAttempt history, payment and order state, recovery action, and user notice agree and can be reviewed

Do not turn an example, recommendation, or missing log into a confirmed failure or successful recovery.

Handoff to the next stage

Handoff fieldInclude
Failure recordFailure point, classification, operation identity, timestamp, and attempt number
Write stateConfirmed completed, confirmed absent, partial, or still indeterminate—with source links
Recovery decisionRetry, poll, reconcile, compensate, escalate, or stop, plus its policy basis
User outcomeExact notice shown and evidence that supports it
FindingAFR-##, impact basis, owner, stop condition, and close condition
ValidationBefore/after states, effect counts, logs, and compensation outcome if applicable

A recovery is verified only when the system state and user-visible outcome agree with the evidence. If they do not, hand off the mismatch and keep the state open.

Common traps

  1. Treating timeout as proof that no write occurred.
  2. Replaying before checking the original attempt’s committed effects.
  3. Retrying a permanent rejection with unchanged input.
  4. Recommending compensation without protocol and owner authority.
  5. Telling the user a task completed when only one workflow step is confirmed.

Install and invoke

Install the individual Skill and provide the workflow contract and real evidence sources:

npx skills add naodeng/awesome-qa-skills --skill agent-failure-recovery-testing

Use the source prompt’s failure matrix and finding fields when requesting a review:

Use the agent-failure-recovery-testing Skill.

Task: assess an order agent that timed out during payment authorization
Inputs: [workflow contract, operation IDs, provider responses, logs, state queries]
Scope: [steps and effects included or excluded]
Unknowns: [missing policies, evidence sources, permissions, or owners]
Expected output: [risk-ordered AFR-## findings, recovery matrix, evidence states, and next actions]

Separate confirmed writes from assumptions. Do not call a recommendation an executed recovery.

FAQ

Can recovery testing start without provider logs?

Yes, as a constrained design review. List what would distinguish no write, confirmed write, partial completion, and unknown state; leave runtime recovery unverified until the records are available.

When is retry unsafe?

When the original write may have committed and the contract offers no safe replay path. Check the original operation first, then follow its retry policy or escalate.

Should every partial failure be compensated?

No. Compensation can create another business effect. Use it only when an approved protocol and authorized owner permit it, and verify its result separately.

References

Source Skill and execution contract

The Agent Failure Recovery Testing prompt: https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/agent-failure-recovery-testing/prompts/agent-failure-recovery-testing.md defines the workflow and output contract. The source directory: https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/agent-failure-recovery-testing contains the entry point and supporting material.

Share