Skip to content

Commit ece525c

Browse files
test(server): the steer retry test asserts its replayed delivery
The stub projection now holds the accepted steer in its completed run, so the retry is checked to succeed as "steered" rather than only to reach dispatch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e0c18c0 commit ece525c

1 file changed

Lines changed: 27 additions & 15 deletions

File tree

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

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,22 @@ const layerDispatchChokepointTest =
9898
model: "test",
9999
},
100100
},
101-
runs: [],
101+
// The steer retry test's send, accepted into a turn that has since ended.
102+
runs: [{ id: RunId.make("run:thread-management:steer-replay"), status: "completed" }],
102103
providerTurns: [],
104+
messages: [
105+
{
106+
id: MessageId.make("message:thread-management:steer-replay"),
107+
runId: RunId.make("run:thread-management:steer-replay"),
108+
},
109+
],
110+
turnItems: [
111+
{
112+
type: "user_message",
113+
messageId: MessageId.make("message:thread-management:steer-replay"),
114+
inputIntent: "steer",
115+
},
116+
],
103117
} as unknown as OrchestrationV2ThreadProjection),
104118
dispatch: (command) =>
105119
Effect.sync(() => {
@@ -221,21 +235,19 @@ it.effect("a retried steer replays its accepted send after the steered turn has
221235
});
222236

223237
const threads = yield* ThreadManagementService.ThreadManagementService;
224-
// The stub projection has no messages, so the send fails after dispatch; only the dispatch matters.
225-
yield* Effect.exit(
226-
threads.sendToThread({
227-
projectId,
228-
commandId,
229-
threadId,
230-
messageId: MessageId.make("message:thread-management:steer-replay"),
231-
text: "CI failed.",
232-
attachments: [],
233-
mode: "steer",
234-
createdBy: "user",
235-
creationSource: "server",
236-
}),
237-
);
238+
const result = yield* threads.sendToThread({
239+
projectId,
240+
commandId,
241+
threadId,
242+
messageId: MessageId.make("message:thread-management:steer-replay"),
243+
text: "CI failed.",
244+
attachments: [],
245+
mode: "steer",
246+
createdBy: "user",
247+
creationSource: "server",
248+
});
238249

250+
expect(result.delivery).toBe("steered");
239251
expect(dispatched).toEqual(["message.dispatch"]);
240252
}).pipe(Effect.provide(layerTest));
241253
});

0 commit comments

Comments
 (0)