fix(session): harden shell cancellation (#24553)

This commit is contained in:
Kit Langton
2026-04-27 16:47:18 -04:00
committed by GitHub
parent e0f3df8252
commit 139c4fd555
5 changed files with 190 additions and 151 deletions

View File

@@ -334,6 +334,22 @@ describe("Runner", () => {
}),
)
it.live(
"cancel does not mask shell defects",
Effect.gen(function* () {
const s = yield* Scope.Scope
const runner = Runner.make<string>(s, { onInterrupt: Effect.succeed("interrupted") })
const sh = yield* runner
.startShell(Effect.never.pipe(Effect.ensuring(Effect.die("boom")), Effect.as("ignored")))
.pipe(Effect.forkChild)
yield* Effect.sleep("10 millis")
yield* runner.cancel
expect(Exit.isFailure(yield* Fiber.await(sh))).toBe(true)
}),
)
// --- shell→run handoff ---
it.live(