Title#
feat: Make WorktreeService config-driven (base branch, branch prefix)
Problem#
WorktreeService had hardcoded origin/master and a hardcoded default 'feat' branch prefix, making branch management impossible to configure per tenant.
Task / Link#
Closes #354
Changes#
- Inject
TenantConfigServiceintoWorktreeServicevia constructor - Replace hardcoded
origin/masterwithorigin/${tenantConfig.defaultBaseBranch} - Replace hardcoded
branchPrefix = 'feat'default withtenantConfig.branchPrefix(caller-provided prefix still takes precedence) - Import
TenantModuleinWorktreeModule - Add
TenantConfigServicemock to unit tests; add test cases for non-default base branch (main) and config-driven prefix
Notes#
- 🔧 Also fixed pre-existing watchdog test failures caused by
STUCK_THRESHOLD_MSenv var being set to99999999in the agent environment — addedbeforeEach/afterEachto pin thresholds in tests so they are isolated from environment config
Testing#
- Unit tests: all 772 pass (including new worktree and tenant-config tests)
- Lint: clean
- Verified
origin/mainis used whendefaultBaseBranch: 'main'is configured - Verified explicit caller-provided
branchPrefixoverrides the config value