Skip to content

Commit 09a547b

Browse files
navidnadaliclaude
andcommitted
test(server): the finalize test checks each transfer read names the child
The read observer kept only query text, so a transfer read bound to another thread still looked narrowed. It now keeps each transfer read's bound ids and requires the finishing child's thread among them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7bab847 commit 09a547b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4059,6 +4059,7 @@ it.layer(layerTest)("delegated tasks across a server restart", (it) => {
40594059
]),
40604060
});
40614061
const parentReads: Array<string> = [];
4062+
const transferReadParams: Array<ReadonlyArray<unknown>> = [];
40624063
const observe: Statement.Transformer = (statement) => {
40634064
const [query, params] = statement.compile();
40644065
if (
@@ -4069,6 +4070,9 @@ it.layer(layerTest)("delegated tasks across a server restart", (it) => {
40694070
))
40704071
) {
40714072
parentReads.push(query);
4073+
if (query.includes("FROM orchestration_v2_projection_context_transfers")) {
4074+
transferReadParams.push(params);
4075+
}
40724076
}
40734077
return Effect.succeed(statement);
40744078
};
@@ -4097,6 +4101,12 @@ it.layer(layerTest)("delegated tasks across a server restart", (it) => {
40974101
[],
40984102
"a parent context-transfer read is not narrowed",
40994103
);
4104+
// An existing result transfer is found only when the read asks for this child's.
4105+
assert.deepEqual(
4106+
transferReadParams.filter((params) => !params.includes(child.childThreadId)),
4107+
[],
4108+
"a parent context-transfer read names another thread",
4109+
);
41004110
// Nodes and cards by the task's node, messages by id.
41014111
for (const [table, narrowed] of [
41024112
["nodes", /AND node\.node_id IN/],

0 commit comments

Comments
 (0)