Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ When the user says **"Run the SDK update audit"** or updates the SDK NuGet packa

### Mac Catalyst (primary dev target)
```bash
./relaunch.sh # Build + async hot-relaunch (ALWAYS use this after code changes)
./relaunch.sh --sync # Build + blocking relaunch (for interactive terminal use only)
PolyPilot/relaunch.sh # Build + async hot-relaunch (ALWAYS use this after code changes)
PolyPilot/relaunch.sh --sync # Build + blocking relaunch (for interactive terminal use only)
dotnet build -f net10.0-maccatalyst # Build only
```

> **Run relaunch.sh from YOUR worktree**, not from `~/Projects/AutoPilot/PolyPilot/`.
> The script is tracked in git at `PolyPilot/relaunch.sh` and uses `dirname "$0"` to
> resolve its build directory, so each worktree's copy builds its own code.

#### ⚠️ Relaunch from a Copilot agent session

`relaunch.sh` is **async by default** — it returns immediately after a successful build, then kills the old UI and launches the new one in a detached background process after a 10-second delay. This is critical because PolyPilot hosts the Copilot sessions via TCP to the persistent CLI server. If the script blocked and killed the UI synchronously, the TCP connection would drop mid-tool-call and the agent's turn would be interrupted.
Expand All @@ -44,7 +48,7 @@ dotnet build -f net10.0-maccatalyst # Build only
**Correct pattern — keep working after relaunch:**
```bash
# Tool call 1: relaunch (returns immediately after build)
./relaunch.sh
PolyPilot/relaunch.sh
```
After relaunch.sh returns, the old UI will be killed in ~10s and a new one launched.
Your turn may get interrupted if a tool call is in-flight when the kill happens — that's OK,
Expand All @@ -61,10 +65,10 @@ maui devflow cdp Runtime evaluate '...'
**NEVER do this:**
```bash
# ❌ WRONG — chaining in the same bash call blocks the tool return
./relaunch.sh && sleep 15 && cat ~/.polypilot/relaunch.log
PolyPilot/relaunch.sh && sleep 15 && cat ~/.polypilot/relaunch.log

# ❌ WRONG — sleep/long commands chained after relaunch
./relaunch.sh; sleep 10; tail ~/.polypilot/relaunch.log
PolyPilot/relaunch.sh; sleep 10; tail ~/.polypilot/relaunch.log
```

The `--sync` flag restores the old blocking behavior (for human terminal use only — NEVER use from an agent).
Expand Down
Loading