Files
pipelines/internal/author/skill/references/debugging.md
T
alan b3c9575fde Runs park on usage limits; failure classes, harness error policy, run budgets
- A stage refused for a Claude usage limit no longer fails its run: the
  runner tries the chats' Claude account auto-switch (per-home setting) and
  reruns the visit, else parks the run in the new waiting_quota status
  (persisted, with reset/resume time in run summaries, details and events)
  and resumes the same visit at reset + 1 min, also after a restart.
  resume_run / `pipelines resume` resumes now; cancel works on parked runs.
  The rerun visit gets a "# Previous attempt" interruption note. Subscription
  limits no longer say "top up the provider account".
- run/retry into an account known to be limited are deferred (quota_policy
  defer/refuse/now; CLI refuses under --json/--yes unless --defer or --now).
- failure_class on runs (quota, loop_exhausted, timeout, permission_denied,
  harness_error, blocked, environment, canceled, interrupted, budget,
  check_failed, other) in RunSummary/RunDetail/events, CLI inspect/runs/wait/
  stats and the app failure line.
- Claude permission denials (permission_denials / refused tool results) fail
  a blocked visit with permission_denied naming the tool use.
- Harness failures are classified transient vs deterministic; deterministic
  ones (and a repeated empty readback) skip error self-loops; transient
  self-loops back off 15 s, 1 min, 4 min.
- Whole-run USD budget: run --budget, server default (run-budget /
  get/set_run_settings); 80% warning notification, stop with class budget.
- App: waiting_quota status/filter with resume time, Resume now and Cancel,
  failure class wording. Docs and skill references updated.

Merges main (check stage, delivery gate, Claude stage restart survival,
schedule changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 14:34:53 +00:00

64 lines
4.2 KiB
Markdown

# Recover a failed run
1. Read `pipelines inspect ID` (then `--step N` or `--json`), the failed stage's actual input/result,
retained tool evidence, artifacts and Git diff. A timeout is not proof of lost work.
2. Separate code failure, environment/setup failure and result-format failure.
Missing evidence is not a passing check; a failed result does not erase edits.
3. Fix the specific cause directly or continue the original pipeline from the
necessary stage. Preserve completed work and original history. Do not create
another pipeline simply to merge a prepared commit.
4. Verify the repair with a focused regression; run broader checks once relevant
inputs settle. Do not raise retry/time budgets to hide a reproducible defect.
Read the run's `failure_class` first (in `inspect`, `runs`, `wait` and the app's
failure line; `stats` counts them):
| class | meaning and next action |
|---|---|
| `quota` | provider usage/balance refused; a Claude window parks instead (below), so this means an exhausted paid balance or a failed park |
| `loop_exhausted` | a stage's visit limit or the 30-step cap; fix the cause the loop kept hitting |
| `timeout` | a stage attempt ran past its `timeout`; check whether work landed before raising it |
| `permission_denied` | the stage's tool use was refused (named in the diagnostic) and it gave up; widen `tools`/write paths or change the task |
| `harness_error` | the harness failed (transport, readback, cleanup); a deterministic one was not looped |
| `blocked` | a stage deliberately routed to `#failure` (its own outcome); read its handoff |
| `environment` | harness missing or signed out, workspace/env/delivery access problems |
| `budget` | the run's `--budget`/default run budget (or a stage budget) was spent |
| `check_failed` | a verification target or delivery gate check failed |
| `canceled`, `interrupted`, `other` | operator cancel, server stop, anything else |
A Claude stage refused for a usage limit is never failed and never retried into
the limit. The server first switches the Claude home to another saved account
with usage left (when that home's auto-switch is on) and runs the visit again;
otherwise the run is parked in `waiting_quota` with `quota_wait.resets_at`/
`resume_at` and resumes the same visit a minute after the reset, also after a
restart. The visit that runs again is told in `# Previous attempt` that it was
interrupted and that partial edits may be in the worktree. Do not retry or cancel a
parked run to "unstick" it: `pipelines wait ID` waits through it,
`pipelines resume ID --yes` resumes it now (only when the limit is known to be
lifted) and `pipelines cancel ID --yes` stops it. While an account is known to be
limited, `run`/`retry` under `--json`/`--yes` are refused with the reset time;
pass `--defer` to queue the run for the reset or `--now` only when you know the
limit is gone. A run's `--budget USD` (or the server's `pipelines run-budget`)
warns at 80% and stops at 100% with class `budget`.
`pipelines retry ID --yes --json` resumes the failed stage; `--stage KEY [--visit N]` picks a
recorded stage, `--input-file FILE|-` merges a bounded JSON correction (shown to
the stage as `# Operator correction`), `--version N` a published version of the
same pipeline, `--mode=restart` starts at entry (say so). `failed` and
`interrupted` runs retry (an interrupted run resumes its unfinished stage or the
stage after the last completed one); a `canceled` one needs a new run or direct
work on its preserved branch. The retried stage sees a `# Previous attempt`
section with the failing stage and diagnostic. Verify the retry's actual stage
input, not merely its admission.
A clean preparation stage succeeds without an empty commit. A `land` stage with a
delivery gate succeeds with a clean checked candidate; the server lands afterward.
Read-only, nonvisual work does not require device screenshots. Visual acceptance
requires a ready fixture, verified connection and actual captured interactions.
Preserve exclusive fixture ownership; inspect tool/process termination before
reuse. Stop and await exact owned fixture processes, not just a go-run parent. Do
not disrupt another active fixture or restart a shared service over running work.
Report the exact blocker and next action briefly. Keep independent work moving.