fix(bash): kept persistent shells after cancel

Stopped marking persistent bash sessions as permanently broken when the JavaScript abort or timeout race wins.

Stopped the Rust descendant kill-wave helper once no cancellation targets remain so later commands are not swept into old cancels.

Fixes #1347
This commit is contained in:
roboomp
2026-05-25 18:40:22 +00:00
parent de5b0a51e2
commit 8e5c7c9bf1
3 changed files with 24 additions and 12 deletions
@@ -197,6 +197,20 @@ describe("executeBash", () => {
expect(raced.result.output).toContain("Command cancelled");
}
expect(abortSpy).toHaveBeenCalled();
vi.restoreAllMocks();
await executeBash("export PI_AFTER_ABORT=still_persistent", {
cwd: tempDir,
timeout: 5000,
sessionKey: "hung-native-abort",
});
const next = await executeBash("printf '%s\n' \"$PI_AFTER_ABORT\"", {
cwd: tempDir,
timeout: 5000,
sessionKey: "hung-native-abort",
});
expect(next.output.trim()).toBe("still_persistent");
});
it("returns at the JavaScript timeout when native timeout cleanup stalls", async () => {