Skip to content

Commit dbf20d6

Browse files
test(server): a stream ending without a terminal interrupts open tool calls
#19131 sends a stream that ends cleanly without a root terminal through the same failure finalization, so its open tool calls end as interrupted too.
1 parent 07d993f commit dbf20d6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/RunExecutionService.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3844,6 +3844,24 @@ it.effect("fails the run when its event stream ends without a root terminal", ()
38443844
}),
38453845
);
38463846

3847+
it.effect("interrupts open tool calls when the stream ends without a root terminal", () =>
3848+
Effect.gen(function* () {
3849+
const { written } = yield* captureRootRunTermination({
3850+
key: "stream-end-open-tool",
3851+
shouldFinalizeRun: () => Effect.succeed(true),
3852+
events: (ids) =>
3853+
Stream.fromIterable([backgroundTurnItemEvent(ids, "command_execution", "running", 1)]),
3854+
});
3855+
assert.deepEqual(
3856+
written.map((item) => [item.type, item.status]),
3857+
[
3858+
["command_execution", "interrupted"],
3859+
["error", "failed"],
3860+
],
3861+
);
3862+
}),
3863+
);
3864+
38473865
it.effect("leaves the run to restart recovery when shutdown interrupts its event stream", () =>
38483866
Effect.gen(function* () {
38493867
const { written, observed } = yield* captureRootRunTermination({

0 commit comments

Comments
 (0)