Hmbown/CodeWhale · error

tmux runtime requires a non-empty command

Error message

tmux runtime requires a non-empty command

What it means

The tmux runtime's `start` validates that the lane start spec carries a non-empty command before doing any work. A tmux session must be created with a command to run; an empty command would produce a session that exits immediately or fails in tmux, so the runtime rejects it up front and fails closed before any registry or log mutation.

Solutions

  1. Pass a non-empty command in the `LaneStartSpec` (e.g. `command: vec!["bash".into()]`).
  2. Validate the spec at your config-loading/CLI layer before calling `start`, surfacing which flag/field was blank.
  3. If the command comes from a template, check the interpolated result is not empty after substitution.

Example fix

// before
let spec = LaneStartSpec { command: vec![], .. };

// after
let spec = LaneStartSpec { command: vec!["bash".into(), "-lc".into(), "make dev".into()], .. };
Defensive patterns

Strategy: validation

Validate before calling

if spec.command.is_empty() {
    return Err("lane command must be non-empty".into());
}

Type guard

fn has_command(spec: &LaneStartSpec) -> bool { !spec.command.is_empty() }

Prevention

When it happens

Trigger: Calling `LaneRuntime::start` with a `LaneStartSpec` whose `command` field is empty — typically constructed programmatically with a default/empty string, or deserialized from config/CLI where the command argument was omitted or blank.

Common situations: A CLI flag like `--command` forgotten or passed as an empty string; a config file with `command = ""`; a template that interpolates an unset variable into the command slot.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at crates/lane/src/runtime.rs:674

}

/// Durable local tmux sessions + attach + stream-json log file.
#[derive(Debug, Default)]
pub struct TmuxRuntime;

impl RuntimeBackend for TmuxRuntime {
    fn kind(&self) -> RuntimeBackendKind {
        RuntimeBackendKind::Tmux
    }

    fn start(
        &self,
        registry: &LaneRegistry,
        record: &mut LaneRecord,
        spec: &LaneStartSpec,
    ) -> Result<()> {
        if spec.command.is_empty() {
            bail!("tmux runtime requires a non-empty command");
        }
        // Dry-run is an explicit test hook only. A missing/broken tmux binary
        // must fail closed rather than persisting a fictional Running Lane.
        let dry_run = std::env::var_os("CODEWHALE_LANE_TMUX_DRY_RUN").is_some();
        if !dry_run && let Err(error) = ensure_tmux_available() {
            append_log_event(
                &record.log_path,
                serde_json::json!({
                    "type": "lane_failed",
                    "lane_id": record.id,
                    "runtime": "tmux",
                    "error": error.to_string(),
                }),
            )?;
            let _ = registry.mark_terminal_if_active(record, LaneStatus::Failed)?;
            return Err(error);
        }

View on GitHub (pinned to 73e0f67d83)