Hmbown/CodeWhale · error

{}: {detail}

Error message

{}: {detail}

What it means

After running a lane operation, this check converts an error receipt into a Rust error: if `receipt.is_error()`, it fails with `<operation_id>: <detail>`, where detail is the receipt's `failure` string or, failing that, its raw outcome string. It is the generic propagation point for any failed lane backend operation (create, reconcile, control, etc.).

Solutions

  1. Read the `<detail>` after the operation id — it carries the underlying backend failure — and fix that root cause.
  2. Re-run the lane operation after repairing state (e.g. `codewhale lane --status` / reconcile).
  3. If the detail is just the outcome string (no failure text), enable verbose logging or inspect lane state files for the real cause.

Example fix

// before: lane op fails with `op-42: tmux session missing`
codewhale lane control resume op-42
// after: reconcile/repair first, then retry
codewhale lane --status
codewhale lane control resume op-42
Defensive patterns

Strategy: try-catch

Try / catch

match codewhale::run_lane_op(op) {
    Err(e) => {
        let (op_id, detail) = parse_receipt_error(&e.to_string());
        eprintln!("lane op {op_id} failed: {detail}");
        // inspect/repair then retry
    }
    Ok(v) => v,
}

Prevention

When it happens

Trigger: Any lane operation whose receipt comes back as an error — backend failure during lane creation/reconciliation/control, an operation id whose execution failed, or a receipt with no `failure` detail but an error outcome string.

Common situations: Underlying tmux/git/lane-runtime failures bubbling up; stale lane state that fails reconciliation; a lane operation invoked twice and rejected on the second run.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/3a361e5da9dc8b52. Report an issue: GitHub.

Appendix: source

Thrown at crates/cli/src/lib.rs:904

                // `lane status --json <bad-id> | jq` succeed where it used to
                // fail. Stay silent and let the bail! below set the exit code.
                None if receipt.is_error() => {}
                None => println!("{}", serde_json::to_string_pretty(receipt)?),
            },
            _ => println!("{}", serde_json::to_string_pretty(receipt)?),
        }
    } else if receipt.is_error() {
        eprintln!("{}", receipt.render());
    } else {
        println!("{}", receipt.render());
    }
    if receipt.is_error() {
        let detail = receipt
            .failure
            .as_ref()
            .map(ToString::to_string)
            .unwrap_or_else(|| receipt.outcome.as_str().to_string());
        bail!("{}: {detail}", receipt.operation_id);
    }
    Ok(())
}

fn run_lane_control(
    operation: codewhale_lane::ControlOperation,
    lane_id: Option<&str>,
    json: bool,
) -> Result<()> {
    let receipt = codewhale_lane::control::execute_lane_control(
        codewhale_lane::ControlSurface::Cli,
        operation,
        lane_id,
    );
    emit_control_receipt(&receipt, json)
}

fn run_lane_command(args: LaneArgs) -> Result<()> {

View on GitHub (pinned to 73e0f67d83)