Documentation
Compute plans and streams
View .mdOpenAPI

Consolidate superseded plans into a plan

POSThttps://weights.fyi/run/v1/compute/plans/{plan_id}/consolidatescope: submit
text
POST https://weights.fyi/run/v1/compute/plans/{plan_id}/consolidate
Authorization: Bearer <token>                    scope: submit
Content-Type: application/json
Available since
2026-11-08: included in this build; see What is live for deployment status.
Answer time
synchronous move and cancellation in one transaction; does not wait for running work to stop.

Moves the remaining work of your superseded plans into this plan and ends them. A workload submitted as one dated plan per day leaves a trail of plans, each holding its own pending or dead-lettered remainder. This call takes every pending, lazy and stashed pack of each superseded plan, and with retry_dead_lettered its dead-lettered packs too, and registers them on the matching stage of this plan as <superseded plan_id>.<pack_id>, in their original order. A live superseded plan is then cancelled as superseded; a completed or failed one keeps its state and records only that it was superseded.

The target stage is usually a continuous stream (workload.continuous: true): a sealed or completed continuous stage reopens to take the packs, and the plan returns to executing. A sealed stage that is not continuous refuses the call. Nothing moves from under a worker: a superseded plan still holding a live pack lease refuses the whole call, and nothing changes. Expired leases requeue first.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer token with submit.
plan_idpathyesIdentifier of the plan that takes the work. Its window must still be open.
superseded_plan_idsbodyyesNon-empty list of your plans in the same tenant, none of them this plan, none listed twice.
stage_mapbodynoObject mapping a superseded plan's stage identifier to this plan's stage identifier. Omitted, stages match by identifier.
retry_dead_letteredbodynoBoolean. true moves dead-lettered packs as fresh pending packs, with their dead-letter history kept.
reasonbodynoNon-empty string of at most 4,096 bytes, recorded on each cancellation. Omitted, it is superseded_by:<plan_id>.

Send a JSON object of at most 1 MiB with these fields only.

Return value

200 OK with the current plan receipt, whose outcome and coverage now count the moved packs, and a consolidation object: moved_packs, reopened_stages, reason, replayed, and superseded, one entry per listed plan with plan_id, from_state, cancelled, moved_packs, moved_dead_lettered and its per-stage moves.

Repeating the call for plans this plan already superseded moves nothing, records nothing and answers replayed: true. A plan another plan superseded is refused.

Each superseded plan records plan_superseded with superseded_by, moved_packs and moved_pack_ids; this plan records plan_consolidated, and stream_reopened for each stage it reopened. Moved packs carry metadata.moved_from.

Errors

StatusCodeMeaning
400invalid_json, invalid_compute_planInvalid JSON, identifiers, fields, or a superseded stage with no matching stage here.
401unauthorized, invalid_token, token_revoked, token_expiredSupply a valid token.
403scope_required, account_suspended, compute_tenancy_unauthorizedToken lacks submit, the account is suspended, or the tenant grant is gone.
404compute_plan_not_foundThis plan or a listed plan is absent or belongs to another account.
409compute_plan_conflictA live lease, a plan already superseded or cancelled, another tenant, a failed or cancelled target, or a sealed stage that is not continuous.
409compute_schedule_window_closedThis plan's window has closed; consolidate into a plan whose window is open.
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/consolidate \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{"superseded_plan_ids":["embeddings-20261104","embeddings-20261106"],"retry_dead_lettered":true,"reason":"one stream per workload"}'

Selected response fields:

json
{"plan_id":"embeddings","state":"executing","continuous":true,"stages":[{"stage_id":"embed","state":"ready_to_wake","stream_sealed":false,"continuous":true,"packs_total":46,"packs_completed":40,"packs_pending":6}],"consolidation":{"moved_packs":6,"reopened_stages":["embed"],"replayed":false,"superseded":[{"plan_id":"embeddings-20261104","from_state":"ready_to_wake","cancelled":true,"moved_packs":4,"moved_dead_lettered":0},{"plan_id":"embeddings-20261106","from_state":"failed","cancelled":false,"moved_packs":2,"moved_dead_lettered":1}]}}

History

  • 2026-11-08: documented consolidation of superseded plans into a continuous plan.

See also