AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-354
  5. changes
  6. pr_description.md
pr_description.md(1.2 KB)· Apr 9, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

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 TenantConfigService into WorktreeService via constructor
  • Replace hardcoded origin/master with origin/${tenantConfig.defaultBaseBranch}
  • Replace hardcoded branchPrefix = 'feat' default with tenantConfig.branchPrefix (caller-provided prefix still takes precedence)
  • Import TenantModule in WorktreeModule
  • Add TenantConfigService mock 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_MS env var being set to 99999999 in the agent environment — added beforeEach/afterEach to 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/main is used when defaultBaseBranch: 'main' is configured
  • Verified explicit caller-provided branchPrefix overrides the config value
PrdAgent-runner