Commit 6f40d1d
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. For non-git projects (LocalRuntime),
git commands are wrapped in try-catch to fall back to "main".
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 6f40d1d
1 file changed
+18
-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 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
489 | 504 | | |
490 | 505 | | |
491 | 506 | | |
| |||
0 commit comments