mirror of
https://github.com/wassname/pi-plan.git
synced 2026-09-26 14:10:23 +08:00
Treat stale pane close as successful cleanup
Co-Authored-By: PI[gpt-5.6-sol] <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
co-authored by
PI[gpt-5.6-sol]
parent
c5782ee2aa
commit
7eb8b1f46b
+1
-1
@@ -76,7 +76,7 @@ export async function openSupervisorPane(input: LaunchSupervisorInput): Promise<
|
||||
await herdr(["pane", "run", paneId, supervisorCommand(input)]);
|
||||
return paneId;
|
||||
} catch (error) {
|
||||
await herdr(["pane", "close", paneId]);
|
||||
await closeSupervisorPane(paneId);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -37,7 +37,7 @@ describe("supervisor pane command", () => {
|
||||
writeFileSync(bin, `#!/bin/sh
|
||||
if [ "$1" = "--version" ]; then echo "herdr 0.8.2"; exit 0; fi
|
||||
if [ "$1" = "pane" ] && [ "$2" = "split" ]; then echo '{"pane_id":"new-pane"}'; exit 0; fi
|
||||
if [ "$1" = "pane" ] && [ "$2" = "run" ]; then echo '{}'; exit 0; fi
|
||||
if [ "$1" = "pane" ] && [ "$2" = "run" ]; then if [ "$HERDR_SMOKE_RUN_FAIL" = "1" ]; then echo "run failed" >&2; exit 1; fi; echo '{}'; exit 0; fi
|
||||
if [ "$1" = "pane" ] && [ "$2" = "close" ]; then echo '{"error":{"code":"PANE_GONE"}}' >&2; exit 1; fi
|
||||
exit 2
|
||||
`);
|
||||
@@ -47,6 +47,8 @@ exit 2
|
||||
try {
|
||||
await expect(openSupervisorPane(input())).resolves.toBe("new-pane");
|
||||
await expect(closeSupervisorPane("new-pane")).resolves.toBeUndefined();
|
||||
vi.stubEnv("HERDR_SMOKE_RUN_FAIL", "1");
|
||||
await expect(openSupervisorPane(input())).rejects.toThrow("run failed");
|
||||
} finally {
|
||||
rmSync(cwd, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user