Skip to content

Commit 7ff7c03

Browse files
committed
test(server): settle a pinned parent before checking its subagent child
Subagent children now wait for their parent to settle, so the unpinned-child test settles the parent first. It still fails if a child inherits the parent's pin.
1 parent 5cfcd04 commit 7ff7c03

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ it.effect.each([
158158
const savedParent = yield* store.getThread(parentThreadId);
159159
assert.deepEqual(savedParent.pinnedAt, parentCreatedAt);
160160
assert.equal(savedParent.pinOrderKey, "a0");
161+
// A subagent child waits for its parent, so settle the pinned parent first.
162+
assert.deepEqual(yield* store.getSettlementCandidates(), []);
163+
yield* store.apply({
164+
id: EventId.make(`event:${parentThreadId}:settled`),
165+
type: "thread.settled",
166+
threadId: parentThreadId,
167+
occurredAt: childCreatedAt,
168+
payload: {
169+
...savedParent,
170+
settledOverride: "settled",
171+
settledAt: childCreatedAt,
172+
pinnedAt: null,
173+
pinOrderKey: null,
174+
},
175+
});
161176
const candidates = yield* store.getSettlementCandidates();
162177
assert.deepEqual(
163178
candidates.map((candidate) => candidate.id),

0 commit comments

Comments
 (0)