Skip to main content

apply_task_update

Function apply_task_update 

Source
pub fn apply_task_update(
    task: &mut SessionTask,
    update: SessionTaskUpdate,
    now: DateTime<Utc>,
)
Expand description

Apply a partial update to a task, enforcing lifecycle invariants.

All registry backends route updates through this function so semantics stay identical across PostgreSQL, in-memory, and gRPC modes:

  • terminal states are final: state changes on a terminal task are ignored (content fields like summary/result still apply);
  • first transition out of queued stamps started_at;
  • transition into a terminal state stamps finished_at;
  • setting input_request forces awaiting_input; leaving awaiting_input clears it.