xai-org/grok-build · error
remove_subagent_worktree task failed: {e}
Error message
remove_subagent_worktree task failed: {e} What it means
Error "remove_subagent_worktree task failed: {e}" thrown in xai-org/grok-build.
Source
Thrown at crates/codegen/xai-grok-workspace/src/worktree/mod.rs:1533
})
.await
.map_err(|e| anyhow::anyhow!("snapshot_subagent_worktree task failed: {e}"))?
}
/// Remove a subagent worktree directory. Call only AFTER
/// [`snapshot_subagent_worktree`] succeeded and its ref was persisted, so a
/// removal failure is safe to treat as best-effort (the durable ref already
/// backs resume). The blocking fast-worktree work runs on a blocking thread.
pub async fn remove_subagent_worktree(worktree_path: &Path) -> Result<()> {
let worktree_path = worktree_path.to_path_buf();
// On rootless hosts the snapshot delete needs the privileged helper; without
// the delegate the btrfs delete hits EPERM and the snapshot leaks.
let delegate = btrfs_delegate_from_env();
tokio::task::spawn_blocking(move || {
xai_fast_worktree::remove_worktree_with_delegate(&worktree_path, delegate)
})
.await
.map_err(|e| anyhow::anyhow!("remove_subagent_worktree task failed: {e}"))??;
Ok(())
}
/// Test-only thin wrapper: snapshot then remove (capture-first). NOT for
/// production use: the completion path drives [`snapshot_subagent_worktree`] and
/// [`remove_subagent_worktree`] separately so it can persist the ref between the
/// two steps (removing without persisting first is a crash-safety footgun).
#[cfg(test)]
async fn snapshot_and_remove_subagent_worktree(
worktree_path: &Path,
source_repo: &Path,
ref_name: &str,
) -> Result<String> {
let snapshot_ref = snapshot_subagent_worktree(worktree_path, source_repo, ref_name).await?;
remove_subagent_worktree(worktree_path).await?;
Ok(snapshot_ref)
}
View on GitHub (pinned to bc7f02eddd)
When it happens
Trigger: Thrown at crates/codegen/xai-grok-workspace/src/worktree/mod.rs:1533 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/9d4c78a41d378fb4.
Report an issue: GitHub.