Skip to main content

generate_commit_message_with_chain

Function generate_commit_message_with_chain 

Source
pub fn generate_commit_message_with_chain(
    diff: &str,
    registry: &AgentRegistry,
    runtime: &mut PipelineRuntime<'_>,
    agents: &[String],
    template_context: &TemplateContext,
    workspace: &dyn Workspace,
    prompt_history: &HashMap<String, String>,
) -> Result<CommitMessageResult>
Expand description

Generate a commit message with fallback chain support.

Tries each agent in the chain sequentially until one succeeds. Uses the minimum budget across all agents in the chain for truncation to ensure the diff fits all potential fallback agents.

§Arguments

  • diff - The diff to generate a commit message for
  • registry - Agent registry for resolving agent configs
  • runtime - Pipeline runtime for execution
  • agents - Chain of agents to try in order (first agent tried first)
  • template_context - Template context for prompt generation
  • workspace - Workspace for file operations
  • prompt_history - History of prompts for replay detection

§Returns

  • Ok(CommitMessageResult) - If any agent in the chain succeeds
  • Err - If all agents in the chain fail