Skip to content
Back to skills

Diagnose Agent Failure

ASecurity

Supervise a running Solve harness and diagnose its versioned terminal failure receipts. Use to detect repeated tool chains, abnormal token growth, hard token ceilings, provider or workspace failures, malformed output, timeouts, verification failures, and retry loops; steer live work without blocking justified token headroom, then decide retry, termination, or evidence preservation after failure.

  • 85 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
devopspythongo

Works with

  • terminal

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add elixpo/elixpo_chapter --skill diagnose-agent-failure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Diagnose Agent Failure?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Diagnose Agent Failure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/elixpo-diagnose-agent-failure/badge)](https://www.skillsdirectory.com/skills/elixpo-diagnose-agent-failure)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: diagnose-agent-failure
description: Supervise a running Solve harness and diagnose its versioned terminal failure receipts. Use to detect repeated tool chains, abnormal token growth, hard token ceilings, provider or workspace failures, malformed output, timeouts, verification failures, and retry loops; steer live work without blocking justified token headroom, then decide retry, termination, or evidence preservation after failure.
---

# Diagnose agent failure

Operate in two deterministic modes: live supervision from authenticated harness
events, and terminal diagnosis from recorded state. Never modify a target
repository or publish a reply.

## Supervise the live harness

Consume structured usage and tool events emitted by the supervised process; do
not scrape prose logs. Keep a bounded receipt in Solve state with run ID, token
target and ceiling, observed turns, tool/edit counts, repeated-chain signals,
warnings, and timestamps.

- Treat Vet's token target as advisory. Warn when crossed, but continue novel or
  productive work because some valid issues need the approved headroom.
- Stop at the absolute token ceiling.
- Steer three identical calls or a repeated two-call cycle toward existing
  evidence, an edit, or StructuredOutput. Clear the recent chain after a
  successful edit.
- Stop before the ceiling only when a repeated chain and abnormal token growth
  occur together. Never stop from cost alone while still below the hard ceiling.
- Bound telemetry and stream queues so monitoring cannot create its own memory
  leak. The Python supervisor must terminate the exact harness/CCR process group
  in `finally` on every outcome.

## Validate a terminal handoff

Require all of the following before deciding:

- `state/solve.json.status` is `doctor_pending`.
- Failure evidence has a supported schema version, category, stage, exception
  type, bounded message, retryability signal, candidate action, and timestamp.
- Cleanup belongs to Janitor and remains `blocked_on_doctor`.
- Token spend, token limit, elapsed time, run ID, and issue key come from the
  same Solve receipt.

Reject malformed, stale, or mismatched state. Do not repair it by guessing.

## Decide deterministically

Fingerprint stable failure evidence after removing temporary paths and random
identifiers. Consult bounded Doctor history before selecting an action.

- `retry`: only a transient provider/workspace failure, timeout, turn limit,
  context miss, or malformed model handoff may receive one fresh-run retry.
- `terminate`: credentials, provider funding/request, policy, token ceiling,
  stale issue, verification, or rejected review require external change.
- `preserve`: unknown or internally inconsistent failures require inspection;
  do not authorize cleanup.

The same fingerprint may consume at most one retry. A repeated fingerprint is
terminal even when the original failure was retryable. Doctor never retries a
tool call or Solve directly; it records authorization for the orchestrator.

## Record the receipt

Write a strict current decision and append it to a bounded history. Include the
run ID, issue key, fingerprint, category, stage, action, reason, retry count,
bounded delay, cleanup authorization, token evidence, elapsed time, and decision
timestamp. Carry the recorded model route and token overage without inventing
missing telemetry. Mirror only the decision identity into Solve state.

Authorize cleanup for `retry` and `terminate`. Mark `preserve` evidence as
inspection-required. Never delete files, terminate processes, adjust budgets,
change credentials, or post publicly.

Files in this skill

  • SKILL.md3.5 KB
  • agents/openai.yaml258 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.