mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-26 03:03:04 +00:00
test(server): preserve accepted turn stream order
The manager-owned accepted turn boundary intentionally precedes coalesced output. Assert that lifecycle event explicitly while retaining the timeline-before-terminal ordering contract.
This commit is contained in:
@@ -1248,6 +1248,10 @@ describe("target coalesced behavior", () => {
|
||||
await waitForSessionEventQueue();
|
||||
|
||||
await expect(firstEvent).resolves.toEqual({
|
||||
done: false,
|
||||
value: { type: "turn_started", provider: "codex", turnId: "turn-1" },
|
||||
});
|
||||
await expect(stream.next()).resolves.toEqual({
|
||||
done: false,
|
||||
value: {
|
||||
type: "timeline",
|
||||
@@ -1267,14 +1271,20 @@ describe("target coalesced behavior", () => {
|
||||
expect(getTimelineItems(rows)).toEqual([{ type: "assistant_message", text: "hello world" }]);
|
||||
expect(streamEvents[0]).toMatchObject({
|
||||
type: "agent_stream",
|
||||
event: {
|
||||
type: "timeline",
|
||||
item: { type: "assistant_message", text: "hello world" },
|
||||
},
|
||||
event: { type: "turn_started", provider: "codex", turnId: "turn-1" },
|
||||
});
|
||||
expect(streamEvents[1]).toMatchObject({
|
||||
type: "agent_stream",
|
||||
event: { type: "turn_completed" },
|
||||
event: {
|
||||
type: "timeline",
|
||||
provider: "codex",
|
||||
turnId: "turn-1",
|
||||
item: { type: "assistant_message", text: "hello world" },
|
||||
},
|
||||
});
|
||||
expect(streamEvents[2]).toMatchObject({
|
||||
type: "agent_stream",
|
||||
event: { type: "turn_completed", provider: "codex", turnId: "turn-1" },
|
||||
});
|
||||
} finally {
|
||||
harness.cleanup();
|
||||
|
||||
Reference in New Issue
Block a user