AgentWorkflowRun status currently snapshots only stage names from the AgentWorkflow. The AgentRef and Instructions for each stage are read from the live AgentWorkflow spec at execution time. If the workflow is mutated mid-run (stage Agent changed, instructions updated), the running workflow silently picks up the new values for subsequent stages.
Proposed change
Snapshot the full stage definitions (name, agentRef, instructions) into status.stages at initialization time. The controller should read from the snapshot during execution, not from the live workflow spec.
Tradeoff
This adds data to the status subresource and makes the snapshot the source of truth. The benefit is deterministic execution — a workflow run always uses the definitions it started with, regardless of subsequent workflow edits.
References
AgentWorkflowRun status currently snapshots only stage names from the AgentWorkflow. The AgentRef and Instructions for each stage are read from the live AgentWorkflow spec at execution time. If the workflow is mutated mid-run (stage Agent changed, instructions updated), the running workflow silently picks up the new values for subsequent stages.
Proposed change
Snapshot the full stage definitions (name, agentRef, instructions) into
status.stagesat initialization time. The controller should read from the snapshot during execution, not from the live workflow spec.Tradeoff
This adds data to the status subresource and makes the snapshot the source of truth. The benefit is deterministic execution — a workflow run always uses the definitions it started with, regardless of subsequent workflow edits.
References
agentworkflowrun_controller.golines 130-145