Skip to main content

run_commit_attempt

Function run_commit_attempt 

Source
pub fn run_commit_attempt(
    ctx: &mut PhaseContext<'_>,
    attempt: u32,
    model_safe_diff: &str,
    commit_agent: &str,
) -> Result<CommitAttemptResult>
Expand description

Run a single commit generation attempt with explicit agent and prompt.

This does not perform in-session XSD retries. If validation fails, the caller should emit a MessageValidationFailed event and let the reducer decide retry/fallback behavior.

IMPORTANT: The model_safe_diff parameter must be pre-truncated to the effective model budget. Use the reducer’s MaterializeCommitInputs effect to truncate the diff before calling this function. The reducer writes the model-safe diff to .agent/tmp/commit_diff.model_safe.txt.