fix: allow MCP tools to access merge_workspace so mergemaster can fix conflicts
The permission lockdown restricted run_command/run_tests to .huskies/worktrees/ only. The mergemaster could diagnose merge conflict compile errors but couldn't edit files in .huskies/merge_workspace/ to fix them. Add merge_workspace as an allowed path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -83,9 +83,17 @@ fn validate_working_dir(working_dir: &str, ctx: &AppContext) -> Result<PathBuf,
|
|||||||
return Err("No worktrees directory found in project".to_string());
|
return Err("No worktrees directory found in project".to_string());
|
||||||
};
|
};
|
||||||
|
|
||||||
if !canonical_wd.starts_with(&canonical_wt) {
|
// Also allow the merge workspace so mergemaster can fix conflicts.
|
||||||
|
let merge_workspace = project_root.join(".huskies").join("merge_workspace");
|
||||||
|
let canonical_mw = merge_workspace
|
||||||
|
.canonicalize()
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
if !canonical_wd.starts_with(&canonical_wt)
|
||||||
|
&& !(!canonical_mw.as_os_str().is_empty() && canonical_wd.starts_with(&canonical_mw))
|
||||||
|
{
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
"working_dir must be inside .huskies/worktrees/. Got: {working_dir}"
|
"working_dir must be inside .huskies/worktrees/ or .huskies/merge_workspace/. Got: {working_dir}"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user