Documentation
Compute plans and streams
View .mdOpenAPI

Fail a harness stage

POSThttps://weights.fyi/run/v1/compute/plans/{plan_id}/stages/{stage_id}/failscope: submit
text
POST https://weights.fyi/run/v1/compute/plans/{plan_id}/stages/{stage_id}/fail
Authorization: Bearer <token>                    scope: submit
Content-Type: application/json
Available since
2026-10-28: included in this build; see What is live for deployment status.
Answer time
synchronous failure commit, cancellation of dependent stages and scheduling refresh.

Reports that an active awow_harness_lease stage ended unsuccessfully, with a reason. The plan must be executing and the stage must hold an active harness lease. The reason's first word decides what happens: a transient platform fault is retried, a credit hold waits, anything else is terminal (table below).

A terminal failure is scoped to dependencies, not to the plan. The stage becomes failed and every stage that needs it, directly or through other stages, becomes cancelled. Independent sibling tracks keep their leases and run on, and completed stages stay completed. The plan stays executing until its last stage ends; it then settles failed.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer token with submit; use the account token.
plan_id, stage_idpathyesYour plan and its active harness stage.
reasonJSON bodyyesString with non-whitespace content, at most 4,096 UTF-8 bytes. Stored as sent.

The body must be a JSON object of at most 1 MiB. Other fields are ignored. The reason is validated even when the stage or plan has already ended.

Reason starts withWhat happens
INPUT_STAGING_FAILED, PLATFORM_OOMA transient platform fault, retried automatically. While the stage has attempts left under workload.max_attempts (default 3) it returns to ready_to_wake for another lease, its siblings untouched. The scoped token is revoked and a stage_lease_released event carries reason, error, failure_count, max_attempts and transient_platform_failure: true. The failure that uses the last attempt is terminal.
no_credit, credit_exhausted, token_daily_cap, also after HTTP 402:A credit hold, not a failure. The stage returns to ready_to_wake without spending an attempt and wakes again once credit or the daily cap allows. The event carries credit_hold: true, waiting_for and readiness.
Anything elseTerminal. The stage is failed, its unfinished packs are cancelled, its scoped token is revoked and a stage.failed event records the error. Its transitive dependents are cancelled, each with a stage.cancelled event.

The code must open the reason (PLATFORM_OOM, PLATFORM_OOM: detail); a code named later in the text is read as ordinary text.

Return value

200 OK with the current plan receipt. Its stages[].failure carries the stored detail:

Stagefailure
The failed stage{"status": "failed", "reason": "<your reason>", "error": "<your reason>"}
A cancelled dependent{"status": "cancelled", "reason": "dependency_failed", "source_stage_id": "<the failed stage>"}
A requeued or held stage, and every untouched stagenull

If either the stage or plan is already completed, failed or cancelled, a valid request returns the current receipt without changing the outcome or overwriting the first reason. This includes retries with a different valid reason.

Errors

StatusCodeMeaning
400invalid_json, invalid_compute_planInvalid JSON, body, identifier or reason.
401unauthorized, invalid_token, token_revoked, token_expiredSupply a valid account token.
403scope_required, account_suspendedToken lacks submit, or the account is suspended.
404compute_plan_not_found, compute_stage_not_foundPlan or stage is absent or inaccessible to this account.
409compute_plan_conflictNo active harness lease, or this stage is service-managed.
413body_too_largeBody exceeds 1 MiB.
429rate_limitedWait for Retry-After before retrying.

Examples

sh
curl -s https://weights.fyi/run/v1/compute/plans/PLAN_ID/stages/STAGE_ID/fail \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{"reason":"The coding suite exceeded its deadline."}'

Selected response fields. review needs sessions and is cancelled; the independent audit stage runs on, so the plan is still executing:

json
{"plan_id":"example-plan","state":"executing","stages":[{"stage_id":"sessions","state":"failed","needs":[],"failure":{"status":"failed","reason":"The coding suite exceeded its deadline.","error":"The coding suite exceeded its deadline."}},{"stage_id":"review","state":"cancelled","needs":["sessions"],"failure":{"status":"cancelled","reason":"dependency_failed","source_stage_id":"sessions"}},{"stage_id":"audit","state":"lease_ready","needs":[],"failure":null}],"last_event_seq":44}

History

  • 2026-10-28: documented harness failure, branch cancellation and terminal retries.
  • 2026-11-16: corrected to dependency-scoped failure; documented automatic retry of transient platform faults, credit holds and stages[].failure.

See also