chore: add MERGE-DEBUG traces for project_root lifecycle
Temporary diagnostic logging to track why project_root becomes None during merge pipeline operations. Tagged with MERGE-DEBUG for easy grep-and-remove once the root cause is confirmed fixed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,9 +22,15 @@ impl Default for SessionState {
|
||||
impl SessionState {
|
||||
pub fn get_project_root(&self) -> Result<PathBuf, String> {
|
||||
let root_guard = self.project_root.lock().map_err(|e| e.to_string())?;
|
||||
let root = root_guard
|
||||
.as_ref()
|
||||
.ok_or_else(|| "No project is currently open.".to_string())?;
|
||||
let root = root_guard.as_ref().ok_or_else(|| {
|
||||
// TRACE:MERGE-DEBUG — remove once root cause is found
|
||||
crate::slog_error!(
|
||||
"[MERGE-DEBUG] get_project_root() called but project_root is None! \
|
||||
Backtrace hint: check caller in MCP tool handler."
|
||||
);
|
||||
"No project is currently open.".to_string()
|
||||
})?;
|
||||
Ok(root.clone())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user