Skip to content

Commit 7e666bf

Browse files
committed
fix(orchestration): correlate steered and stale aborts (#8939)
1 parent 20363c3 commit 7e666bf

6 files changed

Lines changed: 1931 additions & 526 deletions

File tree

‎apps/server/src/orchestration/Layers/ProviderCommandReactor.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
type ChatAttachment,
33
CommandId,
44
EventId,
5+
type MessageId,
56
type ModelSelection,
67
type OrchestrationEvent,
78
ProviderDriverKind,
@@ -930,6 +931,7 @@ const make = Effect.gen(function* () {
930931

931932
const buildSendTurnRequestForThread = Effect.fnUntraced(function* (input: {
932933
readonly threadId: ThreadId;
934+
readonly turnStartMessageId?: MessageId;
933935
readonly messageText: string;
934936
readonly attachments?: ReadonlyArray<ChatAttachment>;
935937
readonly modelSelection?: ModelSelection;
@@ -981,6 +983,9 @@ const make = Effect.gen(function* () {
981983

982984
return {
983985
threadId: input.threadId,
986+
...(input.turnStartMessageId !== undefined
987+
? { turnStartMessageId: input.turnStartMessageId }
988+
: {}),
984989
...(normalizedInput ? { input: normalizedInput } : {}),
985990
...(normalizedAttachments.length > 0 ? { attachments: normalizedAttachments } : {}),
986991
...(modelForTurn !== undefined ? { modelSelection: modelForTurn } : {}),
@@ -1546,6 +1551,7 @@ const make = Effect.gen(function* () {
15461551
}
15471552
const sendTurnRequest = yield* buildSendTurnRequestForThread({
15481553
threadId: event.payload.threadId,
1554+
turnStartMessageId: event.payload.messageId,
15491555
messageText: projectComposerContextForProvider({
15501556
text: message.text,
15511557
records: message.context?.records ?? [],

0 commit comments

Comments
 (0)