Skip to content

fix(task-management): support git worktrees in router root detection#301

Open
discord9 wants to merge 1 commit intodarrenhinde:mainfrom
discord9:fix/task-management-worktree-support
Open

fix(task-management): support git worktrees in router root detection#301
discord9 wants to merge 1 commit intodarrenhinde:mainfrom
discord9:fix/task-management-worktree-support

Conversation

@discord9
Copy link
Copy Markdown

@discord9 discord9 commented Apr 1, 2026

Description

Fix task-management router project root detection for git worktrees.

I hit this while using OAC from a real git worktree. In that setup, .git is a file rather than a directory. The router only checked for .git as a directory, so project root detection failed inside the worktree. Because the script also runs with set -e, the fallback path could exit early, which made commands like status and validate return no output.

This change:

  • treats .git as either a directory or a file when detecting the project root
  • returns success from the fallback path so the router does not exit early under set -e
  • restores task-management CLI behavior inside git worktrees

Type of Change

  • Bug fix

Checklist

  • Tests pass locally
  • Documentation updated (if needed)
  • Follows CONTRIBUTING.md

Testing

Validated manually in both a normal repo checkout and a real git worktree where the issue was originally observed.

Commands tested:

  • bash .opencode/skills/task-management/router.sh status
  • bash .opencode/skills/task-management/router.sh validate

Before this change, the worktree case could exit with no output.
After this change, the router correctly finds .tmp/tasks and returns task status/validation results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant