Skip to content

Commit 307dfab

Browse files
test(server): Grok lineage replay checks each child thread's exact item order
The child-thread assertions only checked that each item type was present, so a reordered or extra row would still pass. They now assert the exact sequence, including the server child's early tool call after its reply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d9250c8 commit 307dfab

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • apps/server/src/orchestration-v2/testkit/fixtures/grok_subagent_lineage

‎apps/server/src/orchestration-v2/testkit/fixtures/grok_subagent_lineage/output.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
assertBaseProjection,
77
assertExecutionNodeKinds,
88
assertNoExtraAppRunsForProviderChildren,
9+
assertTurnItemTypeSequence,
910
assertTurnItemTypes,
1011
projectionFor,
1112
} from "../shared.ts";
@@ -82,14 +83,14 @@ export function assertGrokSubagentLineageOutput(
8283
// The server child runs a tool before its Task result names its session:
8384
// that call still lands in the child thread, in order, with its result.
8485
if (expected.sessionId === EXPECTED_CHILDREN[0].sessionId) {
85-
assertTurnItemTypes(child, ["user_message", "assistant_message", "dynamic_tool"]);
86+
assertTurnItemTypeSequence(child, ["user_message", "assistant_message", "dynamic_tool"]);
8687
const tool = child.turnItems.find((item) => item.type === "dynamic_tool");
8788
assert.deepEqual(tool?.type === "dynamic_tool" ? tool.input : null, {
8889
command: "ls apps/server/src",
8990
});
9091
assert.equal(tool?.status, "completed");
9192
} else {
92-
assertTurnItemTypes(child, ["user_message", "assistant_message"]);
93+
assertTurnItemTypeSequence(child, ["user_message", "assistant_message"]);
9394
}
9495
const assistant = child.messages.find((message) => message.role === "assistant");
9596
assert.isDefined(assistant);

0 commit comments

Comments
 (0)