Summary
When git worktree add creates a new worktree from a monorepo that uses git submodules, the submodule directories in the new worktree are empty. Archon does not run git submodule update --init after worktree creation, so any workflow that needs to operate on submodule content will find empty directories.
Root Cause
WorktreeProvider.createWorktree() (packages/isolation/src/providers/worktree.ts) calls git worktree add without --recurse-submodules, and no git submodule update --init is run afterward. Git's default worktree add behavior creates the .gitmodules file but leaves submodule directories empty.
Expected Behavior
After worktree creation, submodules should be initialized and checked out so that workflows can operate on the full monorepo content.
Suggested Fix
After git worktree add succeeds in createNewBranch(), run:
git -C <worktreePath> submodule update --init --recursive
This should be conditional — only when the repo has a .gitmodules file — to avoid unnecessary overhead for repos without submodules. Consider making it configurable via .archon/config.yaml (worktree.initSubmodules: true/false).
Related
🤖 Generated with Claude Code
Summary
When
git worktree addcreates a new worktree from a monorepo that uses git submodules, the submodule directories in the new worktree are empty. Archon does not rungit submodule update --initafter worktree creation, so any workflow that needs to operate on submodule content will find empty directories.Root Cause
WorktreeProvider.createWorktree()(packages/isolation/src/providers/worktree.ts) callsgit worktree addwithout--recurse-submodules, and nogit submodule update --initis run afterward. Git's defaultworktree addbehavior creates the.gitmodulesfile but leaves submodule directories empty.Expected Behavior
After worktree creation, submodules should be initialized and checked out so that workflows can operate on the full monorepo content.
Suggested Fix
After
git worktree addsucceeds increateNewBranch(), run:This should be conditional — only when the repo has a
.gitmodulesfile — to avoid unnecessary overhead for repos without submodules. Consider making it configurable via.archon/config.yaml(worktree.initSubmodules: true/false).Related
🤖 Generated with Claude Code