Hmbown/CodeWhale · error

SSH Fleet workers do not yet support nested workspace.root v

Error message

SSH Fleet workers do not yet support nested workspace.root values; task cwd '{}' cannot be mapped safely beneath the remote working_directory

What it means

For SSH fleet hosts, the worker's remote cwd is mapped directly onto the configured remote working_directory; only a task cwd equal to the resolved workspace root can be mapped safely. If task_cwd differs from resolve_strict_authority_path(workspace, "."), the run is refused rather than guessing a remote path.

Source

Thrown at crates/tui/src/fleet/manager.rs:2376

            .lines()
            .all(|line| line.starts_with("- ") && line.len() <= 512)
}

fn validate_task_cwd_for_host(
    workspace: &Path,
    host: &FleetHostSpec,
    task_cwd: &Path,
) -> Result<()> {
    if !matches!(host, FleetHostSpec::Ssh { .. }) {
        return Ok(());
    }
    let workspace_root = crate::tools::spec::resolve_strict_authority_path(
        &crate::tools::ToolContext::new(workspace.to_path_buf()),
        ".",
    )
    .map_err(anyhow::Error::new)?;
    if task_cwd != workspace_root {
        bail!(
            "SSH Fleet workers do not yet support nested workspace.root values; task cwd '{}' cannot be mapped safely beneath the remote working_directory",
            task_cwd.display()
        );
    }
    Ok(())
}

fn task_receipt_outcome(
    payload: &FleetWorkerEventPayload,
    exit_code: Option<i32>,
) -> (FleetTaskResult, Option<FleetTaskFailureKind>, Option<i32>) {
    match payload {
        FleetWorkerEventPayload::Completed {
            exit_code: payload_exit_code,
            ..
        } => (
            FleetTaskResult::Pass,
            None,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Set the task cwd to the workspace root ("." / omit cwd) for SSH hosts
  2. Flatten workspace.root so the task cwd equals the root
  3. Use a local (non-SSH) host if nested cwds are a hard requirement
  4. Track the feature request rather than symlinking around it on the remote

Example fix

# before (task.toml, SSH host)
[[tasks]]
objective = "fix tests"
cwd = "crates/tui"

# after
[[tasks]]
objective = "fix tests"
cwd = "."
Defensive patterns

Strategy: validation

Validate before calling

fn task_cwd_ok_for_ssh(task_cwd: &std::path::Path, workspace_root: &std::path::Path) -> bool {
    task_cwd == workspace_root
}

// before starting an SSH-hosted run:
assert!(task_cwd_ok_for_ssh(&task.cwd, &workspace_root),
    "SSH fleet tasks must run at the workspace root");

Try / catch

match fleet_manager.start_run(&spec) {
    Ok(run) => Ok(run),
    Err(err) if err.to_string().contains("nested workspace.root") => {
        eprintln!("set task cwd to the workspace root or use a local host");
        Err(err)
    }
    Err(err) => Err(err),
}

Prevention

When it happens

Trigger: Starting an SSH fleet run whose task spec sets cwd to a subdirectory (or any path other than the workspace root), e.g. cwd = "crates/tui" with an SSH host.

Common situations: Copying a local fleet task spec that used a nested cwd to an SSH host config; setting workspace.root to a nested value while tasks default cwd elsewhere.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/4ea5dbf7dd5b7b02. Report an issue: GitHub.