| name | pan-sync-main |
| description | pan sync-main <id> — merge latest main into the feature branch for an active workspace |
| triggers | ["sync with main","sync main into workspace","pull in hotfix","merge main into branch","pan sync-main","get latest changes from main"] |
| allowed-tools | ["Bash","Read"] |
Sync with Main
Merges the latest main branch into a workspace's feature branch. Uses git merge (not rebase) to avoid rewriting history, and delegates conflict resolution to the merge-agent specialist.
Usage
pan sync-main PAN-XXX
curl -X POST http://localhost:3011/api/issues/PAN-XXX/sync-main
What It Does
- Checks for uncommitted changes (blocks if any — must commit or
pan workspace discard --confirm first; agents never git stash)
- Cleans up any stale git locks
- Runs
git fetch origin main
- Runs
git merge origin/main
- If clean merge: reports commit count and changed files
- If conflicts: wakes the merge-agent specialist to resolve them
- After conflict resolution: scans for leftover markers, then reports result
Outcomes
| Result | Meaning |
|---|
| Already up to date | Main has no new commits since last sync |
| Success (N commits) | Clean merge or agent-resolved conflicts |
| Uncommitted changes | Commit or discard workspace changes first |
| Conflict (unresolvable) | Agent could not resolve — merge aborted, workspace unchanged |
Design Decisions
- Merge, not rebase — Rebase rewrites SHAs and requires force-push. Merge commits serve as audit markers.
- No tests/builds — Feature branch is WIP. Running tests after sync would fail on pre-existing issues.
- No push to remote — This is a local workspace operation only.
- All-or-nothing for polyrepo — If any repo fails, all are aborted (not implemented yet; sync is per-workspace).
Examples
pan sync-main PAN-123
Dashboard
The "Sync with Main" button appears in the workspace detail panel:
- In the Git Status section as a small "Sync" button next to the branch name (disabled if uncommitted changes)
- In the Actions section as a full "Sync with Main" button
Related Commands
pan approve <id> — Review and merge to main
pan review request <id> — Trigger review pipeline
pan tell <id> "<message>" — Send message to agent