{"record":{"id":"c67c042a4f597c3a","repo":"xai-org/grok-build","slug":"rehydrate-subagent-worktree-task-failed-e","errorCode":null,"errorMessage":"rehydrate_subagent_worktree task failed: {e}","messagePattern":"rehydrate_subagent_worktree task failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-workspace/src/worktree/mod.rs","lineNumber":1484,"sourceCode":"    dest: &Path,\n    source_repo: &Path,\n    snapshot_ref: &str,\n    session_id: Option<&str>,\n) -> Result<std::path::PathBuf> {\n    let dest = dest.to_path_buf();\n    let source_repo = source_repo.to_path_buf();\n    let snapshot_ref = snapshot_ref.to_string();\n    let session_id = session_id.map(str::to_owned);\n    let report = tokio::task::spawn_blocking(move || {\n        xai_fast_worktree::rehydrate_worktree_from_ref(\n            &dest,\n            &source_repo,\n            &snapshot_ref,\n            session_id.as_deref(),\n        )\n    })\n    .await\n    .map_err(|e| anyhow::anyhow!(\"rehydrate_subagent_worktree task failed: {e}\"))??;\n    Ok(report.worktree_path)\n}\n\n/// Snapshot a subagent worktree's working state into `ref_name` and make it\n/// durable in `source_repo`, returning the ref name to persist as\n/// `snapshot_ref`. Does NOT touch the directory: the caller persists the ref\n/// FIRST, then removes the worktree via [`remove_subagent_worktree`], so a\n/// failed (or not-yet-persisted) removal never strands a snapshot the resume\n/// path can't find.\n///\n/// Standalone worktrees keep the snapshot in their own `.git`, which is\n/// destroyed on removal, so after capturing, the snapshot is transferred into\n/// `source_repo` (which survives the worktree) and verified to resolve there\n/// before returning `Ok`. The blocking fast-worktree work runs on a blocking\n/// thread.\npub async fn snapshot_subagent_worktree(\n    worktree_path: &Path,\n    source_repo: &Path,","sourceCodeStart":1466,"sourceCodeEnd":1502,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-workspace/src/worktree/mod.rs#L1466-L1502","documentation":"Error \"rehydrate_subagent_worktree task failed: {e}\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-workspace/src/worktree/mod.rs:1484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}