From 0879d0493b626d8ad1e1b8dc4f700131ac2debbd Mon Sep 17 00:00:00 2001 From: discord9 Date: Wed, 15 Jul 2026 07:53:00 +0800 Subject: [PATCH] fix(task-management): support git worktrees in router root detection (#301) find_project_root used [ -d "$dir/.git" ], which fails in a git worktree where .git is a file containing a gitdir: pointer rather than a directory. Switches to -e (a strict superset, so the normal-repo case is unaffected; submodules are fixed for free). Also changes return 1 to return 0 in the fallback branch: PROJECT_ROOT="$(find_project_root)" takes the command substitution's exit status, so under set -e the script aborted after the fallback value had already been computed, producing silent no-output. Mainly affects non-Node projects consuming OAC from a worktree; this repo's root package.json masks the bug. --- .opencode/skills/task-management/router.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.opencode/skills/task-management/router.sh b/.opencode/skills/task-management/router.sh index 712c952..e52a813 100755 --- a/.opencode/skills/task-management/router.sh +++ b/.opencode/skills/task-management/router.sh @@ -72,14 +72,14 @@ find_project_root() { local dir dir="$(pwd)" while [ "$dir" != "/" ]; do - if [ -d "$dir/.git" ] || [ -f "$dir/package.json" ]; then + if [ -e "$dir/.git" ] || [ -f "$dir/package.json" ]; then echo "$dir" return 0 fi dir="$(dirname "$dir")" done pwd - return 1 + return 0 } # Handle help