xai-org/grok-build · error

preserve on a projected Grove source is not supported

Error message

preserve on a projected Grove source is not supported

What it means

In execute_create_worktree_dispatch, when the plan's source is detected as a projected NFS/Grove mount (dest_is_projected_mount) and the requested working-tree mode is PreserveWorkingTree, the library refuses to proceed. Projected (lazily-materialized) sources cannot be 'preserved' because their files are not fully materialized on disk, so copy/preserve semantics are undefined; the call fails fast instead of producing a broken worktree.

Source

Thrown at crates/codegen/xai-fast-worktree/src/worktree/execute.rs:350

                    reasons = skipped_reasons.join("; "),
                    "using file copy fallback (fast paths failed)"
                );
            }

            match &plan.creation_mode {
                CreationMode::Linked => {
                    // Status-confirmed linked Grove views must not copy the
                    // projection (hang / projected state) when CreateWorktree
                    // declines. Preserve fails; projected+clean may git-checkout.
                    let linked_view = plan.nfs.as_ref().is_some_and(|opts| {
                        crate::nfs::source_is_linked_local_view(opts, &plan.source)
                    });
                    if crate::nfs::dest_is_projected_mount(&plan.source) {
                        if matches!(
                            plan.working_tree,
                            crate::WorkingTreeMode::PreserveWorkingTree
                        ) {
                            anyhow::bail!("preserve on a projected Grove source is not supported");
                        }
                        tracing::info!(
                            source = %plan.source.display(),
                            "projected source: skipping copy fallback, using git checkout"
                        );
                        execute_git_checkout_worktree(plan)
                    } else if linked_view {
                        anyhow::bail!(
                            "linked Grove source: CreateWorktree declined; refusing copy fallback"
                        );
                    } else {
                        execute_copy_worktree(plan)
                    }
                }
                CreationMode::Standalone => execute_standalone_worktree(plan),
                _ => unreachable!(),
            }
        }

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Set plan.working_tree to a non-preserve mode (e.g. default checkout) when the source is projected.
  2. Re-issue the CreateWorktree request without PreserveWorkingTree; the dispatcher will use git checkout for projected sources.
  3. If preserve is genuinely required, use a fully-materialized (non-projected) source directory.

Example fix

// before
plan.working_tree = WorkingTreeMode::PreserveWorkingTree; // source is projected Grove
// after
if crate::nfs::dest_is_projected_mount(&source) {
    plan.working_tree = WorkingTreeMode::GitCheckout;
}
Defensive patterns

Strategy: validation

Validate before calling

if crate::nfs::dest_is_projected_mount(&source)
    && mode == crate::WorkingTreeMode::PreserveWorkingTree {
    return Err(anyhow::anyhow!(
        "preserve is unsupported for projected source {source:?}; use a checkout mode"
    ));
}

Try / catch

match create_worktree(plan) {
    Err(e) if e.to_string().contains("preserve on a projected") => {
        let mut plan = plan.clone();
        plan.working_tree = WorkingTreeMode::GitCheckout;
        create_worktree(&plan).context("fallback checkout also failed")?
    }
    other => other,
}

Prevention

When it happens

Trigger: Creating a worktree whose plan.source points at a projected Grove mount while plan.working_tree == WorkingTreeMode::PreserveWorkingTree.

Common situations: Reusing an existing CreateWorktree request template that had preserve mode enabled, then pointing it at a Grove/NFS-projected source; a workload migrated from a normal checkout to a projected Grove source without updating the working-tree mode.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/0c945a52a2223b4c. Report an issue: GitHub.