aaif-goose/goose · error · anyhow::Error

On_failure command timed out after {:?}: {}

Error message

On_failure command timed out after {:?}: {}

What it means

Error "On_failure command timed out after {:?}: {}" thrown in aaif-goose/goose.

Source

Thrown at crates/goose/src/agents/retry.rs:296

pub async fn execute_on_failure_command_with_timeout(
    command: &str,
    timeout: Duration,
) -> Result<()> {
    info!(
        "Executing on_failure command with timeout {:?}: {}",
        timeout, command
    );

    let output = match execute_shell_command(command, timeout).await {
        Ok(output) => output,
        Err(e) => {
            if e.to_string().contains("timed out") {
                let error_msg = format!(
                    "On_failure command timed out after {:?}: {}",
                    timeout, command
                );
                warn!("{}", error_msg);
                return Err(anyhow::anyhow!(error_msg));
            } else {
                warn!("On_failure command execution error: {}", e);
                return Err(e);
            }
        }
    };

    if !output.status.success() {
        let error_msg = format!(
            "On_failure command failed: command '{}' exited with status {}, stderr: {}",
            command,
            output.status,
            String::from_utf8_lossy(&output.stderr)
        );
        warn!("{}", error_msg);
        return Err(anyhow::anyhow!(error_msg));
    } else {
        info!("On_failure command completed successfully: {}", command);

View on GitHub (pinned to 3810898a74)

When it happens

Trigger: Thrown at crates/goose/src/agents/retry.rs:296 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/40c17550b92b737c. Report an issue: GitHub.