Commit b704d7c
committed
🤖 fix: validate trunkBranch exists before sub-agent workspace creation
When forkWorkspace() fails during task creation, the fallback logic
used parentMeta.name directly as the trunkBranch for git worktree
creation. This fails when the parent's branch doesn't exist locally
(e.g., SSH workspaces, or branches that were never fetched).
The fix validates that trunkBranch exists as a local branch before
using it, falling back to the repository's default trunk branch
(main/master/etc) if not found.
Fixes the cosmetic error:
fatal: 'git-debounce-5w4e' is not a commit and a branch
'agent_explore_7eeffc7df6' cannot be created from it1 parent 7010f8d commit b704d7c
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
486 | | - | |
487 | | - | |
488 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
489 | 500 | | |
490 | 501 | | |
491 | 502 | | |
| |||
0 commit comments