{"record":{"id":"d12e0749576bdf7e","repo":"xai-org/grok-build","slug":"repository-root-does-not-exist-ensure-the-re","errorCode":null,"errorMessage":"Repository root '{}' does not exist. Ensure the repo is cloned before calling rehydrate.","messagePattern":"Repository root '(.+?)' does not exist\\. Ensure the repo is cloned before calling rehydrate\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shell/src/session/worktree.rs","lineNumber":463,"sourceCode":"        updates_copied: fork_resp.updates_copied,\n        code_restored,\n        restore_summary,\n        restore_degree,\n    })\n}\n/// Orchestrate session rehydration: recreate the git worktree at the exact\n/// path and restore all session state using the original session ID.\n///\npub(crate) async fn rehydrate_session_in_worktree(\n    req: &RehydrateSessionRequest,\n    #[allow(unused_variables)] ops: &xai_grok_workspace::WorkspaceOps,\n    registry_client: Option<&crate::agent::session_registry_client::SessionRegistryClient>,\n) -> Result<RehydrateSessionResponse> {\n    let worktree_path_str = req.worktree_path.as_deref().unwrap_or(&req.source_cwd);\n    let repo_root = Path::new(&req.repo_root);\n    let worktree_path = Path::new(worktree_path_str);\n    if !repo_root.exists() {\n        anyhow::bail!(\n            \"Repository root '{}' does not exist. \\\n             Ensure the repo is cloned before calling rehydrate.\",\n            req.repo_root\n        );\n    }\n    let session_summary_exists = crate::util::grok_home::sessions_cwd_dir(&req.source_cwd)\n        .join(&req.session_id)\n        .join(\"summary.json\")\n        .exists();\n    if worktree_path.exists() && session_summary_exists {\n        tracing::info!(\n            session_id = %req.session_id,\n            worktree_path = %worktree_path_str,\n            \"rehydrate: worktree and session state already exist, skipping\"\n        );\n        return Ok(RehydrateSessionResponse {\n            session_id: req.session_id.clone(),\n            worktree_path: worktree_path_str.to_string(),","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shell/src/session/worktree.rs#L445-L481","documentation":"Error \"Repository root '{}' does not exist. Ensure the repo is cloned before calling rehydrate.\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-shell/src/session/worktree.rs:463 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"}