xai-org/grok-build · error

linked Grove source: CreateWorktree declined; refusing copy

Error message

linked Grove source: CreateWorktree declined; refusing copy fallback

What it means

When the source is a linked Grove view (but not a projected mount) and a CreateWorktree request is declined upstream, the dispatcher refuses to silently fall back to a full copy (execute_copy_worktree). Copying out of a linked Grove source would duplicate gigabytes and break the link semantics, so it bails with this explicit refusal.

Source

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

                    // 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!(),
            }
        }
        CreationMode::GitCheckout => execute_git_checkout_worktree(plan),
    }
}

/// Whether the overlay strategy must be skipped, given the mount-namespace
/// classification.
///
/// An overlayfs mount is namespace-local and (unlike a btrfs snapshot) cannot be

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Investigate why the primary CreateWorktree path declined (check earlier log lines / decline reason) and fix that root cause.
  2. Re-create or repair the Grove link (relink the view) so the fast path succeeds.
  3. If a plain copy is truly desired, use a non-linked source directory rather than a Grove linked view.
  4. Skip the automatic fallback retry for linked-Grove sources instead of treating the decline as transient.

Example fix

// before: blind fallback retry loop
match create_worktree(plan) {
    Err(_) => retry_with_copy_fallback(plan),
    ...
}
// after
match create_worktree(plan) {
    Err(e) if !is_linked_grove(&plan.source) => retry_with_copy_fallback(plan),
    Err(e) => return Err(e),
    ...
}
Defensive patterns

Strategy: fallback

Validate before calling

// only attempt plain copy when the source is not a Grove linked view
if is_linked_grove_view(&source) {
    return Err(anyhow::anyhow!(
        "won't copy-fallback from linked Grove source {source:?}"
    ));
}

Try / catch

match create_worktree(plan) {
    Err(e) if e.to_string().contains("refusing copy fallback") => {
        // don't blindly retry copy; repair the link or surface to the caller
        repair_grove_link(&plan.source)?;
        create_worktree(plan).context("create failed after link repair")
    }
    other => other,
}

Prevention

When it happens

Trigger: execute_create_worktree_dispatch called with linked_view == true (source is a linked Grove view) and the primary creation path declined, reaching the else-branch that would otherwise perform a copy fallback.

Common situations: Automation that retries failed worktree creations with a fallback strategy; a Grove link that became stale/unhealthy causing the fast path to decline; misconfigured source pointing at a linked view instead of the real repository.

Related errors


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