From a804e82c3832e96a0ff8865393b7b3fb0e77422c Mon Sep 17 00:00:00 2001 From: Auggie Date: Wed, 26 Nov 2025 15:16:11 +0100 Subject: [PATCH 1/2] Fix auggie workspace root in worktree mode - Add --workspace-root flag when running auggie in worktree mode (-w) - Ensures auggie operates within the isolated worktree directory instead of auto-detecting the main repository root - Fixes both single-agent and multi-agent modes - Preserves existing behavior for non-worktree usage Resolves issue where 'executable_yolo -w auggie' would run auggie in the wrong working directory. Signed-off-by: Lars Trieloff --- executable_yolo | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/executable_yolo b/executable_yolo index 9631e4d..a8ff8ca 100755 --- a/executable_yolo +++ b/executable_yolo @@ -1037,6 +1037,8 @@ run_multi_agents() { local flag_array=($flags) cmd_arr+=("${flag_array[@]}") fi + # Set workspace root to the current worktree path + cmd_arr+=("--workspace-root" "$YOLO_WORKTREE_PATH") if (( ${#common_args[@]} )); then local prompt_joined prompt_joined=$(printf '%s ' "${common_args[@]}"); prompt_joined=${prompt_joined%% } @@ -1702,6 +1704,11 @@ main() { full_command+=("${flag_array[@]}") fi + # If running in worktree mode, set workspace root to worktree path + if [[ "$use_worktree" == "true" && -n "$YOLO_WORKTREE_PATH" ]]; then + full_command+=("--workspace-root" "$YOLO_WORKTREE_PATH") + fi + # If prompt provided, use --print mode for automation if (( ${#command_args[@]} )); then local prompt_joined From 42a70107205d6190c22df5deeeb7b950a6ad9e5f Mon Sep 17 00:00:00 2001 From: Auggie Date: Wed, 26 Nov 2025 15:22:49 +0100 Subject: [PATCH 2/2] Fix multi-agent mode: add workspace-root after worktree creation - Move --workspace-root flag addition to after create_worktree() call - Ensures YOLO_WORKTREE_PATH is properly initialized before use - Follows same pattern as copilot's --add-dir flag - Fixes issue where workspace-root was empty/stale in multi-agent mode Addresses review feedback from cubic-dev-ai Signed-off-by: Lars Trieloff --- executable_yolo | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/executable_yolo b/executable_yolo index a8ff8ca..f88569e 100755 --- a/executable_yolo +++ b/executable_yolo @@ -1037,8 +1037,6 @@ run_multi_agents() { local flag_array=($flags) cmd_arr+=("${flag_array[@]}") fi - # Set workspace root to the current worktree path - cmd_arr+=("--workspace-root" "$YOLO_WORKTREE_PATH") if (( ${#common_args[@]} )); then local prompt_joined prompt_joined=$(printf '%s ' "${common_args[@]}"); prompt_joined=${prompt_joined%% } @@ -1075,6 +1073,12 @@ run_multi_agents() { cmd_arr+=(--add-dir "$YOLO_WORKTREE_PATH") fi + # If auggie, add --workspace-root to use the worktree directory + if [[ "$agent" == "auggie" ]]; then + # Set workspace root to the current worktree path + cmd_arr+=("--workspace-root" "$YOLO_WORKTREE_PATH") + fi + # Return to the original directory to continue creating more worktrees cd "$start_pwd"