Skip to main content

task_rekick

Function task_rekick 

Source
pub async fn task_rekick(
    __arg0: State<AppState>,
    __arg1: Path<String>,
    body: Option<Json<RunKickRequest>>,
) -> Result<(StatusCode, Json<RunKickResponse>), ApiError>
Expand description

POST /v1/tasks/:id/runs. Re-kicks an existing Task: reads its stored blueprint_ref, re-resolves it through [TaskApplication::resolve] (issue #19 ST4 — refreshes Blueprint.default_init_ctx exactly like original launch time, rather than replaying a launch-time-only snapshot), 3-layer-merges {bp default, TaskRecord.input_ctx, an optional per-Run override} via merge_init_ctx_3layer, resolves the Task-level canonical fields (RunKickRequest.task_input_override, falling back to TaskRecord.task_input_spec), mints a fresh RunId, dispatches through TaskApplication::handle_with_run (the unadorned Operator-default path — no per-request Operator override support here, unlike POST /v1/tasks; the stored Task carries no such preferences) plus a freshly-built RunContext (issue #13 run_id propagation, so this kick’s steps get their own step_entries trace), and persists the outcome via [finalize_run].

The body is optional (Option<Json<RunKickRequest>>) — no body, or a body with both fields absent, preserves the pre-#19 rekick behavior byte-for-byte (must_not_simplify #3).