singularity-forge/packages/pi-coding-agent/src
Jeremy McSpadden 71c3b12e70 fix: cmux library directory incorrectly loaded as extension (#1537)
* fix(#1526): auto-mode worktree commits land on main instead of milestone branch

GitServiceImpl.getMainBranch() was designed to detect manual /worktree worktrees
(worktree/<name> branches) but incorrectly applied the same logic to auto-mode
worktrees (milestone/<MID> branches). When no worktree/<name> branch existed,
it fell back to the current branch, which in certain contexts could be main,
causing slice commits to land on main instead of the milestone branch.

Fix: Detect if currently on a milestone/* branch first (auto-mode case) and
return it, before checking for worktree/* branches (manual worktree case).

- Modify getMainBranch() to detect milestone branches first
- Add test verifying getMainBranch() returns correct branch in auto-worktree
- All tests pass, build succeeds

Fixes #1526

* fix: cmux library directory incorrectly loaded as extension

The extension auto-discovery in resolveExtensionEntries() finds
index.js files in subdirectories and treats them as extensions.
The cmux directory has an index.js but it's a utility library
(imported by gsd and subagent extensions), not an extension itself.

Two changes:
1. When a package.json has a "pi" manifest, treat it as authoritative
   and don't fall through to index.ts/index.js auto-detection. This
   lets library directories opt out with "pi": {}.
2. Add package.json to cmux directory with empty pi manifest.
2026-03-19 21:14:25 -06:00
..
cli feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
core fix: cmux library directory incorrectly loaded as extension (#1537) 2026-03-19 21:14:25 -06:00
modes Merge pull request #1479 from frizynn/refactor/rpc-mode-dedup 2026-03-19 15:50:03 -06:00
resources/extensions/memory perf: add concurrency limits to unbounded Promise.all operations (#1029) 2026-03-17 18:29:28 -06:00
tests fix: normalize Windows paths in LLM-visible text to prevent bash failures (#874) (#884) 2026-03-17 09:02:23 -06:00
utils Merge pull request #1484 from frizynn/refactor/agent-session-decomposition 2026-03-19 15:48:59 -06:00
cli.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
config.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
index.ts refactor: consolidate extension type guards and inline handler type aliases 2026-03-19 14:55:00 -03:00
main.ts fix: failure recovery & resume safeguards (all 4 waves) (#956) 2026-03-17 16:03:49 -06:00
migrations.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00