fix(app): prefill new agent cwd with main repo for worktrees

This commit is contained in:
Mohamed Boudra
2026-02-18 20:35:49 +07:00
parent e22f183bb2
commit e8c4ae2024
2 changed files with 36 additions and 1 deletions
@@ -26,6 +26,18 @@ describe("resolveNewAgentWorkingDir", () => {
expect(resolveNewAgentWorkingDir("/repo/path", null)).toBe("/repo/path");
});
it("falls back to repo root when checkout metadata is unavailable", () => {
expect(resolveNewAgentWorkingDir("/repo/.paseo/worktrees/feature", null)).toBe(
"/repo"
);
});
it("supports windows-style paseo worktree paths without checkout metadata", () => {
expect(
resolveNewAgentWorkingDir("C:\\Users\\me\\repo\\.paseo\\worktrees\\feature", null)
).toBe("C:\\Users\\me\\repo");
});
it("returns the main repo root for paseo-owned worktrees", () => {
const checkout = {
isPaseoOwnedWorktree: true,