You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/multi-agent-containers-workflow.md
+51-4Lines changed: 51 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,13 +62,16 @@ The script will:
62
62
-`-OpenVSCode` - launches a VS Code window per agent with `FW_AGENT_CONTAINER` set
63
63
64
64
The script will:
65
-
- Create worktrees at `...\worktrees\agent-1..N` with branches `agents/agent-1..N`
65
+
- Create NEW worktrees at `...\worktrees\agent-1..N` with branches `agents/agent-1..N` from BaseRef
66
+
-**SKIP existing worktrees** (preserves your work - never resets or modifies existing worktrees)
66
67
- Build or reuse the `fw-build:ltsc2022` Windows image
67
-
- Start containers `fw-agent-1..N` with per-agent NuGet caches
68
-
- Generate `.vscode/tasks.json` wired to the matching container
68
+
- Start containers `fw-agent-1..N` with per-agent NuGet caches (skipped for existing worktrees)
69
+
- Generate `.vscode/tasks.json` wired to the matching container (only for new worktrees)
69
70
- Generate `.vscode/settings.json` with unique colors to keep agent windows visually distinct
70
71
- Optionally open each worktree in a new VS Code window
71
72
73
+
**IMPORTANT**: This script **NEVER modifies existing worktrees** to prevent data loss. If you want to reset a worktree to a different branch, use `tear-down-agents.ps1 -RemoveWorktrees` first, then re-run spin-up.
74
+
72
75
3. Work per agent
73
76
74
77
- Open the worktree folder in VS Code (one window per agent)
@@ -84,6 +87,16 @@ All registry and COM operations occur inside the container, isolated from your h
throw"Directory $target exists but is not a registered worktree. Close any VS Code windows, run tear-down with -RemoveWorktrees, or rerun spin-up with -ForceCleanup to reset it."
314
-
}
315
-
316
-
Write-Host"Directory $target exists but is not registered; reinitializing worktree in place (contents will be reset)."
Write-Warning"Worktree agent-$i has uncommitted changes; content will remain but tracking will be detached (use -ForceRemoveDirty to skip this warning)."
198
+
throw@"
199
+
Worktree agent-$i has uncommitted changes at: $wtPath
200
+
201
+
To protect your work, tear-down will NOT remove this worktree.
202
+
203
+
Options:
204
+
1. Commit or stash your changes in the worktree, then re-run tear-down
205
+
2. Push your changes to a remote branch for safekeeping
206
+
3. Use -ForceRemoveDirty to override (WARNING: This will DELETE uncommitted work)
207
+
208
+
To check what's uncommitted:
209
+
cd '$wtPath'
210
+
git status
211
+
"@
195
212
}
196
-
Write-Host"Detaching worktree agent-$iwhile leaving $wtPath on disk."
0 commit comments